ptk/test/Makefile

26 lines
469 B
Makefile
Raw Normal View History

2024-08-08 14:38:43 +02:00
INCLUDE += test
CFLAGS += $(addprefix -I, $(INCLUDE))
LDFLAGS = -L$(BIN) -lptk
TEST = test
TESTS = $(shell find $(TEST) -type f -name "*.c")
OBJ = $(addprefix $(BIN)/, $(TESTS:.c=))
.PHONY: all
all: dirs_test $(OBJ)
@echo
@echo "---------- STARTING TESTS ----------"
@echo
@$(foreach test,$(OBJ),./$(test);)
@echo "---------- FINISHED TESTS ----------"
@echo
dirs_test:
mkdir -p $(BIN)/test
$(BIN)/test/%: $(TEST)/%.c
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@