SRC_D = d1_account.cpp d2_shapes.cpp d3_expr.cpp d4_destroy.cpp d5_factory.cpp SRC_E = e1_resistance.cpp e2_perimeter.cpp e3_fight.cpp SRC_P = p1_prisoner.cpp p2_bexpr.cpp p3_sexpr.cpp p4_network.cpp p5_filter.cpp p6_geometry.cpp SRC_R = r1_bom.cpp r2_circuit.cpp r3_loops.cpp r4_pretty.cpp r5_json.cpp r6_while.cpp SRC_T = CXX = /packages/run.64/gcc-10.2/bin/c++ TIDY = /packages/run.64/llvm-10.0.1/bin/clang-tidy VALGRIND = valgrind CXXFLAGS = -std=c++17 -Wall -Wextra -Werror -g -MD -MP BIN_T = ${SRC_T:.cpp=} BIN_D = ${SRC_D:.cpp=} BIN_E = ${SRC_E:.cpp=} BIN_P = ${SRC_P:.cpp=} BIN_R = ${SRC_R:.cpp=} BIN = $(BIN_T) $(BIN_D) $(BIN_E) $(BIN_P) $(BIN_R) SRC = $(SRC_T) $(SRC_D) $(SRC_E) $(SRC_P) $(SRC_R) DEP = ${BIN_D:%=.%.d} ${BIN_E:%=.%.d} ${BIN_T:%=.%.d} ${BIN_E:%=.sol.%.d} _ENV = CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" TIDY="$(TIDY)" VALGRIND="$(VALGRIND)" all: $(BIN) clean: @rm -f $(BIN) $(DEP) @rm -f *.core core *~ a.out .check.*.out valgrind.out a.out .cpp: makefile .helper.sh $(CXX) -o $@ $(CXXFLAGS) -MD -MP -MF ${@:%=.%.d} $< @env $(_ENV) sh .helper.sh tidy $< @env $(_ENV) sh .helper.sh grind ./$@ $(BIN_T): makefile .helper.sh @echo building and testing $@ @env $(_ENV) sh .helper.sh cxx $@.cpp -o $@ @env $(_ENV) sh .helper.sh tidy $@.cpp @env $(_ENV) sh .helper.sh grind ./$@ -include $(DEP) .PHONY: all clean