CXX = g++-15 CXX_FLAGS = -std=c++26 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} ${CXX_FLAGS} $? -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}