From 34a39cd6f147b47c03e8a0296ae54593bd023bc0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 23 Apr 2017 11:15:01 -0400 Subject: Makefile: add 'serve' target, add comments --- Makefile | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3f52318..a22048d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,21 @@ +# Set the default target ####################################################### +phony += all +all: + +# Boilerplate ################################################################## SHELL = bash +phony += FORCE +.DELETE_ON_ERROR: +.SECONDARY: + +# Development server ########################################################### +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-% + +# Real rules to actually make the website ###################################### + RUBYLIB=$(realpath .)/lib export RUBYLIB @@ -43,15 +60,17 @@ var-%: out/%.css: src/%.scss scss -s < $< > $@ -.DELETE_ON_ERROR: -.SECONDARY: - +# Recurse into the logos folder ################################################ outdir=out/logos srcdir=src/logos topoutdir=out topsrcdir=src include src/logos/Makefile +# Boilerplate ################################################################## + +.PHONY: $(phony) + define nl -- cgit v1.2.3