diff options
| 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 |
| commit | c4b9503b3e3331c09712810910d2b36f52d98ada (patch) | |
| tree | af96c657c0e30b8b7f2e2456c9237a1059d8202e /src/Makefile | |
| parent | 9edd12e87874eabdc74e45359a5228558e124c98 (diff) | |
Change to the Simplified BSD License
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 18 |
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 | |||
| 2 | SHELL := /usr/bin/env | 2 | SHELL := /usr/bin/env |
| 3 | .SHELLFLAGS := -S bash -c | 3 | .SHELLFLAGS := -S bash -c |
| 4 | 4 | ||
| 5 | CFLAGS := -std=c2x $$(pkg-config --cflags libsodium) | 5 | CFLAGS := -std=c2x $$(pkg-config --cflags libsodium) $$(sdl2-config --cflags) |
| 6 | DEBUG_CFLAGS := -Wall -Wextra -Wpedantic -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 | 6 | DEBUG_CFLAGS := -Wall -Wextra -Wpedantic -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 |
| 7 | RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto | 7 | RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto |
| 8 | 8 | ||
| @@ -10,7 +10,7 @@ DEFS := -D_GNU_SOURCE=1 | |||
| 10 | DEBUG_DEFS := -DDEBUG=1 | 10 | DEBUG_DEFS := -DDEBUG=1 |
| 11 | RELEASE_DEFS := -DRELEASE=1 | 11 | RELEASE_DEFS := -DRELEASE=1 |
| 12 | 12 | ||
| 13 | LDLIBS := $$(pkg-config --libs-only-l libsodium) | 13 | LDLIBS := $$(pkg-config --libs-only-l libsodium) $$(sdl2-config --libs) |
| 14 | 14 | ||
| 15 | LDFLAGS := $$(pkg-config --libs-only-L libsodium) | 15 | LDFLAGS := $$(pkg-config --libs-only-L libsodium) |
| 16 | RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto | 16 | RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto |
| @@ -19,17 +19,18 @@ SOURCES := $(wildcard *.c) | |||
| 19 | TIMESTAMP_DIR := .timestamps | 19 | TIMESTAMP_DIR := .timestamps |
| 20 | TIMESTAMPS := $(patsubst %.c,$(TIMESTAMP_DIR)/%.t,$(SOURCES)) | 20 | TIMESTAMPS := $(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 | ||
| 26 | tests debug: CFLAGS += $(DEBUG_CFLAGS) | 27 | tests debug: CFLAGS += $(DEBUG_CFLAGS) |
| 27 | tests debug: DEFS += $(DEBUG_DEFS) | 28 | tests debug: DEFS += $(DEBUG_DEFS) |
| 28 | debug: main | ||
| 29 | |||
| 30 | release: CFLAGS += $(RELEASE_CFLAGS) | 29 | release: CFLAGS += $(RELEASE_CFLAGS) |
| 31 | release: LDFLAGS += $(RELEASE_LDFLAGS) | 30 | release: LDFLAGS += $(RELEASE_LDFLAGS) |
| 32 | release: DEFS += $(RELEASE_DEFS) | 31 | release: DEFS += $(RELEASE_DEFS) |
| 32 | |||
| 33 | debug: main | ||
| 33 | release: main | 34 | release: main |
| 34 | 35 | ||
| 35 | clay.h: | 36 | clay.h: |
| @@ -47,9 +48,7 @@ main: clay.h | |||
| 47 | main tests: %: %.c $(TIMESTAMPS) | 48 | main 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 | |||
| 53 | c clean: | 52 | c 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 | ||
| 59 | t test: tests | 58 | t test: tests |
| 60 | valgrind --leak-check=yes ./tests \ No newline at end of file | 59 | valgrind --leak-check=yes ./tests |
| 60 | |||
| 61 | deps: | ||
| 62 | sudo apt install libsodium-dev libsdl2-dev libsdl2-ttf-dev \ No newline at end of file | ||
