From 8890abfbf61d65a829adee95d04966e3155d4145 Mon Sep 17 00:00:00 2001 From: Kay Faraday Date: Tue, 13 Aug 2024 23:34:10 -0700 Subject: [PATCH] =?UTF-8?q?Makefile:=20incremental=20builds=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f785812..1cc0e55 100644 --- a/Makefile +++ b/Makefile @@ -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 $< > $@