26 lines
469 B
Makefile
26 lines
469 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 $@
|