add Day07
[julm/AoC-2020.git] / Makefile
index 80bf604cb33eb935bb3426e3d7da8a0e3e98e882..db82e9c0b4f81532aa51b49fe674c31e741bc3e1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,15 @@
+days := 04 05 06 07
+
 all: relock run
 relock:
        nix flake update --recreate-lock-file
 shell:
        nix -L develop
 repl/%:
-       nix -L develop -c cabal repl exe:$*
-build:
-       nix -L build
-run: run/Day04
+       nix -L develop -c sh -c 'cd $* && cabal repl exe:Day'
+build: $(foreach day,$(days), build/Day$(day))
+build/%:
+       nix -L build .#$*
+run: $(foreach day,$(days), run/Day$(day))
 run/%:
-       nix -L run .#$*
+       nix -L run --no-write-lock-file .#$*