CXX = g++-15 CXXFLAGS = -std=c++26 -O2 SOLUTION = solution.cpp INPUT = input.txt TARGET = ./solution TESTS = $(wildcard tests/*.input) TIMEOUT = 5 .PHONY: run tests force all: compile run compile: ${TARGET} ${TARGET}: ${SOLUTION} ${CXX} ${CXXFLAGS} $? -o $@ force: tests: ${TESTS} tests/test%.input: tests/test%.output compile force @diff -BZ --color=always \ <(timeout ${TIMEOUT} ${TARGET} < $@) \ <(cat $<) \ > /tmp/aoc.output \ && echo -e "$@ [\e[0;32mok\e[m]" \ || echo -e "$@ [\e[0;31mfail\e[m]" @cat /tmp/aoc.output run: compile time timeout ${TIMEOUT} ${TARGET} < ${INPUT} clean: rm -f ${TARGET}