suffix = xhtml version = $(shell git rev-parse --short HEAD) xsltproc=xsltproc --stringparam stylesheet style.min.css --stringparam version $(version) svg2png=rsvg-convert -f png fix_doctype=sed 's/ SYSTEM "about:legacy-compat"//' pages=$(shell xsltproc xsl/main_filenames.xsl main.xml) pages_gen=$(pages:%.xml=%.$(suffix)) pages_gen_html=$(pages:%.xml=%.html) common_depend=main.xml $(wildcard xsl/*.xsl) Makefile checkmark.svg style/style.css DEFAULT_VERBOSITY=0 # verbosity stuff V_XSLT = $(v_xslt_$(V)) v_xslt_ = $(v_xslt_$(DEFAULT_VERBOSITY)) v_xslt_0 = @echo " XSLT " $@; V_GEN = $(v_gen_$(V)) v_gen_ = $(v_gen_$(DEFAULT_VERBOSITY)) v_gen_0 = @echo " GEN " $@; V_CSS = $(v_css_$(V)) v_css_ = $(v_css_$(DEFAULT_VERBOSITY)) v_css_0 = @echo " CSS " $@; .PHONY: all html all: $(pages_gen) checkmark.png style/style.min.css html: $(pages_gen_html) %.png: %.svg $(V_GEN) $(svg2png) $< > $@ %.$(suffix): %.xml %.xsl $(common_depend) $(V_XSLT) $(xsltproc) --stringparam suffix .$(suffix) $< | $(fix_doctype) > $@ %.$(suffix): %.xml $(common_depend) $(V_XSLT) $(xsltproc) --stringparam suffix .$(suffix) $< | $(fix_doctype) > $@ %.html: %.xml %.xsl $(common_depend) $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(fix_doctype) | xsltproc xsl/convert-xhtml-to-html.xsl - | $(fix_doctype) > $@ %.html: %.xml $(common_depend) $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(fix_doctype) | xsltproc xsl/convert-xhtml-to-html.xsl - | $(fix_doctype) > $@ style/style.min.css: style/style.css node_modules/.bin/postcss $(V_CSS) node_modules/.bin/postcss -u postcss-css-variables style/style.css | node_modules/.bin/cleancss > style/style.min.css clean: rm -f $(pages_gen) checkmark.png