26 lines
451 B
Makefile
26 lines
451 B
Makefile
INCLUDE += test
|
|
CXXFLAGS += $(addprefix -I, $(INCLUDE))
|
|
|
|
TEST = test
|
|
|
|
_TESTS = example.cpp
|
|
TESTS = $(addprefix $(TEST)/, $(_TESTS))
|
|
|
|
OBJ = $(addprefix $(BIN)/, $(_TESTS:.cpp=))
|
|
|
|
.PHONY: all
|
|
|
|
all: dirs_test $(OBJ)
|
|
@echo
|
|
@echo "---------- STARTING TESTS ----------"
|
|
@echo
|
|
$(foreach test,$(OBJ),@./$(test))
|
|
@echo
|
|
@echo "---------- FINISHED TESTS ----------"
|
|
@echo
|
|
|
|
dirs_test:
|
|
mkdir -p $(BIN)
|
|
|
|
$(BIN)/%: $(TEST)/%.cpp
|
|
$(CXX) $< $(CXXFLAGS) -o $@
|