From 67beabbbb1a3427dac5bd26a5557647159526418 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 22 Sep 2015 22:07:41 +0200 Subject: [PATCH] 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)