diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2016-07-05 08:54:53 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2016-07-05 08:57:55 +0200 |
commit | ec83b34a8f2ab92966ecbfc196245f5965306484 (patch) | |
tree | c38ff2e99b54598aed3b897e6416b3d9da46ddf4 /Makefile | |
parent | 7c0de6da893a1e709663c462170ff2c0e4110ac1 (diff) | |
download | mutti-web-ec83b34a8f2ab92966ecbfc196245f5965306484.tar.gz mutti-web-ec83b34a8f2ab92966ecbfc196245f5965306484.tar.bz2 mutti-web-ec83b34a8f2ab92966ecbfc196245f5965306484.zip |
Allow to use different resource caching schemes
On the deployment server we no use
make versioned_jpg="'s/.*/.&.jpg/'" versioned_png="'s/.*/.&.png/'"
to generate resource urls like image.f74d4ea.png
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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) > $@ |