1
#----------------------------------------------------------------------------
3
# PostgreSQL documentation makefile
5
# $Id: Makefile,v 1.19.2.2 2008-05-07 19:27:54 cbbrowne Exp $
7
#----------------------------------------------------------------------------
9
subdir = doc/adminguide
10
slony_top_builddir = ../..
12
include $(slony_top_builddir)/Makefile.global
18
GENERATED_SGML = bookindex.sgml version.sgml
20
ALLSGML = $(wildcard $(srcdir)/*.sgml) $(GENERATED_SGML)
21
DISTFILES = $(ALLSGML) $(GENERATED_SGML)
24
CATALOG = -c $(DOCBOOKSTYLE)/catalog
27
# Enable draft mode during development
28
ifneq (,$(findstring devel, $(VERSION)))
29
override JADEFLAGS += -V draft-mode
32
# docbook2man generates man pages from docbook refentry source code.
34
D2MSCRIPT=$(D2MDIR)/docbook2man-spec.pl
37
# Enable some extra warnings
38
override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
47
man: man.sgml $(ALLSGML)
51
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --date "`date '+%Y-%m-%d'`"
52
# One more time, to resolve cross-references
53
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --date "`date '+%Y-%m-%d'`"
70
$(mkinstalldirs) $(DESTDIR)$(docdir)/sgml
71
$(mkinstalldirs) $(DESTDIR)$(docdir)/html
72
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
73
$(mkinstalldirs) $(DESTDIR)$(mandir)/man7
78
for file in $(wildcard $(srcdir)/*.sgml) ; do \
79
$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/sgml || exit; \
81
for file in $(wildcard man1/*) ; do \
82
$(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man1 || exit;\
84
for file in $(wildcard man7/*) ; do \
85
$(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man7 || exit;\
87
for file in $(wildcard *.html) stylesheet.css ; do \
88
$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/html || exit;\
96
@echo "You must have jade installed to build the documentation." && exit;
98
html: slony.sgml $(ALLSGML) stylesheet.dsl
100
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -ioutput-html -t sgml $<
101
ifeq ($(vpath_build), yes)
102
@cp $(srcdir)/stylesheet.css .
106
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
109
ifeq (,$(wildcard HTML.index))
111
$(COLLATEINDEX) -o $@ -N
113
bookindex.sgml: HTML.index
114
$(COLLATEINDEX) -i 'bookindex' -o $@ $<
118
@echo "You must have jade to build the documentation" && exit
125
# RTF to allow minor editing for hardcopy
127
%.rtf: %.sgml $(ALLSGML) stylesheet.dsl
128
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -ioutput-print $<
131
# Regular TeX and pdfTeX have slightly differing requirements, so we
132
# need to distinguish the path we're taking.
134
%.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl
135
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -ioutput-print -V texdvi-output -o $@ $<
137
%.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl
138
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -ioutput-print -V texpdf-output -o $@ $<
146
# Postscript from TeX
151
@rm -f $*.aux $*.log $*.out
157
# This generates an XML version of the flow-object tree. It's useful
158
# for debugging DSSSL code, and possibly to interface to some other
159
# tools that can make use of this.
160
%.fot: %.sgml $(ALLSGML) stylesheet.dsl
161
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -o $@ $<
167
cp $(srcdir)/../graphics/$@ .
177
## Semi-automatic generation of some text files.
180
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
183
INSTALL HISTORY regress_README: % : %.html
184
$(PERL) -p -e 's/<H(1|2)$$/<H\1 align=center/g' $< | $(LYNX) -force_html -dump -nolist -stdin >$@
186
INSTALL.html: standalone-install.sgml installation.sgml
187
$(JADE.text) -V nochunks standalone-install.sgml installation.sgml >$@
189
HISTORY.html: release.sgml
190
( echo '<!doctype appendix PUBLIC "-//OASIS//DTD DocBook V4.2//EN">'; \
191
cat $< ) >tempfile_HISTORY.sgml
192
$(JADE.text) -V nochunks tempfile_HISTORY.sgml >$@
193
rm tempfile_HISTORY.sgml
195
regress_README.html: regress.sgml
196
( echo '<!doctype chapter PUBLIC "-//OASIS//DTD DocBook V4.2//EN" ['; \
197
echo '<!entity % standalone-ignore "IGNORE"> ]>'; \
198
cat $< ) >tempfile_regress_README.sgml
199
$(JADE.text) -V nochunks tempfile_regress_README.sgml >$@
200
rm tempfile_regress_README.sgml
204
## Experimental XML stuff
207
OSX = osx # (may be called sx or sgml2xml on some systems)
210
slony.xml: slony.sgml $(GENERATED_SGML)
211
$(OSX) -x lower $< | \
212
sed -e 's/\[\(lt\|gt\|amp\|nbsp\|copy\|quot\|ouml\|uuml\|egrave\) *\]/\&\1;/g' \
213
-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
testxml: stylesheet.xsl slony.xml
217
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
219
htmlhelp: stylesheet-hh.xsl slony.xml
220
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
227
# Quick syntax check without style processing
228
check: slony.sgml $(ALLSGML) $(GENERATED_SGML)
229
$(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
236
clean distclean maintainer-clean:
238
rm -f HTML.manifest *.html *.gif
240
rm -rf *.1 *.7 man1 man7 manpage.refs manpage.links manpage.log
242
rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.eps *.fot
244
rm -f HTML.index $(GENERATED_SGML)
246
rm -f INSTALL HISTORY
248
BASEDIR=$(slony_top_builddir)/src/backend
249
BASESQL=$(BASEDIR)/slony1_base.sql
250
BASEFUNS=$(BASEDIR)/slony1_funcs.sql
254
CREATELANG=$(pgbindir)/createlang # That's how it is for me...
255
PGAUTODOC=/usr/bin/postgresql_autodoc
257
schemadoc.xml: $(BASESQL) $(BASEFUNS) $(XIDDIR)
258
@$(pgbindir)/createdb $(TEMPDB) && ( \
259
$(CREATELANG) plpgsql $(TEMPDB) 2>/dev/null ; \
260
echo "drop schema $(TEMPSCHEMA);create schema $(TEMPSCHEMA);" | $(pgbindir)/psql $(TEMPDB) && \
261
cat $(XIDSQL) $(BASEFUNS) $(BASESQL) | sed -e "s/@NAMESPACE@/$(TEMPSCHEMA)/g" -e "s/@CLUSTERNAME@/$(TEMPSCHEMA)/g" | $(pgbindir)/psql $(TEMPDB) && \
262
$(PGAUTODOC) -d $(TEMPDB) -s $(TEMPSCHEMA) -t xml -f schemadoc ;\
263
sed -i.bak -e "s/$(TEMPSCHEMA)\.//g" -e "s@<book.*>@@g" -e "s@</book.*>@@g" schemadoc.xml ;\
264
rm schemadoc.xml.bak ;\
265
$(pgbindir)/dropdb $(TEMPDB) >/dev/null 2>&1 \
266
) || echo "unable to createdb $(TEMPDB)"
268
version.sgml: $(slony_top_builddir)/Makefile.global
270
echo "<!entity version \"$(VERSION)\">"; \
271
echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
274
distdir: $(DISTFILES)
275
mkdir -p $(distdir)/$(subdir)
276
-chmod 777 $(distdir)/$(subdir)
277
@for file in $(DISTFILES) ; do \
278
cp $$file $(distdir)/$(subdir)/$$file || exit; \