diff --git a/Makefile b/Makefile index ed63438659b4c4d7ee0426bfa0e8679d066323b9..26647f77fb271391d21e4d8afae8fe9e875ffccc 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ -default: bjcp-2015-styleguide-orig.xml orig bjcp-2015-styleguide-de.xml bjcp-2015-styleguide-orig.html bjcp-2015-styleguide-de.html +DEFILES = $(shell ls de/*.xml) +FIXFILES = $(shell ls fix/*.xml) + +default: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml bjcp-2015-styleguide-orig.html bjcp-2015-styleguide-de.html cache/2015_Guidelines_Beer.docx: if [ ! -d cache ] ; then mkdir cache ; fi @@ -8,14 +11,12 @@ cache/2015_Guidelines_Beer.docx: cache/bjcp-2015-styleguide-word.xml: cache/2015_Guidelines_Beer.docx unzip -p cache/2015_Guidelines_Beer.docx word/document.xml | xmllint --format - > cache/bjcp-2015-styleguide-word.xml -bjcp-2015-styleguide-orig.xml: fix/* cache/bjcp-2015-styleguide-word.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl +bjcp-2015-styleguide-orig.xml: $(FIXFILES) cache/bjcp-2015-styleguide-word.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl xsl/bjcp-2015-styleguide-split.xsl -xsltproc --output bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-doc-to-xml.xsl cache/bjcp-2015-styleguide-word.xml 2>&1 | grep -v "failed to load external entity" - -orig: bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-split.xsl if [ ! -d orig ] ; then mkdir orig ; fi xsltproc xsl/bjcp-2015-styleguide-split.xsl bjcp-2015-styleguide-orig.xml -bjcp-2015-styleguide-de.xml: orig/* de/* xsl/bjcp-2015-styleguide-translate.xsl +bjcp-2015-styleguide-de.xml: bjcp-2015-styleguide-orig.xml $(DEFILES) xsl/bjcp-2015-styleguide-translate.xsl -xsltproc --stringparam lang de --output bjcp-2015-styleguide-de.xml xsl/bjcp-2015-styleguide-translate.xsl bjcp-2015-styleguide-orig.xml 2>&1 | grep -v "failed to load external entity" bjcp-2015-styleguide-orig.html: xsl/bjcp-2015-styleguide-html.xsl bjcp-2015-styleguide-orig.xml