27 lines
540 B
Makefile
27 lines
540 B
Makefile
# Copyright (jacekpoz 2024). Licensed under the EUPL-1.2 or later.
|
|
|
|
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 $@
|