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
#
2010-05-01 20:15:07 +02:00
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.141 2010/05/01 18:15:07 tgl Exp $
1998-03-01 21:44:37 +01:00
#
#----------------------------------------------------------------------------
1998-03-01 09:18:09 +01:00
2009-08-10 00:47:59 +02:00
# This makefile is for building and installing the documentation.
# When a release tarball is created, the documentation files are
# prepared using the distprep target. In CVS-based trees these files
# don't exist, unless explicitly built, so we skip the installation in
# that case.
# Make "html" the default target, since that is what most people tend
# to want to use.
html :
2000-08-31 18:12:35 +02:00
subdir = doc/src/sgml
top_builddir = ../../..
2000-11-05 22:04:07 +01:00
i n c l u d e $( top_builddir ) / s r c / M a k e f i l e . g l o b a l
2000-08-31 18:12:35 +02:00
2009-08-10 00:47:59 +02:00
2010-03-30 02:10:46 +02:00
all : html man
distprep : html distprep -man
2009-08-10 00:47:59 +02:00
1998-03-01 21:44:37 +01:00
2002-04-14 19:23:20 +02:00
i f n d e f C O L L A T E I N D E X
COLLATEINDEX = $( DOCBOOKSTYLE) /bin/collateindex.pl
2001-12-21 04:53:04 +01:00
e n d i f
2000-11-05 22:04:07 +01:00
i f n d e f J A D E
JADE = jade
e n d i f
2009-08-28 22:26:19 +02:00
SGMLINCLUDE = -D . -D $( srcdir)
2000-11-05 22:04:07 +01:00
i f n d e f N S G M L S
NSGMLS = nsgmls
e n d i f
2009-08-05 00:04:37 +02:00
i f n d e f O S X
OSX = osx
2000-11-05 22:04:07 +01:00
e n d i f
1998-07-29 08:29:04 +02:00
2009-08-05 00:04:37 +02:00
i f n d e f X S L T P R O C
XSLTPROC = xsltproc
2008-11-26 12:26:54 +01:00
e n d i f
2009-08-05 00:04:37 +02:00
o v e r r i d e XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
1999-08-06 15:46:17 +02:00
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
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
# Sometimes we don't want this one.
ALMOSTALLSGML := $( filter-out %bookindex.sgml,$( ALLSGML) )
2002-04-14 19:23:20 +02:00
i f d e f D O C B O O K S T Y L E
CATALOG = -c $( DOCBOOKSTYLE) /catalog
e n d i f
2001-02-13 22:27:05 +01:00
2004-03-01 17:08:58 +01:00
# Enable some extra warnings
2007-08-31 18:41:52 +02:00
# -wfully-tagged needed to throw a warning on missing tags
# for older tool chains, 2007-08-31
2008-10-04 04:19:08 +02:00
# Note: try "make SPFLAGS=-wxml" to catch a lot of other dubious constructs,
# in particular < and & that haven't been made into entities. It's far too
# noisy to turn on by default, unfortunately.
2007-08-31 04:03:02 +02:00
o v e r r i d e SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
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
2010-03-30 02:10:46 +02:00
man distprep-man : man -stamp
1998-03-01 21:44:37 +01:00
2009-08-28 22:26:19 +02:00
man-stamp : stylesheet -man .xsl postgres .xml
2009-08-10 00:47:59 +02:00
$( XSLTPROC) $( XSLTPROCFLAGS) $( XSLTPROC_MAN_FLAGS) $^
2009-08-05 00:04:37 +02:00
touch $@
1998-03-01 21:44:37 +01:00
2000-11-05 22:04:07 +01:00
##
## HTML
##
2009-08-10 00:47:59 +02:00
.PHONY : draft
2009-08-05 00:04:37 +02:00
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
JADE.html.call = $( JADE) $( JADEFLAGS) $( SPFLAGS) $( SGMLINCLUDE) $( CATALOG) -d stylesheet.dsl -t sgml -i output-html
# The draft target creates HTML output in draft mode, without index (for faster build).
draft : postgres .sgml $( ALMOSTALLSGML ) stylesheet .dsl
2009-08-28 22:26:19 +02:00
$( MKDIR_P) html
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
$( JADE.html.call) -V draft-mode $<
2009-08-28 22:26:19 +02:00
cp $( srcdir) /stylesheet.css html/
2007-10-07 02:32:11 +02:00
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
html : html -stamp
2007-10-07 02:32:11 +02:00
2009-08-28 22:26:19 +02:00
html-stamp : postgres .sgml $( ALLSGML ) stylesheet .dsl
$( MKDIR_P) html
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
$( JADE.html.call) -i include-index $<
2009-08-28 22:26:19 +02:00
cp $( srcdir) /stylesheet.css html/
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
touch $@
2007-01-27 23:44:32 +01:00
2009-08-28 22:26:19 +02:00
HTML.index : postgres .sgml $( ALMOSTALLSGML ) stylesheet .dsl
@$( MKDIR_P) html
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
$( JADE.html.call) -V html-index $<
2001-05-13 00:51:36 +02:00
2009-08-28 22:26:19 +02:00
bookindex.sgml : HTML .index
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
LC_ALL = C $( PERL) $( COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
2007-01-09 23:19:36 +01:00
2009-08-17 23:29:30 +02:00
# Technically, this should depend on Makefile.global, but then
# version.sgml would need to be rebuilt after every configure run,
# even in distribution tarballs. So this is cheating a bit, but it
# will achieve the goal of updating the version number when it
# changes.
2009-08-28 22:26:19 +02:00
version.sgml : $( top_srcdir ) /configure
2002-10-12 18:34:28 +02:00
{ \
echo " <!entity version \" $( VERSION) \"> " ; \
2008-12-11 08:34:09 +01:00
echo " <!entity majorversion \" $( MAJORVERSION) \"> " ; \
2002-10-12 18:34:28 +02:00
} >$@
2009-08-28 22:26:19 +02:00
features-supported.sgml : $( top_srcdir ) /src /backend /catalog /sql_feature_packages .txt $( top_srcdir ) /src /backend /catalog /sql_features .txt
2003-01-15 00:19:34 +01:00
$( PERL) $( srcdir) /mk_feature_tables.pl YES $^ > $@
2009-08-28 22:26:19 +02:00
features-unsupported.sgml : $( top_srcdir ) /src /backend /catalog /sql_feature_packages .txt $( top_srcdir ) /src /backend /catalog /sql_features .txt
2003-01-15 00:19:34 +01:00
$( 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
2009-09-14 15:23:48 +02:00
%.rtf : %.sgml $( ALLSGML )
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
$( JADE) $( JADEFLAGS) $( SGMLINCLUDE) $( CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print -i include-index postgres.sgml
2003-03-25 17:15:44 +01:00
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.
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
JADE.tex.call = $( JADE) $( JADEFLAGS) $( SGMLINCLUDE) $( CATALOG) -d $( srcdir) /stylesheet.dsl -t tex -V tex-backend -i output-print -i include-index
2006-12-10 21:46:03 +01:00
2009-12-30 14:48:52 +01:00
%-A4.tex-ps : %.sgml $( ALLSGML )
$( JADE.tex.call) -V texdvi-output -V '%paper-type%' = A4 -o $@ $<
2006-12-10 21:46:03 +01:00
2009-12-30 14:48:52 +01:00
%-US.tex-ps : %.sgml $( ALLSGML )
$( JADE.tex.call) -V texdvi-output -V '%paper-type%' = USletter -o $@ $<
%-A4.tex-pdf : %.sgml $( ALLSGML )
$( JADE.tex.call) -V texpdf-output -V '%paper-type%' = A4 -o $@ $<
%-US.tex-pdf : %.sgml $( ALLSGML )
$( 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
2007-01-07 09:49:31 +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
2007-12-14 14:20:30 +01:00
postgres.ps :
2007-12-15 11:28:21 +01:00
$( error Invalid target; use postgres-A4.ps or postgres-US.ps as targets)
2009-05-02 22:17:19 +02:00
1998-03-01 21:44:37 +01:00
%.ps : %.dvi
dvips -o $@ $<
2007-12-14 14:20:30 +01:00
postgres.pdf :
2007-12-15 11:28:21 +01:00
$( error Invalid target; use postgres-A4.pdf or postgres-US.pdf as targets)
2009-05-02 22:17:19 +02:00
2001-11-09 00:46:29 +01:00
%.pdf : %.tex -pdf
2001-11-16 17:29:56 +01:00
@rm -f $* .aux $* .log $* .out
2007-01-07 09:49:31 +01:00
# multiple runs are necessary to create proper intra-document links
2001-02-04 13:23:11 +01:00
pdfjadetex $<
pdfjadetex $<
pdfjadetex $<
2009-08-10 00:47:59 +02:00
# Cancel built-in suffix rules, interfering with PS building
.SUFFIXES :
2001-02-04 13:23:11 +01:00
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.
2009-09-14 15:23:48 +02:00
%.fot : %.sgml $( ALLSGML )
Rearrangement of the HTML docs build rules
Set up proper makefile dependencies in the documentation build rules,
especially around the HTML/index build. The problem we've had with all
previous solutions is that we have used the same file name, such as HTML.index
or bookindex.sgml, to mean different things at different stages of the build,
and make can't distinguish that. The solution here is that the first jade run
produces HTML.index, but does not require bookindex.sgml at all, and produces
no other html output (the latter an idea from Alvaro). The second jade run
includes bookindex.sgml, but does not recreate HTML.index. That way, when you
change an sgml file, jade is run twice and at the end all dependencies are
satisfied. Omitting the html output in the first stage also makes the full
build a lot faster.
When you run one of the print format targets, only the first jade run is run,
then the print target-specific commands. If an HTML build has completed
previously, the first jade run is skipped because the dependencies have
already been satisfied.
The draft and check targets for quick builds and syntax verification are still
there.
2009-07-15 00:16:38 +02:00
$( JADE) $( JADEFLAGS) $( SGMLINCLUDE) $( CATALOG) -d stylesheet.dsl -t fot -i output-print -i include-index -o $@ $<
2001-11-09 00:46:29 +01: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
2009-05-02 22:17:19 +02:00
HISTORY.html : generate_history .pl $( wildcard $ ( srcdir ) /release *.sgml )
$( PERL) $< " $( srcdir) " release.sgml >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
##
2009-07-20 20:34:58 +02:00
postgres.xml : postgres .sgml $( ALMOSTALLSGML )
2010-05-01 20:15:07 +02:00
$( OSX) -D. -x lower $< >postgres.xmltmp
$( PERL) -p -e 's/\[(amp|copy|egrave|gt|lt|mdash|nbsp|ouml|pi|quot|uuml) *\]/\&\1;/g;' \
-e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
<postgres.xmltmp >$@
rm postgres.xmltmp
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
xslthtml : stylesheet .xsl postgres .xml
2009-08-10 00:47:59 +02:00
$( XSLTPROC) $( XSLTPROCFLAGS) $( XSLTPROC_HTML_FLAGS) $^
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 $@
2004-01-13 19:45:19 +01:00
2000-11-05 22:04:07 +01:00
##
## Check
##
# Quick syntax check without style processing
2010-02-05 20:28:39 +01:00
check : postgres .sgml $( ALMOSTALLSGML ) check -tabs
2004-03-01 17:08:58 +01:00
$( NSGMLS) $( SPFLAGS) $( SGMLINCLUDE) -s $<
2000-11-05 22:04:07 +01:00
2009-08-10 00:47:59 +02:00
##
## Install
##
2010-03-30 02:10:46 +02:00
vpathsearch = ` for f in $( addsuffix /$( 1) ,$( subst :, ,. $( VPATH) ) ) ; do test -r $$ f && echo $$ f && break; done `
2009-08-28 22:26:19 +02:00
2010-03-30 02:10:46 +02:00
install : install -html
2009-08-10 00:47:59 +02:00
i f n e q ( $( PORTNAME ) , s c o )
2010-03-30 02:10:46 +02:00
install : install -man
2009-08-10 00:47:59 +02:00
e n d i f
installdirs :
2009-08-27 00:24:44 +02:00
$( MKDIR_P) '$(DESTDIR)$(htmldir)' /html $( addprefix '$(DESTDIR)$(mandir)' /man, 1 3 $( sqlmansectnum) )
2009-08-10 00:47:59 +02:00
uninstall :
rm -f '$(DESTDIR)$(htmldir)/html/' * $( addprefix '$(DESTDIR)$(mandir)' /man, 1/* 3/* $( sqlmansectnum) /*)
## Install html
install-html : html installdirs
2009-08-28 22:26:19 +02:00
cp -R $( call vpathsearch,html) '$(DESTDIR)$(htmldir)'
2009-08-10 00:47:59 +02:00
## Install man
2009-08-11 23:53:06 +02:00
install-man : man installdirs
2009-08-10 00:47:59 +02:00
sqlmansect ?= 7
sqlmansectnum = $( shell expr X'$(sqlmansect)' : X'\([0-9]\)' )
# Before we install the man pages, we massage the section numbers to
# follow the local conventions.
#
i f e q ( $( sqlmansectnum ) , 7 )
install-man :
2009-08-28 22:26:19 +02:00
cp -R $( foreach dir,man1 man3 man7,$( call vpathsearch,$( dir) ) ) '$(DESTDIR)$(mandir)'
2009-08-10 00:47:59 +02:00
e l s e # sqlmansectnum != 7
fix_sqlmansectnum = sed -e '/^\.TH/s/"7"/"$(sqlmansect)"/' \
-e 's/\\fR(7)/\\fR($(sqlmansectnum))/g' \
-e '1s/^\.so man7/.so man$(sqlmansectnum)/g;1s/^\(\.so.*\)\.7$$/\1.$(sqlmansect)/g'
2010-04-02 16:02:49 +02:00
man : fixed -man -stamp
2009-08-10 00:47:59 +02:00
2010-04-02 16:02:49 +02:00
fixed-man-stamp : man -stamp
@$( MKDIR_P) $( addprefix fixedman/,man1 man3 man$( sqlmansectnum) )
for file in $( call vpathsearch,man1) /*.1; do $( fix_sqlmansectnum) $$ file >fixedman/man1/` basename $$ file` || exit; done
for file in $( call vpathsearch,man3) /*.3; do $( fix_sqlmansectnum) $$ file >fixedman/man3/` basename $$ file` || exit; done
for file in $( call vpathsearch,man7) /*.7; do $( fix_sqlmansectnum) $$ file >fixedman/man$( sqlmansectnum) /` basename $$ file | sed s/\. 7$$ /.$( sqlmansect) /` || exit; done
2009-08-10 00:47:59 +02:00
2010-04-02 16:02:49 +02:00
install-man :
cp -R $( foreach dir,man1 man3 man$( sqlmansectnum) ,fixedman/$( dir) ) '$(DESTDIR)$(mandir)'
2009-08-10 00:47:59 +02:00
clean : clean -man
.PHONY : clean -man
clean-man :
2010-04-02 16:02:49 +02:00
rm -rf fixedman/ fixed-man-stamp
2009-08-10 00:47:59 +02:00
e n d i f # sqlmansectnum != 7
2010-02-05 20:31:18 +01:00
# tabs are harmless, but it is best to avoid them in SGML files
2010-02-05 15:51:50 +01:00
check-tabs :
2010-02-05 20:28:39 +01:00
@( ! grep ' ' $( wildcard $( srcdir) /*.sgml $( srcdir) /ref/*.sgml) ) || ( echo "Tabs appear in SGML files" ; exit 1)
2009-08-10 00:47:59 +02:00
2000-11-05 22:04:07 +01:00
##
## Clean
##
2009-08-12 00:21:51 +02:00
# This allows removing some files from the distribution tarballs while
# keeping the dependencies satisfied.
.SECONDARY : postgres .xml $( GENERATED_SGML ) HTML .index
2009-08-15 03:56:35 +02:00
.SECONDARY : INSTALL .html HISTORY .html regress_README .html
.SECONDARY : %-A 4.tex -ps %-US .tex -ps %-A 4.tex -pdf %-US .tex -pdf
2009-08-12 00:21:51 +02:00
2009-08-15 03:56:35 +02:00
clean :
# text --- these are shipped, but not in this directory
2009-10-06 22:00:44 +02:00
rm -f INSTALL HISTORY regress_README
rm -f INSTALL.html HISTORY.html regress_README.html
2000-11-05 22:04:07 +01:00
# print
2009-10-06 22:00:44 +02:00
rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.fot
2001-05-13 00:51:36 +02:00
# index
2009-10-06 22:00:44 +02:00
rm -f HTML.index $( GENERATED_SGML)
2006-12-10 17:01:06 +01:00
# XSLT
2010-05-01 20:15:07 +02:00
rm -f postgres.xml postgres.xmltmp htmlhelp.hhp toc.hhc index.hhk *.fo
2006-10-03 23:13:17 +02:00
# Texinfo
2009-10-06 22:00:44 +02:00
rm -f *.texixml *.texi *.info db2texi.refs
distclean : clean
2009-08-15 03:56:35 +02:00
maintainer-clean : distclean
2009-10-06 02:54:26 +02:00
# HTML
rm -fr html/ html-stamp
# man
rm -rf man1/ man3/ man7/ man-stamp