From 928238bdcbc78c4196eb4a3508808c79e31f7c84 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Wed, 14 May 2025 12:19:34 -0500 Subject: Update signatures of free-type functions to match the freecallback signature --- src/Makefile | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index f89fd4d..b045807 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,2 +1,39 @@ -all: - @./main.c +CC = gcc +SHELL := /usr/bin/env +.SHELLFLAGS := -S bash -c + +# I need to get better at makefiles so I can write this in a way that isn't absolutely insane/stupid +# RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto +# RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto + +CFLAGS = -std=c2x -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium) +LDLIBS += $$(pkg-config --libs-only-l libsodium) +LDFLAGS += $$(pkg-config --libs-only-L libsodium) +DEPFLAGS = -MT $@ -MMD -MP -MF $*.d + +SOURCES := $(wildcard *.c) +OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) +DEPS := $(patsubst %.c,%.d,$(SOURCES)) + +COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) -c + +.PHONY: all c clean val +.DELETE_ON_ERROR: +.ONESHELL: + +all: main +main: $(OBJECTS) + +%.o: %.c %.d + $(COMPILE.c) $< + +$(DEPS): +include $(wildcard $(DEPS)) +# Adopted from https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ + +c clean: + @-rm -rv main $(OBJECTS) $(DEPS) $(wildcard *.test*) $(wildcard *.enc) + +val: + $(MAKE) all + valgrind --leak-check=yes ./main \ No newline at end of file -- cgit v1.2.3