summaryrefslogtreecommitdiffstats
path: root/aoc.mk
diff options
context:
space:
mode:
authorOrfeas <38209077+0xfea5@users.noreply.github.com>2025-08-27 04:16:05 +0300
committerOrfeas <38209077+0xfea5@users.noreply.github.com>2025-09-01 04:51:37 +0300
commitd5c2821d589ef36f885bb4f92a6d6ca0bc4cc0e7 (patch)
tree268b9c82a4f26dc009eb852fb5419cc44ab81f01 /aoc.mk
parent.gitignore: ignore binaries, lsp cache and compile_commands.json (diff)
downloadaoc24-d5c2821d589ef36f885bb4f92a6d6ca0bc4cc0e7.tar.gz
aoc24-d5c2821d589ef36f885bb4f92a6d6ca0bc4cc0e7.zip
Add ‘skel/‘ as template directory for each day
Diffstat (limited to 'aoc.mk')
-rw-r--r--aoc.mk32
1 files changed, 32 insertions, 0 deletions
diff --git a/aoc.mk b/aoc.mk
new file mode 100644
index 0000000..c7b7c87
--- /dev/null
+++ b/aoc.mk
@@ -0,0 +1,32 @@
1CXX = g++
2CXX_FLAGS = -std=c++23
3SOLUTION = solution.cpp
4INPUT = input.txt
5TARGET = ./solution
6TESTS = $(wildcard tests/*.input)
7TIMEOUT = 5
8
9.PHONY: run tests force
10
11all: compile run
12
13compile: ${TARGET}
14
15${TARGET}: ${SOLUTION}
16 ${CXX} ${CXX_FLAGS} $? -o $@
17
18force:
19
20tests: ${TESTS}
21
22tests/test%.input: tests/test%.output compile force
23 @diff <(timeout ${TIMEOUT} ${TARGET} < $@) <(cat $<) > /tmp/aoc.output \
24 && echo -e "$@ [\e[0;32mok\e[m]" \
25 || echo -e "$@ [\e[0;31mfail\e[m]"
26 @cat /tmp/aoc.output
27
28run: compile
29 timeout ${TIMEOUT} ${TARGET} < ${INPUT}
30
31clean:
32 rm -f ${TARGET}