summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/Makefile b/src/Makefile
index c5a08c7..4bddadf 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,22 +1,18 @@
1CC = gcc 1CC = gcc
2SHELL = /usr/bin/bash 2SHELL = /usr/bin/env -S bash
3 3
4DEBUG_CFLAGS := -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 4# I need to get better at makefiles so I can write this in a way that isn't absolutely insane/stupid
5RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto 5# RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto
6CFLAGS = -Wall -Wextra -Wpedantic -pedantic-errors $(DEBUG_CFLAGS) $$(pkg-config --cflags libsodium) 6# RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto
7 7
8DEBUG_LDLIBS := 8CFLAGS = -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium)
9RELEASE_LDLIBS := 9LDLIBS += $$(pkg-config --libs-only-l libsodium)
10LDLIBS += $(DEBUG_LDLIBS) $$(pkg-config --libs-only-l libsodium) 10LDFLAGS += $$(pkg-config --libs-only-L libsodium)
11 11
12DEBUG_LDFLAGS :=
13RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto
14LDFLAGS += $(DEBUG_LDFLAGS) $$(pkg-config --libs-only-L libsodium)
15 12
13BINARIES := main
16 14
17BINARIES := main encryption 15.PHONY: all c clean val
18
19.PHONY: all clean
20 16
21all: main 17all: main
22 18
@@ -27,8 +23,9 @@ main.o: main.c shared.h
27arena.o: arena.c arena.h shared.h 23arena.o: arena.c arena.h shared.h
28shared.o: shared.c shared.h 24shared.o: shared.c shared.h
29 25
30encryption: encryption.c encryption.h shared.o shared.h
31ll: ll.o shared.o
32
33c clean: 26c clean:
34 rm -rvf $(BINARIES) $(wildcard *.o) $(wildcard *.test*) $(wildcard *.enc) \ No newline at end of file 27 rm -rvf $(BINARIES) $(wildcard *.o) $(wildcard *.test*) $(wildcard *.enc)
28
29val:
30 $(MAKE) all
31 valgrind --leak-check=yes ./main \ No newline at end of file