From d5c2821d589ef36f885bb4f92a6d6ca0bc4cc0e7 Mon Sep 17 00:00:00 2001 From: Orfeas <38209077+0xfea5@users.noreply.github.com> Date: Wed, 27 Aug 2025 04:16:05 +0300 Subject: Add ‘skel/‘ as template directory for each day MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aoc.mk | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 aoc.mk (limited to 'aoc.mk') diff --git a/aoc.mk b/aoc.mk new file mode 100644 index 0000000..c7b7c87 --- /dev/null +++ b/aoc.mk @@ -0,0 +1,32 @@ +CXX = g++ +CXX_FLAGS = -std=c++23 +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 <(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 + timeout ${TIMEOUT} ${TARGET} < ${INPUT} + +clean: + rm -f ${TARGET} -- cgit v1.2.3