25 lines
472 B
Makefile
25 lines
472 B
Makefile
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 $@
|