osuplusplus/test/Makefile

27 lines
451 B
Makefile
Raw Normal View History

2024-04-29 19:45:45 +02:00
INCLUDE += test
CXXFLAGS += $(addprefix -I, $(INCLUDE))
2024-04-28 17:43:53 +02:00
TEST = test
_TESTS = example.cpp
TESTS = $(addprefix $(TEST)/, $(_TESTS))
2024-04-29 19:45:45 +02:00
OBJ = $(addprefix $(BIN)/, $(_TESTS:.cpp=))
2024-04-28 17:43:53 +02:00
2024-04-29 19:45:45 +02:00
.PHONY: all
2024-04-28 17:43:53 +02:00
2024-04-29 19:45:45 +02:00
all: dirs_test $(OBJ)
2024-04-28 17:43:53 +02:00
@echo
@echo "---------- STARTING TESTS ----------"
@echo
2024-04-29 19:45:45 +02:00
$(foreach test,$(OBJ),@./$(test))
2024-04-28 17:43:53 +02:00
@echo
@echo "---------- FINISHED TESTS ----------"
@echo
2024-04-29 19:45:45 +02:00
dirs_test:
mkdir -p $(BIN)
$(BIN)/%: $(TEST)/%.cpp
$(CXX) $< $(CXXFLAGS) -o $@