]> granicus.if.org Git - postgresql/blob - doc/src/sgml/Makefile
Install the SQL command man pages into a section appropriate for each
[postgresql] / doc / src / sgml / Makefile
1 #----------------------------------------------------------------------------
2 #
3 # Makefile
4 #       Postgres documentation makefile
5 #       Thomas Lockhart
6 #
7 # Copyright (c) 1994, Regents of the University of California
8 #
9 #
10 # IDENTIFICATION
11 #    $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.38 2001/08/29 19:14:39 petere Exp $
12 #
13 #----------------------------------------------------------------------------
14
15 subdir = doc/src/sgml
16 top_builddir = ../../..
17 include $(top_builddir)/src/Makefile.global
18
19 .SECONDARY:
20 .NOTPARALLEL:
21
22 ifndef DOCBOOKSTYLE
23 DOCBOOKSTYLE = /home/projects/pgsql/developers/thomas/db162.d/docbook
24 endif
25
26 ifndef JADE
27 JADE = jade
28 endif
29 SGMLINCLUDE = -D $(srcdir) -D $(srcdir)/ref -D $(srcdir)/../graphics
30
31 ifndef NSGMLS
32 NSGMLS = nsgmls
33 endif
34
35 ifndef SGMLSPL
36 SGMLSPL = sgmlspl
37 endif
38
39
40 # docbook2man generates man pages from docbook refentry source code.
41
42 ifndef D2MDIR
43 # This is where the (patched) docbook2man perl scripts reside on hub.org.
44 D2MDIR= /home/users/t/thomas/d2x/docbook2man
45 endif
46 D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
47
48 vpath %.sgml ./ref
49
50 ALLBOOKS = admin developer programmer reference tutorial user
51
52 ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) bookindex.sgml setindex.sgml
53
54 CATALOG = $(DOCBOOKSTYLE)/catalog
55
56
57 ##
58 ## Man pages
59 ##
60
61 .PHONY: man
62
63 DEFAULTSECTION := $(sqlmansect_dummy)
64
65 man: $(ALLSGML)
66         $(NSGMLS) $(NSGMLS_FLAGS) $(srcdir)/book-decl.sgml $(srcdir)/reference.sgml \
67           | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION)
68 # One more time, to resolve cross-references
69         $(NSGMLS) $(NSGMLS_FLAGS) $(srcdir)/book-decl.sgml $(srcdir)/reference.sgml \
70           | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION)
71         $(mkinstalldirs) man1 man$(DEFAULTSECTION)
72         mv *.1 man1/
73         mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
74
75
76 ##
77 ## HTML
78 ##
79
80 JADE.html = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -i output-html -t sgml
81
82 postgres.html: postgres.sgml $(ALLSGML) stylesheet.dsl
83         @rm -f *.html
84         $(JADE.html) $<
85         ln -sf $@ index.html
86
87 $(addsuffix .html, $(ALLBOOKS)): %.html: %.sgml $(ALLSGML) stylesheet.dsl
88         @rm -f *.html
89         $(JADE.html) book-decl.sgml $<
90         ln -sf $@ index.html
91
92 COLLATEINDEX = $(PERL) $(DOCBOOKSTYLE)/bin/collateindex.pl -f -g -t 'Index'
93
94 ifeq (,$(wildcard HTML.index))
95 bookindex.sgml:
96         $(COLLATEINDEX) -o $@ -N
97 setindex.sgml:
98         $(COLLATEINDEX) -x -o $@ -N
99 else
100 bookindex.sgml: HTML.index
101         $(COLLATEINDEX) -i 'bookindex' -o $@ $<
102 setindex.sgml: HTML.index
103         $(COLLATEINDEX) -i 'setindex' -x -o $@ $<
104 endif
105
106
107 ##
108 ## Print
109 ##
110
111 # RTF to allow minor editing for hardcopy
112 $(addsuffix .rtf, $(ALLBOOKS)): %.rtf: %.sgml $(ALLSGML) stylesheet.dsl
113         $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print book-decl.sgml $<
114
115 # TeX and DVI
116 $(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML) stylesheet.dsl
117         $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print book-decl.sgml $<
118
119 %.dvi: %.tex
120         jadetex $<
121         jadetex $<
122         jadetex $<
123
124 # Postscript from TeX
125 %.ps: %.dvi
126         dvips -o $@ $<
127
128 %.pdf: %.tex
129         pdfjadetex $<
130         pdfjadetex $<
131         pdfjadetex $<
132
133
134 # Graphics
135
136 %.gif:
137         cp -p ../graphics/$@ .
138
139
140 ##
141 ## Semi-automatic generation of some text files.
142 ##
143
144 JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
145
146 INSTALL HISTORY: % : %.html
147         @echo "|";\
148          echo "| You should now take \`$<', save it as a text file in Netscape,";\
149          echo "| and put it in place of the existing \`$@' file.";\
150          echo "|"
151
152 INSTALL.html: standalone-install.sgml installation.sgml
153         $(JADE.text) -V nochunks $+ >$@
154
155 HISTORY.html: release.sgml
156         ( echo '<!doctype appendix PUBLIC "-//OASIS//DTD DocBook V3.1//EN">'; \
157           cat $< ) >tempfile_HISTORY.sgml
158         $(JADE.text) -V nochunks tempfile_HISTORY.sgml >$@
159         rm tempfile_HISTORY.sgml
160
161
162 ##
163 ## Check
164 ##
165
166 check: $(addprefix check-, $(ALLBOOKS)) check-postgres
167
168 # Quick syntax check without style processing
169 $(addprefix check-, $(ALLBOOKS)): check-%: %.sgml
170         $(NSGMLS) $(SGMLINCLUDE) -s book-decl.sgml $<
171
172 check-postgres: postgres.sgml
173         $(NSGMLS) $(SGMLINCLUDE) -s $<
174
175
176 ##
177 ## Clean
178 ##
179
180 clean distclean maintainer-clean:
181 # HTML
182         rm -f HTML.manifest *.html
183 # man
184         rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log
185 # print
186         rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf
187 # index
188         rm -f HTML.index bookindex.sgml setindex.sgml