CXX ?= /packages/run.64/gcc-10.2/bin/c++ VALGRIND ?= valgrind TIDY ?= /packages/run.64/llvm-9.0.1/bin/clang-tidy CXXFLAGS = -std=c++17 -Wall -Wextra -Werror -g -include .vars.mk -include .auto.mk -include ../local.mk SRC_T = ${TASKS:=.cpp} BIN_D = ${SRC_D:%.cpp=%} BIN_E = ${SRC_E:%.cpp=%} BIN_T = ${TASKS} RENDER = $(SRC_D) $(SRC_E) ${TASKS:%=%.hpp} SOL = ${BIN_E:%=sol.%} ${BIN_T:%=sol.%} DEP = ${BIN_D:%=.%.d} ${BIN_E:%=.%.d} ${BIN_T:%=.%.d} ${BIN_E:%=.sol.%.d} BIN = $(BIN_D) $(BIN_E) $(BIN_T) SRC = $(SRC_D) $(SRC_E) $(SRC_T) _ENV = CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" TIDY="$(TIDY)" VALGRIND="$(VALGRIND)" all: $(BIN) check: @env $(_ENV) sh .check.sh $(SRC_E) @env $(_ENV) sh .check.sh ${TASKS:%=%.cpp} check-sol: @env $(_ENV) sh .check.sh $(SRC_D) ${BIN_E:%=sol.%.cpp} @for t in $(TASKS); do $(MAKE) -f .task.mk $(_ENV) TASK=$$t check || exit 1; done clean: @rm -f $(BIN) $(SOL) $(DEP) ${SRC_TT:%.cpp=%} ${SRC_TT:%.cpp=.%.d} @rm -f *.core core *~ a.out .check.out valgrind.out a.out @if test -f .auto.mk; then rm -f .clang-tidy .vars.mk .check.sh .task.mk; fi show: @echo ${$(var):%=$(prefix)%$(suffix)} .cpp: $(CXX) -o $@ $(CXXFLAGS) -MD -MP -MF ${@:%=.%.d} $< $(TASKS): @env $(_ENV) CXXFLAGS="$(CXXFLAGS) -MT $@ -MD -MP -MF ${@:%=.%.d}" sh .check.sh ${@:%=%.cpp} @if test -f a.out; then mv a.out $@; fi -include $(DEP) .PHONY: all check check-sol clean show MAKEFLAGS = --no-print-directory