summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 8bfe4c6..ff356b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,13 @@
-suffix = xhtml
+suffix = .xhtml
+link_suffix = $(suffix)
version = $(shell git rev-parse --short HEAD)
-xsltproc=xsltproc --stringparam stylesheet "$(shell cat style/style.min.css)" --stringparam version $(version)
+versioned_jpg = 's/.*/.jpg?&/'
+versioned_png = 's/.*/.png?&/'
+
+version_args = --stringparam versioned_jpg $(shell echo $(version) | sed $(versioned_jpg)) --stringparam versioned_png $(shell echo $(version) | sed $(versioned_png))
+
+xsltproc=xsltproc --stringparam stylesheet "$(shell cat style/style.min.css)" --stringparam version $(version) $(version_args)
svg2png=rsvg-convert -f png
fix_doctype=sed 's/ SYSTEM "about:legacy-compat"//'
@@ -9,7 +15,7 @@ to_html=$(fix_doctype) | xsltproc xsl/convert-xhtml-to-html.xsl - | $(fix_doctyp
pages=$(shell xsltproc xsl/main_filenames.xsl main.xml)
-pages_gen=$(pages:%.xml=%.$(suffix))
+pages_gen=$(pages:%.xml=%$(suffix))
pages_gen_html=$(pages:%.xml=%.html)
common_depend=main.xml $(wildcard xsl/*.xsl) Makefile checkmark.svg style/style.min.css
@@ -38,11 +44,11 @@ html: $(pages_gen_html)
%.png: %.svg
$(V_GEN) $(svg2png) $< > $@
-%.$(suffix): %.xml %.xsl $(common_depend)
- $(V_XSLT) $(xsltproc) --stringparam suffix .$(suffix) $< | $(fix_doctype) > $@
+%$(suffix): %.xml %.xsl $(common_depend)
+ $(V_XSLT) $(xsltproc) --stringparam suffix $(link_suffix) $< | $(fix_doctype) > $@
-%.$(suffix): %.xml $(common_depend)
- $(V_XSLT) $(xsltproc) --stringparam suffix .$(suffix) $< | $(fix_doctype) > $@
+%$(suffix): %.xml $(common_depend)
+ $(V_XSLT) $(xsltproc) --stringparam suffix $(link_suffix) $< | $(fix_doctype) > $@
%.html: %.xml %.xsl $(common_depend)
$(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(to_html) > $@