1998-03-01 21:44:37 +01:00
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
#
|
2003-03-25 17:15:44 +01:00
|
|
|
# PostgreSQL documentation makefile
|
1998-03-01 21:44:37 +01:00
|
|
|
#
|
2006-12-15 17:50:07 +01:00
|
|
|
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.86 2006/12/15 16:50:07 momjian Exp $
|
1998-03-01 21:44:37 +01:00
|
|
|
#
|
|
|
|
#----------------------------------------------------------------------------
|
1998-03-01 09:18:09 +01:00
|
|
|
|
2000-08-31 18:12:35 +02:00
|
|
|
subdir = doc/src/sgml
|
|
|
|
top_builddir = ../../..
|
2000-11-05 22:04:07 +01:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-08-31 18:12:35 +02:00
|
|
|
|
2000-12-14 23:30:56 +01:00
|
|
|
.SECONDARY:
|
2001-01-06 17:54:16 +01:00
|
|
|
.NOTPARALLEL:
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2002-04-14 19:23:20 +02:00
|
|
|
ifndef COLLATEINDEX
|
|
|
|
COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl
|
2001-12-21 04:53:04 +01:00
|
|
|
endif
|
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
ifndef JADE
|
|
|
|
JADE = jade
|
|
|
|
endif
|
2003-03-25 17:15:44 +01:00
|
|
|
SGMLINCLUDE = -D $(srcdir)
|
2000-11-05 22:04:07 +01:00
|
|
|
|
2003-12-11 23:10:51 +01:00
|
|
|
# If this is a vpath build, some generated SGML will be in the build
|
|
|
|
# tree, so we need to make sure we look there as well as in the
|
|
|
|
# source tree
|
|
|
|
ifeq ($(vpath_build), yes)
|
|
|
|
SGMLINCLUDE += -D .
|
|
|
|
endif
|
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
ifndef NSGMLS
|
|
|
|
NSGMLS = nsgmls
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef SGMLSPL
|
|
|
|
SGMLSPL = sgmlspl
|
|
|
|
endif
|
1998-07-29 08:29:04 +02:00
|
|
|
|
2001-11-09 00:46:29 +01:00
|
|
|
CONVERT = convert
|
|
|
|
EPSTOPDF = epstopdf
|
|
|
|
|
1999-08-06 15:46:17 +02:00
|
|
|
# docbook2man generates man pages from docbook refentry source code.
|
|
|
|
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
|
|
|
|
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2003-03-25 17:15:44 +01:00
|
|
|
GENERATED_SGML = bookindex.sgml version.sgml \
|
2003-01-15 00:19:34 +01:00
|
|
|
features-supported.sgml features-unsupported.sgml
|
|
|
|
|
|
|
|
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
|
1999-08-06 15:46:17 +02:00
|
|
|
|
2002-04-14 19:23:20 +02:00
|
|
|
ifdef DOCBOOKSTYLE
|
|
|
|
CATALOG = -c $(DOCBOOKSTYLE)/catalog
|
|
|
|
endif
|
2001-02-13 22:27:05 +01:00
|
|
|
|
2002-08-05 21:43:31 +02:00
|
|
|
# Enable draft mode during development
|
|
|
|
ifneq (,$(findstring devel, $(VERSION)))
|
2003-08-28 00:58:54 +02:00
|
|
|
override JADEFLAGS += -V draft-mode
|
2002-08-05 21:43:31 +02:00
|
|
|
endif
|
|
|
|
|
2004-03-01 17:08:58 +01:00
|
|
|
# Enable some extra warnings
|
|
|
|
override SPFLAGS += -wall -wno-unused-param -wno-empty
|
2001-02-13 22:27:05 +01:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
##
|
|
|
|
## Man pages
|
|
|
|
##
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2001-01-06 17:54:16 +01:00
|
|
|
.PHONY: man
|
1999-08-06 15:46:17 +02:00
|
|
|
|
2001-08-29 21:14:40 +02:00
|
|
|
DEFAULTSECTION := $(sqlmansect_dummy)
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2006-12-02 02:26:19 +01:00
|
|
|
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-]*\]}{in the documentation}g'
|
2005-01-04 22:03:30 +01:00
|
|
|
|
2003-03-25 17:15:44 +01:00
|
|
|
man: postgres.sgml $(ALLSGML)
|
|
|
|
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
|
2001-01-06 17:54:16 +01:00
|
|
|
# One more time, to resolve cross-references
|
2003-03-25 17:15:44 +01:00
|
|
|
$(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
|
2005-01-04 22:03:30 +01:00
|
|
|
$(fix_man_xrefs) *.1 *.$(DEFAULTSECTION)
|
2001-01-06 17:54:16 +01:00
|
|
|
$(mkinstalldirs) man1 man$(DEFAULTSECTION)
|
|
|
|
mv *.1 man1/
|
|
|
|
mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
|
|
|
|
##
|
|
|
|
## HTML
|
|
|
|
##
|
|
|
|
|
2003-03-25 17:15:44 +01:00
|
|
|
all: html
|
2000-11-24 18:44:22 +01:00
|
|
|
|
2003-03-25 17:15:44 +01:00
|
|
|
.PHONY: html
|
2000-11-24 18:44:22 +01:00
|
|
|
|
2003-04-10 03:22:45 +02:00
|
|
|
html: postgres.sgml $(ALLSGML) stylesheet.dsl
|
2001-02-13 22:27:05 +01:00
|
|
|
@rm -f *.html
|
2004-03-01 17:08:58 +01:00
|
|
|
$(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
|
2003-12-11 23:10:51 +01:00
|
|
|
ifeq ($(vpath_build), yes)
|
|
|
|
@cp $(srcdir)/stylesheet.css .
|
|
|
|
endif
|
2001-09-18 14:08:27 +02:00
|
|
|
|
|
|
|
|
2003-08-31 19:28:39 +02:00
|
|
|
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
|
2001-05-13 00:51:36 +02:00
|
|
|
|
2006-12-15 17:50:07 +01:00
|
|
|
# If HTML.index does not exist, create a dummy bookindex.sgml. During the
|
|
|
|
# next build, create bookindex.sgml with the proper index contents. A proper
|
|
|
|
# bookindex.sgml is required to have an index in the output.
|
2001-05-13 00:51:36 +02:00
|
|
|
ifeq (,$(wildcard HTML.index))
|
|
|
|
bookindex.sgml:
|
|
|
|
$(COLLATEINDEX) -o $@ -N
|
|
|
|
else
|
|
|
|
bookindex.sgml: HTML.index
|
|
|
|
$(COLLATEINDEX) -i 'bookindex' -o $@ $<
|
|
|
|
endif
|
|
|
|
|
2002-10-12 18:34:28 +02:00
|
|
|
version.sgml: $(top_builddir)/src/Makefile.global
|
|
|
|
{ \
|
|
|
|
echo "<!entity version \"$(VERSION)\">"; \
|
|
|
|
echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
|
|
|
|
} >$@
|
|
|
|
|
2003-01-15 00:19:34 +01:00
|
|
|
features-supported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
|
|
|
|
$(PERL) $(srcdir)/mk_feature_tables.pl YES $^ > $@
|
|
|
|
|
|
|
|
features-unsupported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
|
|
|
|
$(PERL) $(srcdir)/mk_feature_tables.pl NO $^ > $@
|
|
|
|
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
##
|
|
|
|
## Print
|
|
|
|
##
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2006-12-10 21:46:03 +01:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
# RTF to allow minor editing for hardcopy
|
2003-03-25 17:15:44 +01:00
|
|
|
|
|
|
|
%.rtf: %.sgml $(ALLSGML) stylesheet.dsl
|
|
|
|
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print $<
|
|
|
|
|
2001-11-09 00:46:29 +01:00
|
|
|
# TeX
|
|
|
|
# Regular TeX and pdfTeX have slightly differing requirements, so we
|
|
|
|
# need to distinguish the path we're taking.
|
|
|
|
|
2006-12-10 21:46:03 +01:00
|
|
|
JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d $(srcdir)/stylesheet.dsl -t tex -V tex-backend -i output-print
|
|
|
|
|
2006-12-15 17:50:07 +01:00
|
|
|
%-A4.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
|
2006-12-10 21:46:03 +01:00
|
|
|
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
|
|
|
|
|
2006-12-15 17:50:07 +01:00
|
|
|
%-US.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
|
2006-12-10 21:46:03 +01:00
|
|
|
$(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2006-12-15 17:50:07 +01:00
|
|
|
%-A4.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
|
2006-12-10 21:46:03 +01:00
|
|
|
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
|
|
|
|
|
2006-12-15 17:50:07 +01:00
|
|
|
%-US.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl bookindex.sgml
|
2006-12-10 21:46:03 +01:00
|
|
|
$(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
|
2001-11-09 00:46:29 +01:00
|
|
|
|
|
|
|
%.dvi: %.tex-ps
|
2001-11-16 17:29:56 +01:00
|
|
|
@rm -f $*.aux $*.log
|
2006-12-15 17:50:07 +01:00
|
|
|
# multiple runs are necessary to create proper intra-document links
|
1998-03-01 21:44:37 +01:00
|
|
|
jadetex $<
|
|
|
|
jadetex $<
|
2001-02-04 13:23:11 +01:00
|
|
|
jadetex $<
|
1998-03-01 21:44:37 +01:00
|
|
|
|
2006-12-10 21:46:03 +01:00
|
|
|
# PostScript from TeX
|
1998-03-01 21:44:37 +01:00
|
|
|
%.ps: %.dvi
|
|
|
|
dvips -o $@ $<
|
|
|
|
|
2001-11-09 00:46:29 +01:00
|
|
|
%.pdf: %.tex-pdf
|
2001-11-16 17:29:56 +01:00
|
|
|
@rm -f $*.aux $*.log $*.out
|
2006-12-15 17:50:07 +01:00
|
|
|
# multiple runs are necessary to create proper intra-document links
|
2001-02-04 13:23:11 +01:00
|
|
|
pdfjadetex $<
|
|
|
|
pdfjadetex $<
|
|
|
|
pdfjadetex $<
|
|
|
|
|
|
|
|
|
2001-11-09 00:46:29 +01:00
|
|
|
# This generates an XML version of the flow-object tree. It's useful
|
|
|
|
# for debugging DSSSL code, and possibly to interface to some other
|
|
|
|
# tools that can make use of this.
|
2003-03-25 17:15:44 +01:00
|
|
|
%.fot: %.sgml $(ALLSGML) stylesheet.dsl
|
|
|
|
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -o $@ $<
|
2001-11-09 00:46:29 +01:00
|
|
|
|
|
|
|
|
1998-03-01 21:44:37 +01:00
|
|
|
# Graphics
|
|
|
|
|
|
|
|
%.gif:
|
2001-09-18 14:08:27 +02:00
|
|
|
cp $(srcdir)/../graphics/$@ .
|
1998-03-01 09:18:09 +01:00
|
|
|
|
2001-11-09 00:46:29 +01:00
|
|
|
%.eps: %.gif
|
|
|
|
$(CONVERT) $< eps:$@
|
|
|
|
|
|
|
|
%.pdf: %.eps
|
|
|
|
$(EPSTOPDF) $<
|
|
|
|
|
2000-07-21 02:44:13 +02:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
##
|
|
|
|
## Semi-automatic generation of some text files.
|
|
|
|
##
|
2000-10-17 17:26:40 +02:00
|
|
|
|
2002-04-14 19:23:20 +02:00
|
|
|
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
|
2002-11-11 21:06:00 +01:00
|
|
|
LYNX = lynx
|
2001-03-10 17:05:35 +01:00
|
|
|
|
2001-09-21 20:37:05 +02:00
|
|
|
INSTALL HISTORY regress_README: % : %.html
|
2004-03-06 03:52:46 +01:00
|
|
|
$(PERL) -p -e 's/<H(1|2)$$/<H\1 align=center/g' $< | $(LYNX) -force_html -dump -nolist -stdin >$@
|
2000-07-21 02:44:13 +02:00
|
|
|
|
2002-10-12 18:34:28 +02:00
|
|
|
INSTALL.html: standalone-install.sgml installation.sgml version.sgml
|
|
|
|
$(JADE.text) -V nochunks standalone-install.sgml installation.sgml >$@
|
2000-07-21 02:44:13 +02:00
|
|
|
|
2006-10-08 01:28:04 +02:00
|
|
|
# remove links to main documentation
|
2001-03-10 17:05:35 +01:00
|
|
|
HISTORY.html: release.sgml
|
2003-12-15 23:24:59 +01:00
|
|
|
( echo '<!doctype appendix PUBLIC "-//OASIS//DTD DocBook V4.2//EN">'; \
|
2006-10-08 01:28:04 +02:00
|
|
|
cat $< ) | \
|
2006-10-08 01:48:52 +02:00
|
|
|
$(PERL) -p -0 -e 's/<link\s+linkend[^>]*>//g' | \
|
2006-10-08 01:28:04 +02:00
|
|
|
$(PERL) -p -e 's/<\/link>//g' >tempfile_HISTORY.sgml
|
2001-03-10 17:05:35 +01:00
|
|
|
$(JADE.text) -V nochunks tempfile_HISTORY.sgml >$@
|
|
|
|
rm tempfile_HISTORY.sgml
|
2000-11-05 22:04:07 +01:00
|
|
|
|
2001-09-21 20:37:05 +02:00
|
|
|
regress_README.html: regress.sgml
|
2003-12-15 23:24:59 +01:00
|
|
|
( echo '<!doctype chapter PUBLIC "-//OASIS//DTD DocBook V4.2//EN" ['; \
|
2006-04-06 20:54:37 +02:00
|
|
|
echo '<!entity % standalone-ignore "IGNORE">'; \
|
|
|
|
echo '<!entity % standalone-include "INCLUDE"> ]>'; \
|
2001-09-21 20:37:05 +02:00
|
|
|
cat $< ) >tempfile_regress_README.sgml
|
|
|
|
$(JADE.text) -V nochunks tempfile_regress_README.sgml >$@
|
|
|
|
rm tempfile_regress_README.sgml
|
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
|
2004-01-13 19:45:19 +01:00
|
|
|
##
|
2006-12-10 17:01:06 +01:00
|
|
|
## XSLT processing
|
2004-01-13 19:45:19 +01:00
|
|
|
##
|
|
|
|
|
|
|
|
OSX = osx # (may be called sx or sgml2xml on some systems)
|
|
|
|
XSLTPROC = xsltproc
|
|
|
|
|
|
|
|
postgres.xml: postgres.sgml $(GENERATED_SGML)
|
2004-01-16 00:51:32 +01:00
|
|
|
$(OSX) -x lower $< | \
|
2006-10-03 23:13:17 +02:00
|
|
|
sed -e 's/\[\(amp\|copy\|egrave\|gt\|lt\|mdash\|nbsp\|ouml\|pi\|quot\|uuml\) *\]/\&\1;/g' \
|
2004-01-16 00:51:32 +01:00
|
|
|
-e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \
|
|
|
|
>$@
|
2006-12-10 21:46:03 +01:00
|
|
|
# ' hello Emacs
|
2004-01-13 19:45:19 +01:00
|
|
|
|
2006-12-10 17:01:06 +01:00
|
|
|
override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
|
|
|
|
|
|
|
|
xslthtml: stylesheet.xsl postgres.xml
|
|
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) $^
|
2004-01-13 19:45:19 +01:00
|
|
|
|
2004-11-23 17:27:59 +01:00
|
|
|
htmlhelp: stylesheet-hh.xsl postgres.xml
|
2006-12-10 17:01:06 +01:00
|
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) $^
|
|
|
|
|
2006-12-10 21:46:03 +01:00
|
|
|
%-A4.fo: stylesheet-fo.xsl %.xml
|
|
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
|
|
|
|
|
|
|
|
%-US.fo: stylesheet-fo.xsl %.xml
|
|
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
|
2004-11-23 17:27:59 +01:00
|
|
|
|
2006-12-10 02:53:15 +01:00
|
|
|
|
2006-10-03 23:13:17 +02:00
|
|
|
##
|
|
|
|
## Experimental Texinfo targets
|
|
|
|
##
|
|
|
|
|
|
|
|
DB2X_TEXIXML = db2x_texixml
|
|
|
|
DB2X_XSLTPROC = db2x_xsltproc
|
|
|
|
MAKEINFO = makeinfo
|
|
|
|
|
2006-12-10 02:53:15 +01:00
|
|
|
%.texixml: %.xml
|
2006-10-05 04:04:32 +02:00
|
|
|
$(DB2X_XSLTPROC) -s texi -g output-file=$(basename $@) $< -o $@
|
2006-10-03 23:13:17 +02:00
|
|
|
|
2006-12-10 02:53:15 +01:00
|
|
|
%.texi: %.texixml
|
|
|
|
$(DB2X_TEXIXML) --encoding=iso-8859-1//TRANSLIT $< --to-stdout >$@
|
|
|
|
|
|
|
|
%.info: %.texi
|
|
|
|
$(MAKEINFO) --enable-encoding --no-split --no-validate $< -o $@
|
|
|
|
|
|
|
|
# Cancel built-in suffix rules, interfering with PS building
|
|
|
|
.SUFFIXES:
|
2006-10-03 23:13:17 +02:00
|
|
|
|
2004-01-13 19:45:19 +01:00
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
##
|
|
|
|
## Check
|
|
|
|
##
|
|
|
|
|
|
|
|
# Quick syntax check without style processing
|
2003-03-25 17:15:44 +01:00
|
|
|
check: postgres.sgml $(ALLSGML)
|
2004-03-01 17:08:58 +01:00
|
|
|
$(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
|
2000-11-05 22:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## Clean
|
|
|
|
##
|
|
|
|
|
|
|
|
clean distclean maintainer-clean:
|
|
|
|
# HTML
|
2001-09-18 14:08:27 +02:00
|
|
|
rm -f HTML.manifest *.html *.gif
|
2000-11-05 22:04:07 +01:00
|
|
|
# man
|
2001-02-13 22:27:05 +01:00
|
|
|
rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log
|
2000-11-05 22:04:07 +01:00
|
|
|
# print
|
2001-11-09 00:46:29 +01:00
|
|
|
rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.eps *.fot
|
2001-05-13 00:51:36 +02:00
|
|
|
# index
|
2003-01-15 00:19:34 +01:00
|
|
|
rm -f HTML.index $(GENERATED_SGML)
|
2004-03-09 00:59:23 +01:00
|
|
|
# text
|
|
|
|
rm -f INSTALL HISTORY regress_README
|
2006-12-10 17:01:06 +01:00
|
|
|
# XSLT
|
|
|
|
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk *.fo
|
2006-10-03 23:13:17 +02:00
|
|
|
# Texinfo
|
|
|
|
rm -f *.texixml *.texi *.info db2texi.refs
|