forked from chiraag/gazelle_mpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (75 loc) · 3.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This file is based on the PALISADE Makefile
# Multi OS makefile (No Windows yet)
UNAME_S := $(shell uname -s)
HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
SYSTEM ?= $(HOST_SYSTEM)
CPPSTD := -std=c++14 -fPIC
ifeq ($(SYSTEM),Darwin)
CC := /usr/local/opt/llvm/bin/clang++ $(CPPSTD)
LDFLAGS += -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CPPFLAGS += -I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1/
LIBSUFFIX := .dylib
LIBCMD := -dynamiclib -undefined suppress -flat_namespace
else
CC := g++ $(CPPSTD)
# Suppress warnings from alignment of STL structs of blocks
CPPFLAGS += -Wno-ignored-attributes
LIBSUFFIX := .so
LIBCMD := -fPIC -shared -Wl,--export-dynamic,-z,defs
endif
RDYNAMIC := -rdynamic
COMPTHREADFLAG := -pthread
LOADTHREADFLAG := -pthread
# LDFLAGS += -lboost_system -lboost_thread -fsanitize=address
LDFLAGS += -lboost_system -lboost_thread
#main best performance configuration for parallel operation - cross-platform
# CPPFLAGS += -maes -msse4 -g -Wall -Werror -fsanitize=address $(COMPTHREADFLAG) ##undefine for parallel best performance operation with debug
# CPPFLAGS += -maes -msse4 -g -O3 -Wall -fno-omit-frame-pointer $(COMPTHREADFLAG) ##undefine for parallel best performance operation with debug
CPPFLAGS += -maes -msse4 -O3 -Wall -fno-omit-frame-pointer $(COMPTHREADFLAG) ##undefine for parallel best performance operation
TEST_LIB := $(LOADTHREADFLAG)
#build and bin directory
BUILDDIR := build
BINDIR := bin
#cryptoTools locations
MIRACL_LIBDIR := third_party/cryptoTools/thirdparty/linux/miracl/miracl/source
MIRACL_INCDIR := third_party/cryptoTools/thirdparty/linux/miracl
LIBCMD += -L$(MIRACL_LIBDIR)
# BOOST_LIBDIR := third_party/cryptoTools/thirdparty/linux/boost/stage/lib/
# BOODT_INCDIR := third_party/cryptoTools/thirdparty/linux/boost
# LIBCMD += -L$(BOOST_LIBDIR)
CT_LIBDIR := third_party/cryptoTools/lib
CT_INCDIR := third_party/cryptoTools
LIBCMD += -L$(CT_LIBDIR)
#LDFLAGS += -lmiracl -lcryptoTools
#sources folders
EXTLIBDIR := bin/lib
EXTTESTDIR := bin/unittest
EXTDEMODIR := bin/demo
# extentions for source and header files
SRCEXT := cpp
HDREXT := h
$(objects) : %.o : %.cpp
# External libraries
#EXTLIB := -L$(EXTLIBDIR) $(TEST_LIB) -pg ## include profiling
EXTLIB := -L$(EXTLIBDIR) $(TEST_LIB) ## no-profiling
INC := -I src/lib -I test -I $(CT_INCDIR) -I $(MIRACL_INCDIR)
# INC += -I $(BOODT_INCDIR)
#the name of the shared object library
CORELIB := libgazelle$(LIBSUFFIX)
# run make for all components. you can run any individual component separately
# by invoking "make alltargets" for example
# each corresponding makefile will make the allxxxx target
all: allcore
alldemos: allcoredemos
testall: testcore
# clean up all components. you can clean any individual compoenent separately
# by invoking "make cleantargets" for example
# each corresponding makefile will make the cleanxxxx target
.PHONEY: clean
clean: cleancore
@echo 'Cleaning top level autogenerated directories'
$(RM) -f test/include/gtest/gtest-all.o
$(RM) -rf bin
include Makefile.src
test/include/gtest/gtest-all.o: test/include/gtest/gtest-all.cc
$(CC) -c $(CPPFLAGS) -o $@ $<