diff options
| author | @syxhe <https://t.me/syxhe> | 2025-05-07 21:19:23 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-05-07 21:19:23 -0500 |
| commit | e68bb9339728134d780293bcda34ddbde633342a (patch) | |
| tree | 26d7f2060a2815cbfd855058afd972a141f7107b /src/Makefile | |
| parent | 6e7b5ea2bf5e4c94c878efba9bdb0383f31e71de (diff) | |
Simple stack implementation for making a concurrent stack
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/src/Makefile b/src/Makefile index b045807..f89fd4d 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -1,39 +1,2 @@ | |||
| 1 | CC = gcc | 1 | all: |
| 2 | SHELL := /usr/bin/env | 2 | @./main.c |
| 3 | .SHELLFLAGS := -S bash -c | ||
| 4 | |||
| 5 | # I need to get better at makefiles so I can write this in a way that isn't absolutely insane/stupid | ||
| 6 | # RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto | ||
| 7 | # RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto | ||
| 8 | |||
| 9 | CFLAGS = -std=c2x -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium) | ||
| 10 | LDLIBS += $$(pkg-config --libs-only-l libsodium) | ||
| 11 | LDFLAGS += $$(pkg-config --libs-only-L libsodium) | ||
| 12 | DEPFLAGS = -MT $@ -MMD -MP -MF $*.d | ||
| 13 | |||
| 14 | SOURCES := $(wildcard *.c) | ||
| 15 | OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) | ||
| 16 | DEPS := $(patsubst %.c,%.d,$(SOURCES)) | ||
| 17 | |||
| 18 | COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) -c | ||
| 19 | |||
| 20 | .PHONY: all c clean val | ||
| 21 | .DELETE_ON_ERROR: | ||
| 22 | .ONESHELL: | ||
| 23 | |||
| 24 | all: main | ||
| 25 | main: $(OBJECTS) | ||
| 26 | |||
| 27 | %.o: %.c %.d | ||
| 28 | $(COMPILE.c) $< | ||
| 29 | |||
| 30 | $(DEPS): | ||
| 31 | include $(wildcard $(DEPS)) | ||
| 32 | # Adopted from https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ | ||
| 33 | |||
| 34 | c clean: | ||
| 35 | @-rm -rv main $(OBJECTS) $(DEPS) $(wildcard *.test*) $(wildcard *.enc) | ||
| 36 | |||
| 37 | val: | ||
| 38 | $(MAKE) all | ||
| 39 | valgrind --leak-check=yes ./main \ No newline at end of file | ||
