diff options
author | Rutger Broekhoff | 2024-05-02 20:27:40 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2024-05-02 20:27:40 +0200 |
commit | 17a3ea880402338420699e03bcb24181e4ff3924 (patch) | |
tree | da666ef91e0b60d20aa0b01529644c136fd1f4ab /lib/libtmi8/Makefile | |
download | oeuf-17a3ea880402338420699e03bcb24181e4ff3924.tar.gz oeuf-17a3ea880402338420699e03bcb24181e4ff3924.zip |
Initial commit
Based on dc4ba6a
Diffstat (limited to 'lib/libtmi8/Makefile')
-rw-r--r-- | lib/libtmi8/Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/libtmi8/Makefile b/lib/libtmi8/Makefile new file mode 100644 index 0000000..52a9807 --- /dev/null +++ b/lib/libtmi8/Makefile | |||
@@ -0,0 +1,41 @@ | |||
1 | # Taken from: | ||
2 | # Open Source Security Foundation (OpenSSF), “Compiler Options Hardening Guide | ||
3 | # for C and C++,” OpenSSF Best Practices Working Group. Accessed: Dec. 01, | ||
4 | # 2023. [Online]. Available: | ||
5 | # https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html | ||
6 | CXXFLAGS=-std=c++2b -g -fno-omit-frame-pointer -Iinclude $(if $(DEVMODE),-Werror,)\ | ||
7 | -O2 -Wall -Wformat=2 -Wconversion -Wtrampolines -Wimplicit-fallthrough \ | ||
8 | -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \ | ||
9 | -D_GLIBCXX_ASSERTIONS \ | ||
10 | -fstrict-flex-arrays=3 \ | ||
11 | -fstack-clash-protection -fstack-protector-strong | ||
12 | LDFLAGS=-larrow -lparquet -Wl,-z,defs \ | ||
13 | -Wl,-z,nodlopen -Wl,-z,noexecstack \ | ||
14 | -Wl,-z,relro -Wl,-z,now | ||
15 | DESTDIR=/usr/local | ||
16 | |||
17 | LIBHDRS=include/tmi8/kv1_lexer.hpp include/tmi8/kv1_parser.hpp include/tmi8/kv1_types.hpp include/tmi8/kv6_parquet.hpp | ||
18 | LIBSRCS=src/kv1_index.cpp src/kv1_lexer.cpp src/kv1_parser.cpp src/kv1_types.cpp src/kv6_parquet.cpp | ||
19 | LIBOBJS=$(patsubst %.cpp,%.o,$(LIBSRCS)) | ||
20 | |||
21 | .PHONY: all install libtmi8 clean | ||
22 | all: libtmi8 | ||
23 | |||
24 | libtmi8: libtmi8.a libtmi8.so | ||
25 | |||
26 | clean: | ||
27 | rm libtmi8.a libtmi8.so $(LIBOBJS) | ||
28 | |||
29 | install: libtmi8.a $(LIBHDRS) | ||
30 | install -D -m644 include/tmi8/* -t $(DESTDIR)/include/tmi8 | ||
31 | install -D -m644 libtmi8.a -t $(DESTDIR)/lib | ||
32 | install -D -m644 libtmi8.so -t $(DESTDIR)/lib | ||
33 | |||
34 | src/%.o: src/%.cpp $(LIBHDRS) | ||
35 | $(CXX) -c -o $@ $< $(CXXFLAGS) | ||
36 | |||
37 | libtmi8.a: $(LIBOBJS) | ||
38 | $(AR) rcs $@ $^ | ||
39 | |||
40 | libtmi8.so: $(LIBOBJS) | ||
41 | $(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) | ||