diff options
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 31 |
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 @@ | |||
| 1 | CC = gcc | 1 | CC = gcc |
| 2 | SHELL = /usr/bin/bash | 2 | SHELL = /usr/bin/env -S bash |
| 3 | 3 | ||
| 4 | DEBUG_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 |
| 5 | RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto | 5 | # RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto |
| 6 | CFLAGS = -Wall -Wextra -Wpedantic -pedantic-errors $(DEBUG_CFLAGS) $$(pkg-config --cflags libsodium) | 6 | # RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto |
| 7 | 7 | ||
| 8 | DEBUG_LDLIBS := | 8 | CFLAGS = -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium) |
| 9 | RELEASE_LDLIBS := | 9 | LDLIBS += $$(pkg-config --libs-only-l libsodium) |
| 10 | LDLIBS += $(DEBUG_LDLIBS) $$(pkg-config --libs-only-l libsodium) | 10 | LDFLAGS += $$(pkg-config --libs-only-L libsodium) |
| 11 | 11 | ||
| 12 | DEBUG_LDFLAGS := | ||
| 13 | RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto | ||
| 14 | LDFLAGS += $(DEBUG_LDFLAGS) $$(pkg-config --libs-only-L libsodium) | ||
| 15 | 12 | ||
| 13 | BINARIES := main | ||
| 16 | 14 | ||
| 17 | BINARIES := main encryption | 15 | .PHONY: all c clean val |
| 18 | |||
| 19 | .PHONY: all clean | ||
| 20 | 16 | ||
| 21 | all: main | 17 | all: main |
| 22 | 18 | ||
| @@ -27,8 +23,9 @@ main.o: main.c shared.h | |||
| 27 | arena.o: arena.c arena.h shared.h | 23 | arena.o: arena.c arena.h shared.h |
| 28 | shared.o: shared.c shared.h | 24 | shared.o: shared.c shared.h |
| 29 | 25 | ||
| 30 | encryption: encryption.c encryption.h shared.o shared.h | ||
| 31 | ll: ll.o shared.o | ||
| 32 | |||
| 33 | c clean: | 26 | c 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 | |||
| 29 | val: | ||
| 30 | $(MAKE) all | ||
| 31 | valgrind --leak-check=yes ./main \ No newline at end of file | ||
