summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 16:48:33 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 16:48:33 -0500
commit4b13bad24984951c7e8536a549ab491002a91222 (patch)
tree139e5923d7de48229c9da0c01ba5756b13728879 /Makefile
parent5d4fc096459614c1b4f18f36a932f2cb51220aaf (diff)
Add `serve` make target
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 $@