LATEST=200
SRC := $(wildcard *.m4 | grep -v feed.m4)
OUTPUTS := $(patsubst %.m4,out/%.html,$(SRC))
all: $(OUTPUTS) out/atom.xml out/style.css out/assets/ads.js
out/list.html: Makefile $(SRC)
out/index.html: Makefile $(LATEST).m4
out/%.html: %.m4 header.html footer.html ; m4 -D__latest=$(LATEST) $< > $@
out/atom.xml: feed.m4 $(LATEST).m4 Makefile ; m4 -D__latest=$(LATEST) $< > $@
out/style.css: static/*.css ; cat $^ > $@
out/assets/%: static/assets/%; cp $^ $@
clean: ; rm out/*
watch: ; echo $(SRC) | tr " " "\n" | entr make
server: all ; cd out; python3 -m http.server 3001
upload: all; rsync -azPL out/ p:technomancy.us/new/
.PHONY: all clean watch server upload