1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 16:55:07 -05:00

Add target to extract examples in Makefile

This commit is contained in:
Sam Whited 2017-01-09 13:41:51 -06:00
parent 0e782f6246
commit e3deb1a013

View File

@ -2,6 +2,7 @@
OUTDIR?=build OUTDIR?=build
REFSDIR?=$(OUTDIR)/refs REFSDIR?=$(OUTDIR)/refs
EXAMPLESDIR?=$(OUTDIR)/examples
XMLDEPS=xep.xsd xep.ent xep.dtd ref.xsl $(OUTDIR) XMLDEPS=xep.xsd xep.ent xep.dtd ref.xsl $(OUTDIR)
TEXMLDEPS=xep2texml.xsl $(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf TEXMLDEPS=xep2texml.xsl $(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf
XMPPIMAGESURL=https://xmpp.org/images XMPPIMAGESURL=https://xmpp.org/images
@ -19,7 +20,8 @@ help:
@echo ' html - build all XEPs' @echo ' html - build all XEPs'
@echo ' clean - recursively unlink the build tree' @echo ' clean - recursively unlink the build tree'
@echo ' preview - builds html whenever an XEP changes (requires inotify-tools)' @echo ' preview - builds html whenever an XEP changes (requires inotify-tools)'
@echo ' xep-xxxx - build HTML, PDF, and reference forms of an XEP' @echo ' examples - extract all examples'
@echo ' xep-xxxx - build HTML, PDF, examples, and reference for the XEP'
@echo ' xep-xxxx.pdf - build xep-xxxx.pdf (requires xelatex and texml)' @echo ' xep-xxxx.pdf - build xep-xxxx.pdf (requires xelatex and texml)'
@echo ' xep-xxxx.html - build xep-xxxx.html' @echo ' xep-xxxx.html - build xep-xxxx.html'
@echo ' ' @echo ' '
@ -37,8 +39,11 @@ pdf: $(patsubst %.xml, $(OUTDIR)/%.pdf, $(wildcard *.xml))
.PHONY: refs .PHONY: refs
refs: $(patsubst xep-%.xml, $(REFSDIR)/reference.XSF.XEP-%.xml, $(wildcard *.xml)) refs: $(patsubst xep-%.xml, $(REFSDIR)/reference.XSF.XEP-%.xml, $(wildcard *.xml))
.PHONY: examples
examples: $(patsubst xep-%.xml, $(EXAMPLESDIR)/%.xml, $(wildcard *.xml))
.PHONY: xep-% .PHONY: xep-%
xep-%: $(OUTDIR)/xep-%.html $(REFSDIR)/reference.XSF.XEP-%.xml $(OUTDIR)/xep-%.pdf; xep-%: $(OUTDIR)/xep-%.html $(REFSDIR)/reference.XSF.XEP-%.xml $(OUTDIR)/xep-%.pdf $(EXAMPLESDIR)/%.xml;
.PHONY: xep-%.html .PHONY: xep-%.html
xep-%.html: $(OUTDIR)/xep-%.html ; xep-%.html: $(OUTDIR)/xep-%.html ;
@ -46,6 +51,9 @@ xep-%.html: $(OUTDIR)/xep-%.html ;
.PHONY: xep-%.pdf .PHONY: xep-%.pdf
xep-%.pdf: $(OUTDIR)/xep-%.pdf ; xep-%.pdf: $(OUTDIR)/xep-%.pdf ;
$(EXAMPLESDIR)/%.xml: xep-%.xml $(XMLDEPS) examples.xsl $(EXAMPLESDIR)
xsltproc --path $(CURDIR) examples.xsl "$<" > "$@" && echo "Finished building $@"
$(REFSDIR)/reference.XSF.XEP-%.xml: xep-%.xml $(XMLDEPS) ref.xsl $(REFSDIR) $(REFSDIR)/reference.XSF.XEP-%.xml: xep-%.xml $(XMLDEPS) ref.xsl $(REFSDIR)
xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@" xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@"
@ -78,7 +86,7 @@ $(OUTDIR)/%.js: %.js
$(OUTDIR)/%.css: %.css $(OUTDIR)/%.css: %.css
cp "$<" "$@" cp "$<" "$@"
$(REFSDIR) $(OUTDIR): $(EXAMPLESDIR) $(REFSDIR) $(OUTDIR):
mkdir -p $@ mkdir -p $@
.PHONY: clean .PHONY: clean