From b2cf8fb1022b846a9c6566d462a5cbd0a6dd1102 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 22 Sep 2015 21:03:35 +0200 Subject: [PATCH 1/2] Makefile: Whitespace fixes --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2f306c47..09d72248 100644 --- a/Makefile +++ b/Makefile @@ -31,16 +31,13 @@ html: $(patsubst %.xml, $(OUTDIR)/%.html, $(wildcard *.xml)) pdf: $(patsubst %.xml, $(OUTDIR)/%.pdf, $(wildcard *.xml)) .PHONY: xep-% -xep-%: $(OUTDIR)/xep-%.html $(OUTDIR)/xep-%.pdf - +xep-%: $(OUTDIR)/xep-%.html $(OUTDIR)/xep-%.pdf ; .PHONY: xep-%.html -xep-%.html: $(OUTDIR)/xep-%.html - +xep-%.html: $(OUTDIR)/xep-%.html ; .PHONY: xep-%.pdf -xep-%.pdf: $(OUTDIR)/xep-%.pdf - +xep-%.pdf: $(OUTDIR)/xep-%.pdf ; $(OUTDIR)/%.html: %.xml $(XMLDEPS) xsltproc --path $(CURDIR) xep.xsl "$<" > "$@" && echo "Finished building $@" From 67beabbbb1a3427dac5bd26a5557647159526418 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 22 Sep 2015 22:07:41 +0200 Subject: [PATCH 2/2] Use TEMPDIR within OUTDIR in Makefile and some other cleanups: Add XMPPIMAGESURL. Use multiple target rule for "mkdir -p". Use special variables where possible. Remove unnecessary [ -e $FILE ] test in curl recipes. --- Makefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 09d72248..f9308d0a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ .SILENT: OUTDIR?=build -TEMPDIR?=$(TMPDIR)/xepbuild +RESOURCESDIR=$(OUTDIR)/resources +TEMPDIR?=$(OUTDIR)/xepbuild XMLDEPS=xep.xsl xep.xsd xep.ent xep.dtd ref.xsl $(OUTDIR) -TEXMLDEPS=xep2texml.xsl $(TEMPDIR) $(XMLDEPS) $(TEMPDIR)/xmpp.pdf $(TEMPDIR)/xmpp-text.pdf +TEXMLDEPS=xep2texml.xsl $(TEMPDIR) $(XMLDEPS) $(RESOURCESDIR)/xmpp.pdf $(RESOURCESDIR)/xmpp-text.pdf +XMPPIMAGESURL=https://xmpp.org/images .PHONY: help @@ -56,19 +58,15 @@ $(TEMPDIR)/%.xml.texml.tex: $(TEMPDIR)/%.xml.texml $(OUTDIR) $(TEMPDIR) -e 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' \ -e 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' $<.tex -$(TEMPDIR)/xmpp-text.pdf: $(TEMPDIR) - -[ -e $(TEMPDIR)/xmpp-text.pdf ] || curl -o "$(TEMPDIR)/xmpp-text.pdf" https://xmpp.org/images/xmpp-text.pdf +$(RESOURCESDIR)/xmpp-text.pdf: $(RESOURCESDIR) + curl -o $@ $(XMPPIMAGESURL)/xmpp-text.pdf -$(TEMPDIR)/xmpp.pdf: $(TEMPDIR) - -[ -e $(TEMPDIR)/xmpp.pdf ] || curl -o "$(TEMPDIR)/xmpp.pdf" https://xmpp.org/images/xmpp.pdf +$(RESOURCESDIR)/xmpp.pdf: $(RESOURCESDIR) + curl -o $@ $(XMPPIMAGESURL)/images/xmpp.pdf -$(TEMPDIR): - mkdir -p $(TEMPDIR) - -$(OUTDIR): - mkdir -p $(OUTDIR) +$(TEMPDIR) $(OUTDIR) $(RESOURCESDIR): + mkdir -p $@ .PHONY: clean clean: - rm -rf $(TEMPDIR) rm -rf $(OUTDIR)