CXX = g++
CXXFLAGS = -g -march=native -std=c++17 -Wall -pedantic -fopenmp -O3 -Wno-ignored-attributes -pthread
LIBS = -lbsd -lboost_system -lboost_thread -pthread
FLAGS = -DBOOST_ERROR_CODE_HEADER_ONLY #-DDEBUG
FLAGSDEBUG 	 =  -DBOOST_ERROR_CODE_HEADER_ONLY -DDEBUG
FLAGSVERBOSE =  -DBOOST_ERROR_CODE_HEADER_ONLY -DDEBUG -DVERBOSE
# OPENSSL_INCLUDE ?= -I/usr/include/openssl
# CXXFLAGS += $(OPENSSL_INCLUDE)
# OPENSSL_LIBS ?= -lcrypto
# LIBS += $(OPENSSL_LIBS)

#BINDIR = bin 

all: directories preprocessing0 preprocessing1 p2preprocessing 
debug: debugpreprocessing0 debugpreprocessing1 debugp2preprocessing
verbose: verbosepreprocessing0 verbosepreprocessing1 verbosep2preprocessing

preprocessing0: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o preprocessing0 preprocessing.cpp $(LIBS) $(FLAGS) -DPARTY=0 -I.

preprocessing1: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o preprocessing1 preprocessing.cpp $(LIBS) $(FLAGS) -DPARTY=1 -I.

p2preprocessing: p2preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o  p2preprocessing p2preprocessing.cpp $(LIBS) $(FLAGS) -I.

debugpreprocessing0: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o debugpreprocessing0 preprocessing.cpp $(LIBS) $(FLAGSDEBUG) -DPARTY=0 -I.

debugpreprocessing1: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o debugpreprocessing1 preprocessing.cpp $(LIBS) $(FLAGSDEBUG) -DPARTY=1 -I.

debugp2preprocessing: p2preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o  debugp2preprocessing p2preprocessing.cpp $(LIBS) $(FLAGSDEBUG) -I.

verbosepreprocessing0: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o verbosepreprocessing0 preprocessing.cpp $(LIBS) $(FLAGSVERBOSE) -DPARTY=0 -I.

verbosepreprocessing1: preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o verbosepreprocessing1 preprocessing.cpp $(LIBS) $(FLAGSVERBOSE) -DPARTY=1 -I.

verbosep2preprocessing: p2preprocessing.cpp block.h bitutils.h prg_aes_impl.h prg.h dpfgen.h mpc.h share-conversion.h aes.h filesio.h #dpf++/dpf.h  
	$(CXX) $(CXXFLAGS) -o  verbosep2preprocessing p2preprocessing.cpp $(LIBS) $(FLAGSVERBOSE) -I.

docs:
	doxygen Doxyfile

.PHONY: directories

directories: $(BINDIR)

# $(BINDIR):
# 	mkdir -p $(BINDIR)

clean:
	rm -f p2preprocessing preprocessing1 preprocessing0 verbosepreprocessing0 verbosepreprocessing1 verbosep2preprocessing debugpreprocessing0 debugpreprocessing1 debugp2preprocessing


