aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtmi8/Makefile
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-05-02 20:27:40 +0200
committerLibravatar Rutger Broekhoff2024-05-02 20:27:40 +0200
commit17a3ea880402338420699e03bcb24181e4ff3924 (patch)
treeda666ef91e0b60d20aa0b01529644c136fd1f4ab /lib/libtmi8/Makefile
downloadoeuf-17a3ea880402338420699e03bcb24181e4ff3924.tar.gz
oeuf-17a3ea880402338420699e03bcb24181e4ff3924.zip
Initial commit
Based on dc4ba6a
Diffstat (limited to 'lib/libtmi8/Makefile')
-rw-r--r--lib/libtmi8/Makefile41
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
6CXXFLAGS=-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
12LDFLAGS=-larrow -lparquet -Wl,-z,defs \
13 -Wl,-z,nodlopen -Wl,-z,noexecstack \
14 -Wl,-z,relro -Wl,-z,now
15DESTDIR=/usr/local
16
17LIBHDRS=include/tmi8/kv1_lexer.hpp include/tmi8/kv1_parser.hpp include/tmi8/kv1_types.hpp include/tmi8/kv6_parquet.hpp
18LIBSRCS=src/kv1_index.cpp src/kv1_lexer.cpp src/kv1_parser.cpp src/kv1_types.cpp src/kv6_parquet.cpp
19LIBOBJS=$(patsubst %.cpp,%.o,$(LIBSRCS))
20
21.PHONY: all install libtmi8 clean
22all: libtmi8
23
24libtmi8: libtmi8.a libtmi8.so
25
26clean:
27 rm libtmi8.a libtmi8.so $(LIBOBJS)
28
29install: 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
34src/%.o: src/%.cpp $(LIBHDRS)
35 $(CXX) -c -o $@ $< $(CXXFLAGS)
36
37libtmi8.a: $(LIBOBJS)
38 $(AR) rcs $@ $^
39
40libtmi8.so: $(LIBOBJS)
41 $(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS)