## duoram
#  Copyright (C) 2020  duoram authors
#
#  @file    Makefile
#  @brief   Makefile for compiling duoram
#
 
#  @license GNU Public License (version 2); see LICENSE for full license text
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License along
#    with this program; if not, write to the Free Software Foundation, Inc.,
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
CXX = g++
CXXFLAGS = -g -march=native -std=c++17 -Wall -pedantic -fopenmp -O3 -Wno-ignored-attributes -pthread
LIBS = -lbsd
FLAGS =  -DBOOST_ERROR_CODE_HEADER_ONLY -DThreeParty
DEBUGFLAGS = -DBOOST_ERROR_CODE_HEADER_ONLY -DThreeParty -DDEBUG -DVERBOSE
TWOFLAGS = -DBOOST_ERROR_CODE_HEADER_ONLY
all: duoram0 duoram1 p2 debugp2 debugduoram1 debugduoram0 2Pduoram1 2Pduoram0

p2: p2.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o  p2 p2.cpp $(LIBS) $(FLAGS) -I.

duoram1: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o duoram1 duoram.cpp $(LIBS) $(FLAGS) -DPARTY=1 -I.

duoram0: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o duoram0 duoram.cpp $(LIBS) $(FLAGS) -DPARTY=0 -I.

debugp2: p2.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o  debugp2 p2.cpp $(LIBS) $(DEBUGFLAGS) -I.

debugduoram1: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o debugduoram1 duoram.cpp $(LIBS) $(DEBUGFLAGS) -DPARTY=1 -I.

debugduoram0: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o debugduoram0 duoram.cpp $(LIBS) $(DEBUGFLAGS) -DPARTY=0 -I.

2Pduoram1: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o 2Pduoram1 duoram.cpp $(LIBS) $(TWOFLAGS) -DPARTY=1 -I.

2Pduoram0: duoram.cpp duoram-utils.h duoram-read.h duoram-write.h duoram-refresh.h readvectors.h
	$(CXX) $(CXXFLAGS) -o 2Pduoram0 duoram.cpp $(LIBS) $(TWOFLAGS) -DPARTY=0 -I.
clean: 
	 rm duoram0 duoram1 p2 debugp2 debugduoram1 debugduoram0 2Pduoram1 2Pduoram0

docs:
	doxygen Doxyfile

.PHONY: directories


