|
|
|
@ -12,6 +12,22 @@ JSTARGETS=$(OUTDIR)/prettify.js
|
|
|
|
|
|
|
|
|
|
DO_XELATEX=cd $(OUTDIR); xelatex --interaction=nonstopmode -no-shell-escape "$(notdir $(basename $@)).tex" >/dev/null
|
|
|
|
|
|
|
|
|
|
xeps=$(wildcard *.xml)
|
|
|
|
|
proto_xeps=$(wildcard inbox/*.xml)
|
|
|
|
|
all_xeps=$(xeps) $(proto_xeps)
|
|
|
|
|
|
|
|
|
|
xep_xmls=$(patsubst %.xml,$(OUTDIR)/%.xml,$(xeps))
|
|
|
|
|
proto_xep_xmls=$(patsubst %.xml,$(OUTDIR)/%.xml,$(proto_xeps))
|
|
|
|
|
all_xep_xmls=$(xep_xmls) $(proto_xep_xmls)
|
|
|
|
|
|
|
|
|
|
xep_htmls=$(patsubst %.xml,$(OUTDIR)/%.html,$(xeps))
|
|
|
|
|
proto_xep_htmls=$(patsubst %.xml,$(OUTDIR)/%.html,$(proto_xeps))
|
|
|
|
|
all_xep_htmls=$(xep_htmls) $(proto_xep_htmls)
|
|
|
|
|
|
|
|
|
|
xep_pdfs=$(patsubst %.xml,$(OUTDIR)/%.pdf,$(xeps))
|
|
|
|
|
xep_refs=$(patsubst xep-%.xml, $(REFSDIR)/reference.XSF.XEP-%.xml, $(xeps))
|
|
|
|
|
xep_examples=$(patsubst xep-%.xml, $(EXAMPLESDIR)/%.xml, $(xeps))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
|
help:
|
|
|
|
@ -33,17 +49,30 @@ help:
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: html
|
|
|
|
|
|
|
|
|
|
$(OUTDIR)/inbox/%: build/inbox
|
|
|
|
|
build/inbox:
|
|
|
|
|
mkdir -p build/inbox
|
|
|
|
|
|
|
|
|
|
.PHONY: html
|
|
|
|
|
html: $(patsubst %.xml, $(OUTDIR)/%.html, $(wildcard *.xml))
|
|
|
|
|
html: $(xep_htmls)
|
|
|
|
|
|
|
|
|
|
.PHONY: xml
|
|
|
|
|
xml: $(xep_xmls)
|
|
|
|
|
|
|
|
|
|
.PHONY: inbox-html
|
|
|
|
|
inbox-html: $(proto_xep_htmls)
|
|
|
|
|
|
|
|
|
|
.PHONY: inbox-xml
|
|
|
|
|
inbox-xml: $(proto_xep_xmls)
|
|
|
|
|
|
|
|
|
|
.PHONY: pdf
|
|
|
|
|
pdf: $(patsubst %.xml, $(OUTDIR)/%.pdf, $(wildcard *.xml))
|
|
|
|
|
pdf: $(xep_pdfs)
|
|
|
|
|
|
|
|
|
|
.PHONY: refs
|
|
|
|
|
refs: $(patsubst xep-%.xml, $(REFSDIR)/reference.XSF.XEP-%.xml, $(wildcard *.xml))
|
|
|
|
|
refs: $(xep_refs)
|
|
|
|
|
|
|
|
|
|
.PHONY: examples
|
|
|
|
|
examples: $(patsubst xep-%.xml, $(EXAMPLESDIR)/%.xml, $(wildcard *.xml))
|
|
|
|
|
examples: $(xep_examples)
|
|
|
|
|
|
|
|
|
|
.PHONY: xep-%
|
|
|
|
|
xep-%: $(OUTDIR)/xep-%.html $(REFSDIR)/reference.XSF.XEP-%.xml $(OUTDIR)/xep-%.pdf $(EXAMPLESDIR)/%.xml;
|
|
|
|
@ -54,19 +83,23 @@ xep-%.html: $(OUTDIR)/xep-%.html ;
|
|
|
|
|
.PHONY: xep-%.pdf
|
|
|
|
|
xep-%.pdf: $(OUTDIR)/xep-%.pdf ;
|
|
|
|
|
|
|
|
|
|
$(all_xep_xmls): $(OUTDIR)/%.xml: %.xml
|
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
|
|
$(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)
|
|
|
|
|
xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@"
|
|
|
|
|
|
|
|
|
|
$(OUTDIR)/%.html: %.xml $(XMLDEPS) $(HTMLDEPS)
|
|
|
|
|
$(all_xep_htmls): $(OUTDIR)/%.html: %.xml $(XMLDEPS) $(HTMLDEPS)
|
|
|
|
|
mkdir -p $(OUTDIR)/inbox
|
|
|
|
|
xmllint --nonet --noout --noent --loaddtd --valid "$<"
|
|
|
|
|
# Check for non-data URIs
|
|
|
|
|
! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true
|
|
|
|
|
|
|
|
|
|
# Actually build the HTML
|
|
|
|
|
xsltproc --path $(CURDIR) xep.xsl "$<" > "$@" && echo "Finished building $@"
|
|
|
|
|
xsltproc --path $(CURDIR) --param htmlbase "$(if $(findstring inbox,$<),'../','./')" xep.xsl "$<" > "$@" && echo "Finished building $@"
|
|
|
|
|
|
|
|
|
|
$(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf: $(OUTDIR)
|
|
|
|
|
cp "resources/$(notdir $@)" "$@"
|
|
|
|
|