diff options
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile index 53cd9fd..88c5344 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | CC = gcc | 1 | CC = gcc |
| 2 | SHELL = /usr/bin/env -S bash | 2 | SHELL := bash |
| 3 | 3 | ||
| 4 | # I need to get better at makefiles so I can write this in a way that isn't absolutely insane/stupid | 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 |
| @@ -9,24 +9,23 @@ CFLAGS = -std=c2x -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyze | |||
| 9 | LDLIBS += $$(pkg-config --libs-only-l libsodium) | 9 | LDLIBS += $$(pkg-config --libs-only-l libsodium) |
| 10 | LDFLAGS += $$(pkg-config --libs-only-L libsodium) | 10 | LDFLAGS += $$(pkg-config --libs-only-L libsodium) |
| 11 | 11 | ||
| 12 | OBJECTS := $(patsubst %.c,%.o, $(wildcard *.c)) | 12 | SOURCES := $(wildcard *.c) |
| 13 | OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) | ||
| 14 | DEPS := $(patsubst %.c,%.dep,$(SOURCES)) | ||
| 13 | 15 | ||
| 14 | .PHONY: all c clean val | 16 | .PHONY: all c clean val |
| 15 | .DELETE_ON_ERROR: | 17 | .DELETE_ON_ERROR: |
| 18 | .ONESHELL: | ||
| 16 | 19 | ||
| 17 | all: main | 20 | all: main |
| 18 | main: main.o encryption.o shared.o ll.o arena.o | 21 | main: main.o encryption.o shared.o ll.o arena.o |
| 19 | 22 | ||
| 20 | 23 | $(OBJECTS): %.o: %.dep | |
| 21 | $(OBJECTS): shared.h | 24 | %.dep: %.c |
| 22 | ll.o: ll.c ll.h | 25 | ./depend.sh `dirname $*` $(CFLAGS) $*.c > $@ |
| 23 | main.o: main.c | ||
| 24 | arena.o: arena.c arena.h | ||
| 25 | shared.o: shared.c shared.h # Might as well put shared.h in here explicitly | ||
| 26 | encryption.o: encryption.c encryption.h | ||
| 27 | 26 | ||
| 28 | c clean: | 27 | c clean: |
| 29 | -rm -rv main $(OBJECTS) $(wildcard *.test*) $(wildcard *.enc) | 28 | @-rm -rv main $(OBJECTS) $(DEPS) $(wildcard *.test*) $(wildcard *.enc) |
| 30 | 29 | ||
| 31 | val: | 30 | val: |
| 32 | $(MAKE) all | 31 | $(MAKE) all |
