ptk/test/Makefile

28 lines
540 B
Makefile
Raw Normal View History

# Copyright (jacekpoz 2024). Licensed under the EUPL-1.2 or later.
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
2024-08-08 21:41:35 +02:00
$(BIN)/$(TEST)/%: $(TEST)/%.c
2024-08-08 14:38:43 +02:00
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@