u.twoha.cc/Makefile
2024-09-13 19:49:18 -05:00

39 lines
779 B
Makefile

.PHONY: server clean all prod
OUT=/tmp/2h
FLAGS=
CTF=$(patsubst %.md,$(OUT)/%.html,$(wildcard ctf/**/*.md))
all: $(OUT) $(OUT)/ctf $(CTF)
$(OUT): pages templates static rootstatic build.py static/songlist.json build.py static/highlight.css
python build.py -o $(OUT) $(FLAGS)
touch $(OUT)
$(OUT)/ctf: build.py
python build.py -o $(OUT) ctf $(FLAGS)
touch $(OUT)/ctf
$(OUT)/ctf/%.html: ctf/%.md
python build.py -o $(OUT) ctf -p $^ $(FLAGS)
static/songlist.json: music build.py
python build.py songlist $(FLAGS)
static/highlight.css: build.py
python build.py highlight $(FLAGS)
server: all
-killall flask
flask run &
python server.py $(OUT)
clean:
-rm -r $(OUT)
prod:
-rm -rf /var/www/u
make OUT=/var/www/u
-rm -rf /var/www/mu
make OUT=/var/www/mu FLAGS=-m