-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (41 loc) · 1.64 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
default: native
# Identify all directory locations
EMP_DIR = ../Empirical
TARGET := QBL
CPP_FILES := QBL.cpp Question_MultipleChoice.cpp Question_ShortAnswer.cpp
# Specify sets of compilation flags to use
FLAGS_version := -std=c++20
FLAGS_warn = -Wall -Wextra -Wno-unused-function -Woverloaded-virtual -pedantic
FLAGS_include = -I$(EMP_DIR)/include/ -I${EMP_DIR}/third-party/cereal/include/
FLAGS_main = $(FLAGS_version) $(FLAGS_warn) $(FLAGS_include) -pthread
FLAGS_QUICK = $(FLAGS_main) -DNDEBUG
FLAGS_DEBUG = $(FLAGS_main) -g -DEMP_TRACK_MEM
FLAGS_OPT = $(FLAGS_main) -O3 -DNDEBUG
FLAGS_GRUMPY = $(FLAGS_main) -DNDEBUG -Wconversion -Weffc++
FLAGS_EMSCRIPTEN = --js-library $(EMP_DIR)/web/library_emp.js -s EXPORTED_FUNCTIONS="['_main', '_empCppCallback']" -s NO_EXIT_RUNTIME=1 -s TOTAL_MEMORY=67108864
FLAGS_COVERAGE = $(FLAGS_main) -O0 -DEMP_TRACK_MEM -ftemplate-backtrace-limit=0 -fprofile-instr-generate -fcoverage-mapping -fno-inline -fno-elide-constructors
native: FLAGS := $(FLAGS_OPT)
native: $(TARGET)
debug: FLAGS := $(FLAGS_DEBUG)
debug: $(TARGET)
grumpy: FLAGS := $(FLAGS_GRUMPY)
grumpy: $(TARGET)
quick: FLAGS := $(FLAGS_QUICK)
quick: $(TARGET)
$(TARGET): $(CPP_FILES)
$(CXX) $(FLAGS) $(CPP_FILES) -o $(TARGET)
new: clean
new: native
CXX = g++
# Debugging information
#print-%: ; @echo $*=$($*)
print-%: ; @echo '$(subst ','\'',$*=$($*))'
CLEAN_BACKUP = *~ *.dSYM
CLEAN_TEST = *.out *.o *.gcda *.gcno *.info *.gcov ./Coverage* ./temp
CLEAN_EXTRA =
CLEAN_FILES = $(CLEAN_BACKUP) $(CLEAN_TEST) $(CLEAN_EXTRA) $(TARGET)
clean:
@echo About to remove:
@echo $(wildcard $(CLEAN_FILES))
@echo ----
rm -rf $(wildcard $(CLEAN_FILES))