aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-04-08 12:40:30 -0400
committerLouis Burda <quent.burda@gmail.com>2023-04-09 10:21:36 -0400
commit9282e95e8844afe856ba76ceb6d2c3010df8bb1a (patch)
treee35affc89b20324371381e079f7cb5f8a06aa81b /src/Makefile
parent2b5d4232879dc74491dabf54a0ddc958d66ebcec (diff)
downloadaoc2020-zig-master.tar.gz
aoc2020-zig-master.zip
Restructure repo and update solutions to zig 0.10.1HEADmaster
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..fa2190c
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,21 @@
+DAYS = $(shell seq 1 25 | xargs printf "%02i\n")
+
+.PHONY: all
+all::
+
+define make-day
+all:: $1/run
+.PHONY: $1/run
+$1/main: $1/main.zig
+ zig build-exe \
+ --pkg-begin "aoc" "common/aoc.zig" --pkg-end \
+ --pkg-begin "console8" "common/console8.zig" --pkg-end \
+ --cache-dir .cache/zig -femit-bin=$1/main -freference-trace \
+ $1/main.zig
+$1/run: $1/main
+ @echo "== day $1 =="
+ @echo -en "\npart 1: " && cd $1 && time ./main 1
+ @echo -en "\npart 2: " && cd $1 && time ./main 2
+ @echo ""
+endef
+$(foreach day,$(DAYS),$(eval $(call make-day,$(day))))