diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-03 16:48:33 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-03 16:48:33 -0500 |
commit | 4b13bad24984951c7e8536a549ab491002a91222 (patch) | |
tree | 139e5923d7de48229c9da0c01ba5756b13728879 /Makefile | |
parent | 5d4fc096459614c1b4f18f36a932f2cb51220aaf (diff) |
Add `serve` make target
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 $@ |