summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4c93325..606f1da 100644
--- a/Makefile
+++ b/Makefile
@@ -52,9 +52,10 @@ out/index.atom : $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/
out/%/index.atom: $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/write-atomic
bin/index atom '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@
-www: FORCE
- @mkdir -p $@
- unionfs -o ro out:src www
+serve: serve-8000
+serve-%: all
+ dir=$$(mktemp -d -t) && trap 'fusermount -u "$$dir"; rmdir "$$dir"' EXIT && unionfs -o ro out:src "$$dir" && (cd "$$dir" && python3 -m http.server $*)
+.PHONY: serve serve-%
.var.%: FORCE bin/write-ifchanged
@printf '%s' $(call quote.shell,$($*)) | sed 's/^/#/' | bin/write-ifchanged $@