• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1default: convert
2
3# Where to find Docbook 4 man page sources
4OLDMAN = docbook4
5
6# Converting Docbook 4 -> Docbook 5 - now use local (up to date) copy
7#DB4UPGRADE = /usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl
8DB4UPGRADE = db4-upgrade.xsl
9DOCBOOK5CONV = xsltproc $(DB4UPGRADE)
10
11# Files to copy from parent directory (not legal Docbook 4)
12COPYFILES = reference.xml
13
14# Must edit XIncludes to declare Docbook namespace, which DB4 doesn't allow
15# This works on either <table> or <informaltable> root elements
16$(COPYFILES): $@
17	cp $(OLDMAN)/$@ $@
18	sed -i \
19	    -e 's#<table>#<table xmlns="http://docbook.org/ns/docbook" version="5.0">#g' \
20	    -e 's#<informaltable>#<informaltable xmlns="http://docbook.org/ns/docbook" version="5.0">#g' \
21	    $@
22
23SRCXML = $(wildcard $(OLDMAN)/egl[A-Z]*.xml)
24XML = $(filter-out $(COPYFILES),$(patsubst $(OLDMAN)/%.xml,%.xml,$(SRCXML)))
25
26## $(XML): %.xml: $(OLDMAN)/%.xml DOCTYPE.txt $(DB4UPGRADE)
27##	   cp DOCTYPE.txt $@
28
29$(XML): %.xml: $(OLDMAN)/%.xml $(DB4UPGRADE)
30	sed -e 's/&/AMPER/g' < $< | \
31	    $(DOCBOOK5CONV) - | \
32	    sed -e 's/AMPER/\&/g' >> $@
33
34# Actually convert pages from Docbook4 -> Docbook 5
35convert: $(XML) $(COPYFILES)
36
37# Remove generated targets
38clean clobber:
39	-rm -f $(XML) $(COPYFILES)
40