Files
cig/makefile
T
roodletoof ddf9bea20b remove tags as a dependency for test
it does notMake that much sense to have it like that in the first place.
It was for convenience, but it then requires the ci/cd pipeline to have
ctags installed and maybe other config. so screw it
2025-10-05 00:21:28 +02:00

29 lines
739 B
Makefile

CC := gcc
CFLAGS := -Wall -Wextra -Wno-override-init -O2 -fsanitize=address
LDFLAGS := -lcriterion
TESTBIN := /tmp/all_tests
.PHONY: test
test:
@echo "Discovering test files..."
@files=$$(find . -type f -name 'test*.c'); \
if [ -z "$$files" ]; then \
echo "No test files found!"; \
else \
echo "Compiling all test files into $(TESTBIN)..."; \
$(CC) $(CFLAGS) _allocator_impl.c $$files -o $(TESTBIN) $(LDFLAGS); \
echo "Running tests..."; \
$(TESTBIN); \
fi
PROJECT_ROOT := $(shell pwd)
PROJECT_C_FILES := $(shell find $(PROJECT_ROOT) \( -name '*.c' -o -name '*.h' \))
CRITERION_HEADERS := $(shell find /usr/include/criterion)
ALL_FILES := $(PROJECT_C_FILES) $(CRITERION_HEADERS)
tags: $(ALL_FILES)
ctags $(ALL_FILES)