summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
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
commite68bb9339728134d780293bcda34ddbde633342a (patch)
tree26d7f2060a2815cbfd855058afd972a141f7107b /src/Makefile
parent6e7b5ea2bf5e4c94c878efba9bdb0383f31e71de (diff)
Simple stack implementation for making a concurrent stack
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile41
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 @@
1CC = gcc 1all:
2SHELL := /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
9CFLAGS = -std=c2x -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium)
10LDLIBS += $$(pkg-config --libs-only-l libsodium)
11LDFLAGS += $$(pkg-config --libs-only-L libsodium)
12DEPFLAGS = -MT $@ -MMD -MP -MF $*.d
13
14SOURCES := $(wildcard *.c)
15OBJECTS := $(patsubst %.c,%.o,$(SOURCES))
16DEPS := $(patsubst %.c,%.d,$(SOURCES))
17
18COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) -c
19
20.PHONY: all c clean val
21.DELETE_ON_ERROR:
22.ONESHELL:
23
24all: main
25main: $(OBJECTS)
26
27%.o: %.c %.d
28 $(COMPILE.c) $<
29
30$(DEPS):
31include $(wildcard $(DEPS))
32# Adopted from https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
33
34c clean:
35 @-rm -rv main $(OBJECTS) $(DEPS) $(wildcard *.test*) $(wildcard *.enc)
36
37val:
38 $(MAKE) all
39 valgrind --leak-check=yes ./main \ No newline at end of file