summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-04-10 18:58:30 -0500
committer@syxhe <https://t.me/syxhe>2025-04-10 18:58:30 -0500
commitd9d142a7ad0bade65b6f8b777259e203dc6d5301 (patch)
tree51e174696bb4397e97b10748a21d67ca5e4f971e /src/Makefile
parente5454e63a086e549f54c23a686ff300b99a83b58 (diff)
Overhaul makefile
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile19
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 @@
1CC = gcc 1CC = gcc
2SHELL = /usr/bin/env -S bash 2SHELL := 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
9LDLIBS += $$(pkg-config --libs-only-l libsodium) 9LDLIBS += $$(pkg-config --libs-only-l libsodium)
10LDFLAGS += $$(pkg-config --libs-only-L libsodium) 10LDFLAGS += $$(pkg-config --libs-only-L libsodium)
11 11
12OBJECTS := $(patsubst %.c,%.o, $(wildcard *.c)) 12SOURCES := $(wildcard *.c)
13OBJECTS := $(patsubst %.c,%.o,$(SOURCES))
14DEPS := $(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
17all: main 20all: main
18main: main.o encryption.o shared.o ll.o arena.o 21main: main.o encryption.o shared.o ll.o arena.o
19 22
20 23$(OBJECTS): %.o: %.dep
21$(OBJECTS): shared.h 24%.dep: %.c
22ll.o: ll.c ll.h 25 ./depend.sh `dirname $*` $(CFLAGS) $*.c > $@
23main.o: main.c
24arena.o: arena.c arena.h
25shared.o: shared.c shared.h # Might as well put shared.h in here explicitly
26encryption.o: encryption.c encryption.h
27 26
28c clean: 27c clean:
29 -rm -rv main $(OBJECTS) $(wildcard *.test*) $(wildcard *.enc) 28 @-rm -rv main $(OBJECTS) $(DEPS) $(wildcard *.test*) $(wildcard *.enc)
30 29
31val: 30val:
32 $(MAKE) all 31 $(MAKE) all