summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2026-01-14 16:17:47 -0600
committer@syxhe <https://t.me/syxhe>2026-01-14 16:17:47 -0600
commitc4b9503b3e3331c09712810910d2b36f52d98ada (patch)
treeaf96c657c0e30b8b7f2e2456c9237a1059d8202e /src/Makefile
parent9edd12e87874eabdc74e45359a5228558e124c98 (diff)
Change to the Simplified BSD License
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile
index 5463c86..f1e4c61 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@ CC = gcc
2SHELL := /usr/bin/env 2SHELL := /usr/bin/env
3.SHELLFLAGS := -S bash -c 3.SHELLFLAGS := -S bash -c
4 4
5CFLAGS := -std=c2x $$(pkg-config --cflags libsodium) 5CFLAGS := -std=c2x $$(pkg-config --cflags libsodium) $$(sdl2-config --cflags)
6DEBUG_CFLAGS := -Wall -Wextra -Wpedantic -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 6DEBUG_CFLAGS := -Wall -Wextra -Wpedantic -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0
7RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto 7RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto
8 8
@@ -10,7 +10,7 @@ DEFS := -D_GNU_SOURCE=1
10DEBUG_DEFS := -DDEBUG=1 10DEBUG_DEFS := -DDEBUG=1
11RELEASE_DEFS := -DRELEASE=1 11RELEASE_DEFS := -DRELEASE=1
12 12
13LDLIBS := $$(pkg-config --libs-only-l libsodium) 13LDLIBS := $$(pkg-config --libs-only-l libsodium) $$(sdl2-config --libs)
14 14
15LDFLAGS := $$(pkg-config --libs-only-L libsodium) 15LDFLAGS := $$(pkg-config --libs-only-L libsodium)
16RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto 16RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto
@@ -19,17 +19,18 @@ SOURCES := $(wildcard *.c)
19TIMESTAMP_DIR := .timestamps 19TIMESTAMP_DIR := .timestamps
20TIMESTAMPS := $(patsubst %.c,$(TIMESTAMP_DIR)/%.t,$(SOURCES)) 20TIMESTAMPS := $(patsubst %.c,$(TIMESTAMP_DIR)/%.t,$(SOURCES))
21 21
22.PHONY: debug release c clean v val t test test 22.PHONY: deps debug release c clean v val t test
23.DELETE_ON_ERROR: 23.DELETE_ON_ERROR:
24.ONESHELL: 24.ONESHELL:
25 25
26# Rule specific var redefs
26tests debug: CFLAGS += $(DEBUG_CFLAGS) 27tests debug: CFLAGS += $(DEBUG_CFLAGS)
27tests debug: DEFS += $(DEBUG_DEFS) 28tests debug: DEFS += $(DEBUG_DEFS)
28debug: main
29
30release: CFLAGS += $(RELEASE_CFLAGS) 29release: CFLAGS += $(RELEASE_CFLAGS)
31release: LDFLAGS += $(RELEASE_LDFLAGS) 30release: LDFLAGS += $(RELEASE_LDFLAGS)
32release: DEFS += $(RELEASE_DEFS) 31release: DEFS += $(RELEASE_DEFS)
32
33debug: main
33release: main 34release: main
34 35
35clay.h: 36clay.h:
@@ -47,9 +48,7 @@ main: clay.h
47main tests: %: %.c $(TIMESTAMPS) 48main tests: %: %.c $(TIMESTAMPS)
48 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ 49 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
49 50
50
51# Phony rules 51# Phony rules
52
53c clean: 52c clean:
54 -rm -rvf main tests $(TIMESTAMP_DIR) $(wildcard *.test*) $(wildcard *.enc) 53 -rm -rvf main tests $(TIMESTAMP_DIR) $(wildcard *.test*) $(wildcard *.enc)
55 54
@@ -57,4 +56,7 @@ v val: main
57 valgrind --leak-check=yes ./main 56 valgrind --leak-check=yes ./main
58 57
59t test: tests 58t test: tests
60 valgrind --leak-check=yes ./tests \ No newline at end of file 59 valgrind --leak-check=yes ./tests
60
61deps:
62 sudo apt install libsodium-dev libsdl2-dev libsdl2-ttf-dev \ No newline at end of file