-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 996 Bytes
/
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
# Project-specific settings
EMP_DIR := third-party/Empirical/include
SGP_DIR := third-party/SignalGP/include
PSB_DIR := third-party/psb-cpp/include
CEREAL_DIR := third-party/Empirical/third-party/cereal/include
# PROJECT := diagnostics
PROJECT := prog_synth
MAIN_CPP ?= source/${PROJECT}.cpp
# Flags to use regardless of compiler
CFLAGS_all := -Wall -Wno-unused-function -std=c++17 -lstdc++fs -I$(EMP_DIR)/ -Iinclude/ -Ithird-party/ -I$(SGP_DIR)/ -I$(PSB_DIR)/
# Native compiler information
CXX ?= g++
CXX_nat = $(CXX)
CFLAGS_nat := -O3 -DNDEBUG $(CFLAGS_all) # -msse4.2
CFLAGS_nat_debug := -g -DEMP_TRACK_MEM $(CFLAGS_all)
default: $(PROJECT)
native: $(PROJECT)
all: $(PROJECT) $(PROJECT).js
debug: CFLAGS_nat := $(CFLAGS_nat_debug)
debug: $(PROJECT)
$(PROJECT): ${MAIN_CPP} include/
$(CXX_nat) $(CFLAGS_nat) ${MAIN_CPP} -o $(PROJECT)
clean:
rm -f $(PROJECT) web/$(PROJECT).js web/*.js.map web/*.js.map *~ source/*.o
# Debugging information
print-%: ; @echo '$(subst ','\'',$*=$($*))'