summaryrefslogtreecommitdiff
path: root/Makefile
blob: 92c3868a5834573ea704f470b6f107a230f1abc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
MAKEFLAGS += -j1

# Default target
all: out/index.html
phony += all

# Boilerplate
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-%

# Clean
clean:
	rm -rf out
phony += clean

# For real files, just let the ./make script take care of it.
$(sort out/index.html $(filter-out $(phony),$(MAKECMDGOALS))): FORCE
	./make

# Boilerplate
.PHONY: $(phony)