1
#----------------------------------------------------------------------------
3
# PostgreSQL documentation makefile
5
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.75 2005-01-04 21:03:30 petere Exp $
7
#----------------------------------------------------------------------------
10
top_builddir = ../../..
11
include $(top_builddir)/src/Makefile.global
17
COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl
23
SGMLINCLUDE = -D $(srcdir)
25
# If this is a vpath build, some generated SGML will be in the build
26
# tree, so we need to make sure we look there as well as in the
28
ifeq ($(vpath_build), yes)
43
# docbook2man generates man pages from docbook refentry source code.
44
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
47
GENERATED_SGML = bookindex.sgml version.sgml \
48
features-supported.sgml features-unsupported.sgml
50
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
53
CATALOG = -c $(DOCBOOKSTYLE)/catalog
56
# Enable draft mode during development
57
ifneq (,$(findstring devel, $(VERSION)))
58
override JADEFLAGS += -V draft-mode
61
# Enable some extra warnings
62
override SPFLAGS += -wall -wno-unused-param -wno-empty
70
DEFAULTSECTION := $(sqlmansect_dummy)
72
fix_man_xrefs = $(PERL) -npi -e 's{\[XRef to GUC-([A-Z0-9-]*)\]}{($$l = $$1) =~ tr/A-Z-/a-z_/, $$l}ge || s{\[XRef to [A-Z0-9-]*\]}{the documentation}g'
74
man: postgres.sgml $(ALLSGML)
75
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
76
# One more time, to resolve cross-references
77
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
78
$(fix_man_xrefs) *.1 *.$(DEFAULTSECTION)
79
$(mkinstalldirs) man1 man$(DEFAULTSECTION)
81
mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
92
html: postgres.sgml $(ALLSGML) stylesheet.dsl
94
$(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
95
ifeq ($(vpath_build), yes)
96
@cp $(srcdir)/stylesheet.css .
100
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
102
ifeq (,$(wildcard HTML.index))
104
$(COLLATEINDEX) -o $@ -N
106
bookindex.sgml: HTML.index
107
$(COLLATEINDEX) -i 'bookindex' -o $@ $<
110
version.sgml: $(top_builddir)/src/Makefile.global
112
echo "<!entity version \"$(VERSION)\">"; \
113
echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
116
features-supported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
117
$(PERL) $(srcdir)/mk_feature_tables.pl YES $^ > $@
119
features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
120
$(PERL) $(srcdir)/mk_feature_tables.pl NO $^ > $@
127
# RTF to allow minor editing for hardcopy
129
%.rtf: %.sgml $(ALLSGML) stylesheet.dsl
130
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print $<
133
# Regular TeX and pdfTeX have slightly differing requirements, so we
134
# need to distinguish the path we're taking.
136
%.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl
137
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -V texdvi-output -o $@ $<
139
%.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl
140
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -V texpdf-output -o $@ $<
148
# Postscript from TeX
153
@rm -f $*.aux $*.log $*.out
159
# This generates an XML version of the flow-object tree. It's useful
160
# for debugging DSSSL code, and possibly to interface to some other
161
# tools that can make use of this.
162
%.fot: %.sgml $(ALLSGML) stylesheet.dsl
163
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -o $@ $<
169
cp $(srcdir)/../graphics/$@ .
179
## Semi-automatic generation of some text files.
182
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
185
INSTALL HISTORY regress_README: % : %.html
186
$(PERL) -p -e 's/<H(1|2)$$/<H\1 align=center/g' $< | $(LYNX) -force_html -dump -nolist -stdin >$@
188
INSTALL.html: standalone-install.sgml installation.sgml version.sgml
189
$(JADE.text) -V nochunks standalone-install.sgml installation.sgml >$@
191
HISTORY.html: release.sgml
192
( echo '<!doctype appendix PUBLIC "-//OASIS//DTD DocBook V4.2//EN">'; \
193
cat $< ) >tempfile_HISTORY.sgml
194
$(JADE.text) -V nochunks tempfile_HISTORY.sgml >$@
195
rm tempfile_HISTORY.sgml
197
regress_README.html: regress.sgml
198
( echo '<!doctype chapter PUBLIC "-//OASIS//DTD DocBook V4.2//EN" ['; \
199
echo '<!entity % standalone-ignore "IGNORE"> ]>'; \
200
cat $< ) >tempfile_regress_README.sgml
201
$(JADE.text) -V nochunks tempfile_regress_README.sgml >$@
202
rm tempfile_regress_README.sgml
206
## Experimental XML stuff
209
OSX = osx # (may be called sx or sgml2xml on some systems)
212
postgres.xml: postgres.sgml $(GENERATED_SGML)
213
$(OSX) -x lower $< | \
214
sed -e 's/\[\(lt\|gt\|amp\|nbsp\|copy\|quot\|ouml\|uuml\|egrave\) *\]/\&\1;/g' \
215
-e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \
218
testxml: stylesheet.xsl postgres.xml
219
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
221
htmlhelp: stylesheet-hh.xsl postgres.xml
222
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
229
# Quick syntax check without style processing
230
check: postgres.sgml $(ALLSGML)
231
$(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
238
clean distclean maintainer-clean:
240
rm -f HTML.manifest *.html *.gif
242
rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log
244
rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.eps *.fot
246
rm -f HTML.index $(GENERATED_SGML)
248
rm -f INSTALL HISTORY regress_README
250
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk