Makefile.am 2.13 KB
Newer Older
1 2 3 4 5 6 7 8
READMEXMLFILES = README.xml NEWS.xml TODO.xml AUTHORS.xml
READMEFILES = $(READMEXMLFILES) gst-python.ent

RELNOTESXMLFILES = RELNOTES.xml
RELNOTESFILES = $(RELNOTESXMLFILES) $(READMEXMLFILES) gst-python.ent

XMLFILES = $(READMEXMLFILES) $(RELNOTESXMLFILES)
XSLFILES = common.xsl full.xsl part.xsl html.xsl pdf.xsl
9
CSSFILES = gst-python.css
David I. Lehn's avatar
David I. Lehn committed
10

11 12 13 14 15 16 17 18 19 20 21 22 23 24
EXTRA_DIST = $(XMLFILES) $(XSLFILES) $(CSSFILES)

DOCS = README.txt README.html #gst-python.pdf
TOPDOCS = README.txt NEWS.txt TODO.txt AUTHORS.txt
RELNOTES = RELNOTES.txt

CLEANFILES = $(DOCS) $(TOPDOCS) $(RELNOTES) tmpbuildcatalog

if BUILD_DOCS

XMLTO = xmlto
XMLTOFLAGS = --skip-validation -o $(CURDIR)
XMLLINT = xmllint
XMLLINTFLAGS = --xinclude --noout --loaddtd --catalogs --postvalid
David I. Lehn's avatar
David I. Lehn committed
25

26
all: $(DOCS)
David I. Lehn's avatar
David I. Lehn committed
27

28 29 30 31
tmpbuildcatalog: gst-python.ent
	xmlcatalog --noout --create $@
	xmlcatalog --noout --add system `cd $(srcdir) && pwd`/gst-python.ent $(CURDIR)/gst-python.ent $@
	xmlcatalog --noout --add system $(srcdir)/gst-python.ent $(CURDIR)/gst-python.ent $@
32

33 34 35 36
#check: tmpbuildcatalog
#	for d in $(XMLFILES); do \
#		$(XMLLINT) $(XMLLINTFLAGS) $(srcdir)/$$d; \
#	done
37

38
dist-docs: $(TOPDOCS)
39

40 41
dist-hook: dist-docs
	for d in $(TOPDOCS); do \
42
		install -m 444 $$d $(distdir)/../`basename $$d .txt`; \
43
	done
44

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
# full docs

# filter out xsl deps and make xslto flags
xmltoxslflags = $(foreach xsl,$(filter %xsl,$(filter-out $(1),$(2))),-m $(srcdir)/$(xsl))
FULLDEPS = common.xsl full.xsl tmpbuildcatalog

README.txt: $(READMEFILES) $(FULLDEPS)
	$(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $<

README.html: $(READMEFILES) $(FULLDEPS) html.xsl
	$(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) xhtml-nochunks $<

README.pdf: $(READMEFILES) $(FULLDEPS) pdf.xsl
	$(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) pdf $<

# partial docs

PARTIALDEPS = gst-python.ent common.xsl part.xsl tmpbuildcatalog

RELNOTES.txt: $(RELNOTESFILES) $(PARTIALDEPS)
	$(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $<

%.txt: %.xml $(PARTIALDEPS)
	$(XMLTO) $(XMLTOFLAGS) $(call xmltoxslflags,$<,$+) txt $<

else

dist-hook:
	@echo "Error: Doc building must be enabled for autogeneration of README, NEWS, TODO, and AUTHORS for distribution."
	@false

endif