Makefile: incremental builds 🎉

This commit is contained in:
Kay Faraday 2024-08-13 23:34:10 -07:00
parent 4cd7b8b118
commit 8890abfbf6
1 changed files with 17 additions and 11 deletions

View File

@ -1,17 +1,23 @@
PAGES = index.html rules.html donate.html
PAGES_SRC = index.html rules.html donate.html
PAGES_BUILD = $(addprefix build/tor/,$(PAGES_SRC)) $(addprefix build/clearnet/,$(PAGES_SRC))
all: $(PAGES) symlinks
all: $(PAGES_BUILD) symlinks
.PHONY: symlinks clean
.PHONY: clean
symlinks:
ln -sf ../../static build/tor/
ln -sf ../../static build/clearnet/
symlinks: build/tor/static build/clearnet/static
build/tor/static:
ln -s ../../static build/tor/
build/clearnet/static:
ln -s ../../static build/clearnet/
clean:
rm -f $(addprefix build/tor/,$(PAGES))
rm -f $(addprefix build/clearnet/,$(PAGES))
rm -rf $(PAGES_BUILD)
%.html: %.j2.html base.j2.html
j2 -D site tor $< > build/tor/$@
j2 -D site clearnet $< > build/clearnet/$@
build/tor/%.html: %.j2.html base.j2.html
j2 -D site tor $< > $@
build/clearnet/%.html: %.j2.html base.j2.html
j2 -D site clearnet $< > $@