-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (48 loc) · 2 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
# Target project
# PROJECT options: alt-signal-exp, chg-env-exp, bool-calc-exp
PROJECT ?= bool-calc-exp
# - Repeated signal task -
# PROJECT := alt-signal-exp
# - Changing signal task -
# PROJECT := chg-env-exp
# Dependency directories
EMP_DIR ?= ../Empirical/include
SGP_DIR ?= ../SignalGP/source
# Compile-time parameter configuration (tag metric, matching threshold, matching regulator, tag size)
# MATCH_METRIC options: hamming, hash, integer, integer-symmetric, streak, streak-exact
MATCH_METRIC ?= streak
# MATCH_THRESH options: 0, 25, 50, 75
MATCH_THRESH ?= 0
# MATCH_REG options: add, mult, exp
MATCH_REG ?= exp
# TAG_NUM_BITS
TAG_NUM_BITS ?= 256
# Executable name
# combine it all into the executable name
EXEC_NAME := $(PROJECT)_tag-len-$(TAG_NUM_BITS)_match-metric-$(MATCH_METRIC)_thresh-$(MATCH_THRESH)_reg-$(MATCH_REG)
# Flags to use regardless of compiler
# CFLAGS_openssl := -I$(OPEN_SSL_DIR)/include -L$(OPEN_SSL_DIR)/lib
CFLAGS_includes := -I./source/ -I$(EMP_DIR)/ -I$(SGP_DIR)/
CFLAGS_links := -lssl -lcrypto
CFLAGS_all := -Wall -Wno-unused-function -pedantic -std=c++17 -DEMP_HAS_CRYPTO=1 -DMATCH_METRIC=$(MATCH_METRIC) -DMATCH_THRESH=$(MATCH_THRESH) -DMATCH_REG=$(MATCH_REG) -DTAG_NUM_BITS=$(TAG_NUM_BITS) $(CFLAGS_openssl) $(CFLAGS_includes) $(CFLAGS_links)
# Native compiler information
CXX_nat := g++
CFLAGS_nat := -O3 -DNDEBUG $(CFLAGS_all)
CFLAGS_nat_debug := -g $(CFLAGS_all)
default: $(PROJECT)
native: $(PROJECT)
all: $(PROJECT)
debug: CFLAGS_nat := $(CFLAGS_nat_debug)
debug: $(PROJECT)
$(PROJECT): source/native/$(PROJECT).cc
$(CXX_nat) $(CFLAGS_nat) source/native/$(PROJECT).cc -o $(EXEC_NAME)
clean:
rm -rf $(PROJECT)_*.dSYM
rm -f $(PROJECT) $(PROJECT)_tag-len-*_match-metric-* *~ source/*.o test_debug.out test_optimized.out unit_tests.gcda unit_tests.gcno
rm -rf test_debug.out.dSYM
test: clean
test: tests/unit_tests.cc
$(CXX_nat) $(CFLAGS_nat_debug) -I./source/ --coverage tests/unit_tests.cc -o test_debug.out
./test_debug.out
# Debugging information
print-%: ; @echo '$(subst ','\'',$*=$($*))'