-
Notifications
You must be signed in to change notification settings - Fork 7
/
makefile
111 lines (86 loc) · 2.31 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
RM := rm -rf
MKDIR_P = mkdir -p
UNUSED := -Wno-unused-variable
HEADERS += \
src/parser.h \
src/replay.h \
src/analyzer.h \
src/analysis.h \
src/compressor.h \
src/enums.h \
src/schema.h \
src/gecko-legacy.h \
src/util.h
HEADERS_TEST += \
src/tests.h
OBJS += \
build/parser.o \
build/replay.o \
build/analyzer.o \
build/analysis.o \
build/compressor.o
CPP_DEPS += \
build/parser.d \
build/replay.d \
build/analyzer.d \
build/analysis.d \
build/compressor.d
OBJS_MAIN = ${OBJS} build/main.o
CPP_DEPS_MAIN = ${CPP_DEPS} build/main.d
OBJS_TEST = ${OBJS} build/tests.o
CPP_DEPS_TEST = ${CPP_DEPS} build/tests.d
DEFINES += \
-D__GXX_EXPERIMENTAL_CXX0X__
OUT_DIR = build
# OLEVEL := -O0
OLEVEL := -O3
# OLEVEL := -Ofast -march=native -frename-registers -fno-signed-zeros -fno-trapping-math
all: directories base
base: INCLUDES += -I/usr/include/lzma
base: LIBS += -llzma
base: slippc
test: INCLUDES += -I/usr/include/lzma
test: LIBS += -llzma
test: slippc-tests
gui: GUI = -DGUI_ENABLED=1
gui: base
static: LIBS += -L ./lib-lin -static -llzma
static: slippc
statictest: LIBS += -L ./lib-lin -static -llzma
statictest: slippc-tests
staticgui: GUI = -DGUI_ENABLED=1
staticgui: static
slippc: $(OBJS_MAIN)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -L/usr/lib -std=c++17 -o "./slippc" $(OBJS_MAIN) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
slippc-tests: $(OBJS_TEST)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -L/usr/lib -std=c++17 -o "./slippc-tests" $(OBJS_TEST) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
build/tests.o: ./src/tests.cpp $(HEADERS_TEST)
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
$(LINK.c) $< -c -o $@
g++ $(DEFINES) $(GUI) $(INCLUDES) $(OLEVEL) -g3 -Wall -c -fmessage-length=0 -std=c++17 $(UNUSED) -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
build/%.o: ./src/%.cpp $(HEADERS)
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
$(LINK.c) $< -c -o $@
g++ $(DEFINES) $(GUI) $(INCLUDES) $(OLEVEL) -g3 -Wall -c -fmessage-length=0 -std=c++17 $(UNUSED) -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
clean:
-$(RM) $(OBJS_MAIN) $(OBJS_TEST) $(C++_DEPS) ./slippc ./slippc-tests
-@echo ' '
directories: ${OUT_DIR}
${OUT_DIR}:
${MKDIR_P} ${OUT_DIR}
.PHONY: all clean dependents directories
.SECONDARY: