1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-21 23:28:51 -05:00

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.
This commit is contained in:
Florian Schmaus 2015-09-22 22:07:41 +02:00
parent b2cf8fb102
commit 67beabbbb1

View File

@ -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)