aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..d7732b3
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,21 @@
+CFLAGS = -g -I .
+
+# fortify source code
+CFLAGS += -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2
+LDFLAGS = -Wl,-z,now -Wl,-z,relro
+
+.PHONY: all clean
+
+all: build/stldoctor
+
+clean:
+ rm -rf build
+
+build:
+ mkdir build
+
+build/%.o: %.c %.h | build
+ $(CC) -c -o $@ $< $(CFLAGS) $(LDLIBS)
+
+build/stldoctor: build/$(PREFIX)stlfile.o build/$(PREFIX)util.o $(PREFIX)main.c | build
+ $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)