~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to doc/src/sgml/Makefile

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#----------------------------------------------------------------------------
 
2
#
 
3
# PostgreSQL documentation makefile
 
4
#
 
5
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.75 2005-01-04 21:03:30 petere Exp $
 
6
#
 
7
#----------------------------------------------------------------------------
 
8
 
 
9
subdir = doc/src/sgml
 
10
top_builddir = ../../..
 
11
include $(top_builddir)/src/Makefile.global
 
12
 
 
13
.SECONDARY:
 
14
.NOTPARALLEL:
 
15
 
 
16
ifndef COLLATEINDEX
 
17
COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl
 
18
endif
 
19
 
 
20
ifndef JADE
 
21
JADE = jade
 
22
endif
 
23
SGMLINCLUDE = -D $(srcdir)
 
24
 
 
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
 
27
# source tree
 
28
ifeq ($(vpath_build), yes)
 
29
SGMLINCLUDE += -D .
 
30
endif
 
31
 
 
32
ifndef NSGMLS
 
33
NSGMLS = nsgmls
 
34
endif
 
35
 
 
36
ifndef SGMLSPL
 
37
SGMLSPL = sgmlspl
 
38
endif
 
39
 
 
40
CONVERT = convert
 
41
EPSTOPDF = epstopdf
 
42
 
 
43
# docbook2man generates man pages from docbook refentry source code.
 
44
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
 
45
 
 
46
 
 
47
GENERATED_SGML = bookindex.sgml version.sgml \
 
48
        features-supported.sgml features-unsupported.sgml
 
49
 
 
50
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
 
51
 
 
52
ifdef DOCBOOKSTYLE
 
53
CATALOG = -c $(DOCBOOKSTYLE)/catalog
 
54
endif
 
55
 
 
56
# Enable draft mode during development
 
57
ifneq (,$(findstring devel, $(VERSION)))
 
58
override JADEFLAGS += -V draft-mode
 
59
endif
 
60
 
 
61
# Enable some extra warnings
 
62
override SPFLAGS += -wall -wno-unused-param -wno-empty
 
63
 
 
64
##
 
65
## Man pages
 
66
##
 
67
 
 
68
.PHONY: man
 
69
 
 
70
DEFAULTSECTION := $(sqlmansect_dummy)
 
71
 
 
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'
 
73
 
 
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)
 
80
        mv *.1 man1/
 
81
        mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
 
82
 
 
83
 
 
84
##
 
85
## HTML
 
86
##
 
87
 
 
88
all: html
 
89
 
 
90
.PHONY: html
 
91
 
 
92
html: postgres.sgml $(ALLSGML) stylesheet.dsl
 
93
        @rm -f *.html
 
94
        $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
 
95
ifeq ($(vpath_build), yes)
 
96
        @cp $(srcdir)/stylesheet.css .
 
97
endif
 
98
 
 
99
 
 
100
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
 
101
 
 
102
ifeq (,$(wildcard HTML.index))
 
103
bookindex.sgml:
 
104
        $(COLLATEINDEX) -o $@ -N
 
105
else
 
106
bookindex.sgml: HTML.index
 
107
        $(COLLATEINDEX) -i 'bookindex' -o $@ $<
 
108
endif
 
109
 
 
110
version.sgml: $(top_builddir)/src/Makefile.global
 
111
        { \
 
112
          echo "<!entity version \"$(VERSION)\">"; \
 
113
          echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
 
114
        } >$@
 
115
 
 
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 $^ > $@
 
118
 
 
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 $^ > $@
 
121
 
 
122
 
 
123
##
 
124
## Print
 
125
##
 
126
 
 
127
# RTF to allow minor editing for hardcopy
 
128
 
 
129
%.rtf: %.sgml $(ALLSGML) stylesheet.dsl
 
130
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print $<
 
131
 
 
132
# TeX
 
133
# Regular TeX and pdfTeX have slightly differing requirements, so we
 
134
# need to distinguish the path we're taking.
 
135
 
 
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 $@ $<
 
138
 
 
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 $@ $<
 
141
 
 
142
%.dvi: %.tex-ps
 
143
        @rm -f $*.aux $*.log
 
144
        jadetex $<
 
145
        jadetex $<
 
146
        jadetex $<
 
147
 
 
148
# Postscript from TeX
 
149
%.ps: %.dvi
 
150
        dvips -o $@ $<
 
151
 
 
152
%.pdf: %.tex-pdf
 
153
        @rm -f $*.aux $*.log $*.out
 
154
        pdfjadetex $<
 
155
        pdfjadetex $<
 
156
        pdfjadetex $<
 
157
 
 
158
 
 
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 $@ $<
 
164
 
 
165
 
 
166
# Graphics
 
167
 
 
168
%.gif:
 
169
        cp $(srcdir)/../graphics/$@ .
 
170
 
 
171
%.eps: %.gif
 
172
        $(CONVERT) $< eps:$@
 
173
 
 
174
%.pdf: %.eps
 
175
        $(EPSTOPDF) $<
 
176
 
 
177
 
 
178
##
 
179
## Semi-automatic generation of some text files.
 
180
##
 
181
 
 
182
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
 
183
LYNX = lynx
 
184
 
 
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 >$@
 
187
 
 
188
INSTALL.html: standalone-install.sgml installation.sgml version.sgml
 
189
        $(JADE.text) -V nochunks standalone-install.sgml installation.sgml >$@
 
190
 
 
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
 
196
 
 
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
 
203
 
 
204
 
 
205
##
 
206
## Experimental XML stuff
 
207
##
 
208
 
 
209
OSX = osx # (may be called sx or sgml2xml on some systems)
 
210
XSLTPROC = xsltproc
 
211
 
 
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">' \
 
216
          >$@
 
217
 
 
218
testxml: stylesheet.xsl postgres.xml
 
219
        $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
 
220
 
 
221
htmlhelp: stylesheet-hh.xsl postgres.xml
 
222
        $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
 
223
 
 
224
 
 
225
##
 
226
## Check
 
227
##
 
228
 
 
229
# Quick syntax check without style processing
 
230
check: postgres.sgml $(ALLSGML)
 
231
        $(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
 
232
 
 
233
 
 
234
##
 
235
## Clean
 
236
##
 
237
 
 
238
clean distclean maintainer-clean:
 
239
# HTML
 
240
        rm -f HTML.manifest *.html *.gif
 
241
# man
 
242
        rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log
 
243
# print
 
244
        rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.eps *.fot
 
245
# index
 
246
        rm -f HTML.index $(GENERATED_SGML)
 
247
# text
 
248
        rm -f INSTALL HISTORY regress_README
 
249
# XML
 
250
        rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk