X-Git-Url: https://git.ladys.computer/Shrine-XSLT/blobdiff_plain/d84110047a12df4dec06d33d63bb157a788a8831..820a47bd00e3b7d5a28b5392e1f2a56584c4a38e:/GNUmakefile?ds=sidebyside diff --git a/GNUmakefile b/GNUmakefile index 7f20dea..fd272ee 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -26,10 +26,12 @@ SOURCE_EXT = .xml TRANSFORM = transform.xslt XSLT = xsltproc XSLTOPTS = +YIELD = cat +YIELD_DEPENDENCIES = headers := $(wildcard *-header.xml) footers := $(wildcard *-footer.xml) -override prerequisites := $(TRANSFORM) $(headers) $(footers) +override prerequisites := $(YIELD_DEPENDENCIES) template.xml $(TRANSFORM) $(headers) $(footers) override indexsources := $(wildcard sources/index$(SOURCE_EXT) sources/index-*$(SOURCE_EXT)) override indices := $(patsubst sources/%$(SOURCE_EXT),public/%.html,$(indexsources)) @@ -54,7 +56,8 @@ override content := $(indices) $(pages) # • Removes any doctype for root elements other than `html` (with `grep -v`). # # • Saves the output to `$(2)`. -override makexslt = $(XSLT) --nonet --novalid $(XSLTOPTS) --stringparam BASEIRI "$(BASEIRI)" --stringparam DATETIME "$(DATETIME)" --stringparam OUTPUTPATH "$(patsubst public/%,/%,$(2))" transform.xslt $(1)\ +override makexslt = $(YIELD) $(1)\ + | $(XSLT) --nonet --novalid $(XSLTOPTS) --stringparam BASEIRI "$(BASEIRI)" --stringparam DATETIME "$(DATETIME)" --stringparam OUTPUTPATH "$(patsubst public/%,/%,$(2))" transform.xslt -\ $(if $(filter %.html,$(2)),| sed 's/ xmlns:[0-9A-Za-z_-]*="[^"]*"//g',)\ | grep -v '^]\)'\ > $(2)