| 1 |
TABLES = $(wildcard table-eg*) |
| 2 |
CHANGES = $(wildcard changes/*.xml) |
| 3 |
VERSION = devel |
| 4 |
OPTS = |
| 5 |
XSLTPROC = xsltproc |
| 6 |
XSLDBK = /usr/share/xml/docbook/stylesheet/docbook-xsl |
| 7 |
XSLPROF = $(XSLDBK)/profiling/profile.xsl |
| 8 |
XSLMAN = $(XSLDBK)/manpages/docbook.xsl |
| 9 |
XSLHTML = $(XSLDBK)/xhtml/chunk.xsl |
| 10 |
XSLPROFH = $(XSLDBK)/xhtml/profile-chunk.xsl |
| 11 |
XSLOLINK = $(XSLDBK)/xhtml/docbook.xsl |
| 12 |
HTMLDIRUM = xhtml/manual/ |
| 13 |
HTMLDIRRN = xhtml/release-notes/ |
| 14 |
CP = cp |
| 15 |
HERE = $(shell pwd) |
| 16 |
|
| 17 |
HTML_PARAMS = --param ignore.image.scaling "'1'" \ |
| 18 |
--param graphic.default.extension "'png'" \ |
| 19 |
--param use.id.as.filename "1" \ |
| 20 |
--param refentry.generate.name "0" \ |
| 21 |
--param refentry.generate.title "1" \ |
| 22 |
--param profile.attribute "'output'" \ |
| 23 |
--param profile.value "'manual;html'" \ |
| 24 |
--param othercredit.like.author.enabled "1" \ |
| 25 |
--param generate.section.toc.level "3" \ |
| 26 |
--param html.stylesheet "'manual.css'" |
| 27 |
|
| 28 |
# Where to find the manual and the release notes |
| 29 |
vpath %.xml . changes |
| 30 |
|
| 31 |
# Main targets |
| 32 |
all: olink manpagegz allpdf allhtml |
| 33 |
|
| 34 |
allpdf: manual.pdf release-notes.pdf |
| 35 |
|
| 36 |
allhtml: $(HTMLDIRUM)/index.html $(HTMLDIRRN)/index.html |
| 37 |
|
| 38 |
allstyle: all native db2latex simple |
| 39 |
|
| 40 |
olink: manual.db release-notes.db |
| 41 |
|
| 42 |
# Build and zip the Manpage |
| 43 |
manpagegz: version.xml |
| 44 |
@$(MAKE) -C manpage -f ../Makefile dblatex.1.gz |
| 45 |
|
| 46 |
# Build the HTML version of the documentation |
| 47 |
$(HTMLDIRUM)/index.html: manual.xml |
| 48 |
@$(XSLTPROC) --xinclude --param base.dir "'$(HTMLDIRUM)'" \ |
| 49 |
$(HTML_PARAMS) \ |
| 50 |
$(XSLPROFH) $< |
| 51 |
fig2dev -L svg processus.fig $(HTMLDIRUM)/processus.svg |
| 52 |
fig2dev -L svg pagesetup2.fig $(HTMLDIRUM)/pagesetup2.svg |
| 53 |
$(CP) *.png tables/*.png $(HTMLDIRUM)/. |
| 54 |
$(CP) -r math/figures $(HTMLDIRUM)/. |
| 55 |
$(CP) -r $(XSLDBK)/images $(HTMLDIRUM)/. |
| 56 |
$(CP) manual.css $(HTMLDIRUM)/. |
| 57 |
|
| 58 |
$(HTMLDIRRN)/index.html: release-notes.xml |
| 59 |
@$(XSLTPROC) --xinclude --param base.dir "'$(HTMLDIRRN)'" \ |
| 60 |
$(HTML_PARAMS) \ |
| 61 |
$(XSLPROFH) $< |
| 62 |
$(CP) manual.css $(HTMLDIRRN)/. |
| 63 |
|
| 64 |
clean: |
| 65 |
$(RM) manual.pdf release-notes.pdf *.db |
| 66 |
$(RM) $(FIGURES) manpage/dblatex.1.gz |
| 67 |
$(RM) -r $(HTMLDIRUM) |
| 68 |
$(RM) -r $(HTMLDIRRN) |
| 69 |
|
| 70 |
native db2latex simple: version.xml |
| 71 |
$(XSLTPROC) --xinclude \ |
| 72 |
--param profile.attribute "'output'" \ |
| 73 |
--param profile.value "'manual;pdf'" \ |
| 74 |
$(XSLPROF) manual.xml | \ |
| 75 |
../scripts/dblatex -P target.database.document=$(HERE)/olinkdb.xml \ |
| 76 |
-P current.docid=usermanual \ |
| 77 |
-T $@ -o [email protected] - |
| 78 |
|
| 79 |
# Use the PDF image because the PNG from .fig is ugly |
| 80 |
pagesetup2.pdf: pagesetup2.fig |
| 81 |
fig2dev -L pdf $< $@ |
| 82 |
|
| 83 |
# Build the Olink database |
| 84 |
%.db: %.xml |
| 85 |
$(XSLTPROC) --xinclude --stringparam collect.xref.targets "only" \ |
| 86 |
$(XSLOLINK) $< |
| 87 |
mv target.db $@ |
| 88 |
|
| 89 |
# Build the PDF |
| 90 |
%.pdf: %.xml version.xml $(TABLES) $(CHANGES) pagesetup2.pdf |
| 91 |
@$(XSLTPROC) --xinclude \ |
| 92 |
--param profile.attribute "'output'" \ |
| 93 |
--param profile.value "'manual;pdf'" $(XSLPROF) $< | \ |
| 94 |
../scripts/dblatex -P target.database.document=$(HERE)/olinkdb.xml \ |
| 95 |
-c manual.conf $(OPTS) -o $@ - |
| 96 |
|
| 97 |
# Build the manpage |
| 98 |
%.1.gz: %.1 |
| 99 |
gzip -f $< |
| 100 |
|
| 101 |
%.1: %.1.xml |
| 102 |
$(XSLTPROC) --param profile.attribute "'output'" \ |
| 103 |
--param profile.value "'manpage'" \ |
| 104 |
--xinclude $(XSLPROF) $< | \ |
| 105 |
$(XSLTPROC) $(XSLMAN) - |
| 106 |
|
| 107 |
# Actual version of the release |
| 108 |
version.xml: FORCE |
| 109 |
echo "<emphasis>$(VERSION)</emphasis>" > $@ |
| 110 |
|
| 111 |
FORCE: |