blob: 2c074008f1dd8473d721fcca2607aac56fb75e7d (
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
29
30
31
32
33
|
MAKEFLAGS += -j1
# Default target
all: out/index.html out/main.css
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
# Real file rules
out/%.css: src/%.scss
@mkdir -p $(@D)
scss --stdin < $< > $@
targets = $(phony) %.css
$(sort $(filter-out $(targets),out/index.html $(MAKECMDGOALS))): FORCE
./make
# Boilerplate
.PHONY: $(phony)
|