Files
cig/makefile
T
2025-10-03 20:21:27 +02:00

25 lines
483 B
Makefile

# Makefile
# Compiler and flags
CC := gcc
CFLAGS := -Wall -Wextra -O2
LDFLAGS := -lcriterion
# Output binary
TESTBIN := /tmp/all_tests
# Phony target
.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) $$files -o $(TESTBIN) $(LDFLAGS); \
echo "Running tests..."; \
$(TESTBIN); \
fi