forked from carlovitellio/election-manipulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.inc
74 lines (53 loc) · 1.71 KB
/
Makefile.inc
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
# The directory where the Makefile resides
ROOT=/home/carlo/election-manipulation
# Where the Boost library resides
mkBoostInc=/usr/local/boost_1_77_0
MUPARSER_INC_DIR = /home/carlo/pacs-examples/Examples/include
MUPARSER_LIB_DIR = /home/carlo/pacs-examples/Examples/lib
LDLIBS += -L$(MUPARSER_LIB_DIR) -lmuparser
# The C++ compiler
mkCxxCompiler?=g++
CXX = ${mkCxxCompiler}
LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
# Example
# -DNDEBUG disactivates asserts
DEFINES=
# OPTIMIZATION
# Warning flags: Level of warning
# -Wall main warnings activated
# -Wextra some extra warnings activated
# -Wsuggest-override as the name says
# -Wnon-virtual-dtor Warns if a class with virtual meths oda does not have virt dstructors
# -Weffc++ Wanrs about violation of the coding style in Scott Mayer's Effective C++
WARNFLAGS=-Wall -Wextra -Wsuggest-override -Wnon-virtual-dtor
# Optimization flags : May be selected by using the variable RELEASE
#
# -c compile only, generate corresponding .o files
# -g generate code suitable for the debugger
# -p generate code suitable for the profiler
# -O attemp code optimizations
ifdef RELEASE
DEBUG=no
else
DEBUG=yes
endif
ifeq ($(DEBUG),yes)
OPTFLAGS=-O0 -g
LDFLAGS=-Wl,-rpath=$(MUPARSER_LIB_DIR)
else
OPTFLAGS=-O3 -funroll-loops
DEFINES+=-DNDEBUG
LDFLAGS=-Wl,-rpath=$(MUPARSER_LIB_DIR)
endif
export STDFLAGS=-std=c++17
export CC
export CXX
export DOXYFILE=$(ROOT)/Doxyfile
BOOST_DIR=$(mkBoostInc)
INCLS = -I. -I$(ROOT)/include -I$(BOOST_DIR) -I$(MUPARSER_INC_DIR)
export CPPFLAGS=$(INCLS) $(DEFINES) $(VERBOSITY)
export CXXFLAGS=$(OPTFLAGS) $(STDFLAGS) $(WARNFLAGS)
export CCFLAGS=$(CXXFLAGS)
export LDFLAGS+=$(OPTFLAGS)
export DEPEND=make.dep
export ARFLAGS=rsU