aboutsummaryrefslogtreecommitdiffstats
path: root/web/recordings/Makefile
blob: 8e12c15f0aa314cd08fb45cfb40b68ef16eb6422 (plain) (blame)
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
# web/recordings -- render every demo into build/, ready for the site.
#
#   make            every sloshcast (each demos/NAME.py -> build/NAME.json)
#   make serve      look at test.html / seek.html?t=N locally
#   make clean
#
# Rendering needs the slosh binary (the demos drive `slosh --script` through
# tests/harness.py) and nothing else. Casts re-render in about a second, so a
# UI change never leaves a stale demo: re-run make, done.

DEMOS := $(wildcard demos/*.py)
CASTS := $(DEMOS:demos/%.py=build/%.json)
SLOSH := ../../build/slosh

all: $(CASTS)

build/%.json: demos/%.py castgen.py $(SLOSH)
	python3 $< $@

$(SLOSH):
	$(MAKE) -C ../..

PORT ?= 8000
serve:
	@echo "http://localhost:$(PORT)/test.html"
	@python3 -m http.server $(PORT) --bind 127.0.0.1

clean:
	rm -rf build

.PHONY: all serve clean