fork/slippc

git clone https://git.julia.blue/fork/slippc

Patrick CrainAdded static LZMA libraries and headers for static compilation; updated makefiles to allow for compilation with GUI and/or static LZMA39f196d

0.6.0
1.8 KiB85 linesraw
1RM := rm -rf
2MKDIR_P = mkdir -p
3# INCLUDES := -I/usr/include/lzma
4# LIBS := -L ./lib-win -static -llzma
5
6UNUSED := -Wno-unused-variable
7
8HEADERS += \
9src/parser.h \
10src/replay.h \
11src/analyzer.h \
12src/analysis.h \
13src/compressor.h \
14src/enums.h \
15src/schema.h \
16src/util.h
17
18OBJS += \
19build-win/parser.o \
20build-win/replay.o \
21build-win/analyzer.o \
22build-win/analysis.o \
23build-win/compressor.o \
24build-win/main.o
25
26CPP_DEPS += \
27build-win/parser.d \
28build-win/replay.d \
29build-win/analyzer.d \
30build-win/analysis.d \
31build-win/compressor.d \
32build-win/main.d
33
34DEFINES += \
35	-D__GXX_EXPERIMENTAL_CXX0X__
36
37OUT_DIR = build-win
38
39OLEVEL := -O0
40# OLEVEL := -O3
41# OLEVEL := -Ofast -march=native -frename-registers -fno-signed-zeros -fno-trapping-math
42
43all: static # TODO: link towards system LZMA library when possible
44
45# base: INCLUDES += -I/usr/include/lzma -llzma
46# base: LIBS += -llzma
47# base: targets
48
49# gui: GUI = -DGUI_ENABLED=1
50# gui: base
51
52static: LIBS += -L ./lib-win -static -llzma
53static: targets
54
55staticgui: GUI = -DGUI_ENABLED=1
56staticgui: static
57
58targets: directories slippc
59
60slippc: $(OBJS)
61	@echo 'Building target: $@'
62	@echo 'Invoking: GCC C++ Linker'
63	x86_64-w64-mingw32-g++ -static -static-libgcc -static-libstdc++ -L/usr/x86_64-w64-mingw32/lib/ -std=c++17 -o "./slippc.exe" $(OBJS) $(LIBS)
64	@echo 'Finished building target: $@'
65	@echo ' '
66
67build-win/%.o: ./src/%.cpp $(HEADERS)
68	@echo 'Building file: $<'
69	@echo 'Invoking: GCC C++ Compiler'
70	$(LINK.c) $< -c -o $@
71	x86_64-w64-mingw32-g++ $(DEFINES) $(GUI) $(INCLUDES) -static -static-libgcc -static-libstdc++ $(INCLUDES) $(OLEVEL) -g3 -Wall -c -fmessage-length=0 -std=c++17 $(UNUSED) -o "$@" "$<"
72	@echo 'Finished building: $<'
73	@echo ' '
74
75clean:
76	-$(RM) $(OBJS)$(C++_DEPS) ./slippc.exe
77	-@echo ' '
78
79directories: ${OUT_DIR}
80
81${OUT_DIR}:
82	${MKDIR_P} ${OUT_DIR}
83
84.PHONY: all clean dependents directories
85.SECONDARY: