CXX = g++ CXXFLAGS = -std=c++20 -O3 -Wall -Wextra -Wpedantic LDFLAGS = INCLUDE = include test CXXFLAGS += $(addprefix -I, $(INCLUDE)) TEST = test BIN_TEST = $(BIN)/$(TEST) _TESTS = example.cpp TESTS = $(addprefix $(TEST)/, $(_TESTS)) OBJ_TEST = $(addprefix $(BIN_TEST)/, $(_TESTS:.cpp=)) .PHONY: test dirs_test: mkdir -p $(BIN_TEST) test_start: @echo @echo "---------- STARTING TESTS ----------" @echo test: dirs_test test_start $(OBJ_TEST) $(foreach _test,$(OBJ_TEST),@./$(_test)) @echo @echo "---------- FINISHED TESTS ----------" @echo $(BIN_TEST)/%: $(TEST)/%.cpp @$(CXX) $< $(CXXFLAGS) -o $@