-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.69 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
CPPFLAGS += -std=c++23 -fdiagnostics-color=always -Wfatal-errors -Wall \
-DVERSION=\"$(shell git describe --tags --always --dirty)\" -DBUILD_TIMESTAMP=\"$(shell date -u '+%FT%T')\"
#Enable if e.g. custom boost, rapidjson, fmt or tbb include dir
CPPFLAGSCUSTOM = -I/opt/local/include
LDLIBS = -lboost_system -lboost_chrono -lboost_thread -lpthread -ltbb -lstdc++fs
#Enable if e.g. custom boost, rapidjson, fmt or tbb lib dir
LDFLAGSCUSTOM = -L/opt/local/lib
FILES = src/asm/asm.cpp src/maker/maker_reflection.cpp src/communication/ReceiveHandler.cpp src/logger/logger.cpp src/modules/*.cpp src/testcases/*.cpp src/main.cpp
TARGET = asm
STRIP = strip -s
ECHO = echo
.PHONY: help clean ctags
help:
@$(ECHO) "Available targets are:"
@$(ECHO) "make $(TARGET)_debug"
@$(ECHO) "make $(TARGET)_release"
@$(ECHO) "make clean"
@$(ECHO) "make valgrind"
@$(ECHO) "make cachegrind"
@$(ECHO) "make ctags"
$(TARGET)_debug: $(FILES)
$(CXX) $(CPPFLAGS) -g -Og -DLOG_TRACE_ON $(CPPFLAGSCUSTOM) $(LDFLAGS) $(LDFLAGSCUSTOM) -o $@ $? $(LDLIBS)
$(TARGET)_release: $(FILES)
$(CXX) $(CPPFLAGS) -Ofast -DLOG_TRACE_ON $(CPPFLAGSCUSTOM) $(LDFLAGS) $(LDFLAGSCUSTOM) -o $@ $? $(LDLIBS)
$(STRIP) $@
clean:
-$(RM) $(TARGET)_release $(TARGET)_debug CppCheck* cachegrind* system-dump.json
valgrind: $(TARGET)_debug
@valgrind --version
valgrind --leak-check=full --track-origins=yes --xml=yes --xml-file=ValgrindOut.xml "./$(TARGET)_debug"
cachegrind: $(TARGET)_release
@valgrind --version
valgrind --tool=cachegrind "./$(TARGET)_release"
ctags:
@ctags -R .
# E.g. run with custom lib path: LD_LIBRARY_PATH="/opt/local/lib" ./asm_xxx