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-09-20 22:08:53 +02:00
# doc/src/sgml/Makefile
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
2010-09-22 20:10:28 +02:00
# prepared using the distprep target. In Git-based trees these files
2009-08-10 00:47:59 +02:00
# 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 :
2015-05-12 18:30:50 +02:00
NO_TEMP_INSTALL = yes
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
2013-10-11 03:53:34 +02:00
all : html man
2010-03-30 02:10:46 +02:00
2013-10-11 03:53:34 +02:00
distprep : html distprep -man
2009-08-10 00:47:59 +02:00
1998-03-01 21:44:37 +01:00
2014-09-14 02:14:17 +02:00
i f n d e f D B T O E P U B
DBTOEPUB = $( missing) dbtoepub
e n d i f
2000-11-05 22:04:07 +01:00
i f n d e f J A D E
2014-09-14 02:14:17 +02:00
JADE = $( missing) jade
2000-11-05 22:04:07 +01:00
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
2014-09-14 02:14:17 +02:00
NSGMLS = $( missing) nsgmls
2000-11-05 22:04:07 +01:00
e n d i f
2009-08-05 00:04:37 +02:00
i f n d e f O S X
2014-09-14 02:14:17 +02:00
OSX = $( missing) osx
2000-11-05 22:04:07 +01:00
e n d i f
1998-07-29 08:29:04 +02:00
doc: Check DocBook XML validity during the build
Building the documentation with XSLT does not check the DTD, like a
DSSSL build would. One can often get away with having invalid XML, but
the stylesheets might then create incorrect output, as they are not
designed to handle that. Therefore, check the validity of the XML
against the DTD, using xmllint, during the build.
Add xmllint detection to configure, and add some documentation.
xmllint comes with libxml2, which is already in use, but it might be in
a separate package, such as libxml2-utils on Debian.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
2014-10-21 20:46:38 +02:00
i f n d e f X M L L I N T
XMLLINT = $( missing) xmllint
e n d i f
2009-08-05 00:04:37 +02:00
i f n d e f X S L T P R O C
2014-09-14 02:14:17 +02:00
XSLTPROC = $( missing) 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 \
2011-02-04 04:32:49 +01:00
features-supported.sgml features-unsupported.sgml errcodes-table.sgml
2003-01-15 00:19:34 +01:00
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
2010-11-23 21:27:50 +01:00
# -wfully-tagged needed to throw a warning on missing tags
2007-08-31 18:41:52 +02:00
# 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
doc: Check DocBook XML validity during the build
Building the documentation with XSLT does not check the DTD, like a
DSSSL build would. One can often get away with having invalid XML, but
the stylesheets might then create incorrect output, as they are not
designed to handle that. Therefore, check the validity of the XML
against the DTD, using xmllint, during the build.
Add xmllint detection to configure, and add some documentation.
xmllint comes with libxml2, which is already in use, but it might be in
a separate package, such as libxml2-utils on Debian.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
2014-10-21 20:46:38 +02:00
$( XMLLINT) --noout --valid 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
2012-02-25 15:13:12 +01:00
i f e q ( $( STYLE ) , w e b s i t e )
JADE.html.call += -V website-stylesheet
e n d i f
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
# 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
2013-10-11 03:53:34 +02:00
$( MAKE) check-tabs
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) -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
2010-06-12 11:55:12 +02:00
# single-page HTML
postgres.html : postgres .sgml $( ALLSGML ) stylesheet .dsl
$( JADE.html.call) -V nochunks -V rootchunk -V '(define %root-filename% #f)' -V '(define use-output-dir #f)' -i include-index $<
2010-06-12 17:58:38 +02:00
# single-page text
postgres.txt : postgres .html
2010-06-12 19:17:25 +02:00
$( LYNX) -force_html -dump -nolist $< > $@
2010-06-12 17:58:38 +02: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
2012-03-22 05:46:03 +01:00
i f d e f C O L L A T E I N D E X
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 $@ $<
2012-03-22 05:46:03 +01:00
e l s e
@$( missing) collateindex.pl $< $@
e n d i f
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
{ \
2011-04-04 22:07:53 +02:00
echo " <!ENTITY version \" $( VERSION) \"> " ; \
echo " <!ENTITY majorversion \" $( MAJORVERSION) \"> " ; \
2010-06-12 17:42:44 +02:00
} > $@
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 $^ > $@
2011-02-04 04:32:49 +01:00
errcodes-table.sgml : $( top_srcdir ) /src /backend /utils /errcodes .txt generate -errcodes -table .pl
$( PERL) $( srcdir) /generate-errcodes-table.pl $< > $@
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
2011-06-19 22:27:56 +02:00
ICONV = iconv
2002-11-11 21:06:00 +01:00
LYNX = lynx
2001-03-10 17:05:35 +01:00
2014-02-11 02:48:04 +01:00
# The documentation may contain non-ASCII characters (mostly for
# contributor names), which lynx converts to the encoding determined
# by the current locale. To get text output that is deterministic and
# easily readable by everyone, we make lynx produce LATIN1 and then
# convert that to ASCII with transliteration for the non-ASCII characters.
# Official releases were historically built on FreeBSD, which has limited
2011-06-19 22:27:56 +02:00
# locale support and is very picky about locale name spelling. The
# below has been finely tuned to run on FreeBSD and Linux/glibc.
2014-02-11 02:48:04 +01:00
INSTALL : % : %.html
2011-06-19 22:27:56 +02:00
$( PERL) -p -e 's/<H(1|2)$$/<H\1 align=center/g' $< | LC_ALL = en_US.ISO8859-1 $( LYNX) -force_html -dump -nolist -stdin | $( ICONV) -f latin1 -t us-ascii//TRANSLIT > $@
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
2010-06-12 17:42:44 +02:00
$( JADE.text) -V nochunks standalone-install.sgml installation.sgml > $@
2000-07-21 02:44:13 +02:00
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
##
2014-02-12 23:29:19 +01:00
# For obscure reasons, GNU make 3.81 complains about circular dependencies
2010-05-01 23:31:17 +02:00
# if we try to do "make all" in a VPATH build without the explicit
2014-02-12 23:29:19 +01:00
# $(srcdir) on the postgres.sgml dependency in this rule. GNU make bug?
2010-05-01 23:31:17 +02:00
postgres.xml : $( srcdir ) /postgres .sgml $( ALMOSTALLSGML )
2013-10-16 04:54:36 +02:00
$( OSX) -D. -x lower -i include-xslt-index $< >postgres.xmltmp
2013-10-11 03:14:33 +02:00
$( PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
2010-05-01 20:15:07 +02:00
-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;' \
2010-06-12 17:42:44 +02:00
<postgres.xmltmp > $@
2010-05-01 20:15:07 +02:00
rm postgres.xmltmp
2006-12-10 21:46:03 +01:00
# ' hello Emacs
2004-01-13 19:45:19 +01:00
2013-11-29 04:45:08 +01:00
i f e q ( $( STYLE ) , w e b s i t e )
XSLTPROC_HTML_FLAGS += --param website.stylesheet 1
e n d i f
2012-11-13 03:42:25 +01:00
xslthtml : xslthtml -stamp
xslthtml-stamp : stylesheet .xsl postgres .xml
doc: Check DocBook XML validity during the build
Building the documentation with XSLT does not check the DTD, like a
DSSSL build would. One can often get away with having invalid XML, but
the stylesheets might then create incorrect output, as they are not
designed to handle that. Therefore, check the validity of the XML
against the DTD, using xmllint, during the build.
Add xmllint detection to configure, and add some documentation.
xmllint comes with libxml2, which is already in use, but it might be in
a separate package, such as libxml2-utils on Debian.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
2014-10-21 20:46:38 +02:00
$( XMLLINT) --noout --valid postgres.xml
2009-08-10 00:47:59 +02:00
$( XSLTPROC) $( XSLTPROCFLAGS) $( XSLTPROC_HTML_FLAGS) $^
2012-11-13 03:42:25 +01:00
cp $( srcdir) /stylesheet.css html/
touch $@
2004-01-13 19:45:19 +01:00
2004-11-23 17:27:59 +01:00
htmlhelp : stylesheet -hh .xsl postgres .xml
doc: Check DocBook XML validity during the build
Building the documentation with XSLT does not check the DTD, like a
DSSSL build would. One can often get away with having invalid XML, but
the stylesheets might then create incorrect output, as they are not
designed to handle that. Therefore, check the validity of the XML
against the DTD, using xmllint, during the build.
Add xmllint detection to configure, and add some documentation.
xmllint comes with libxml2, which is already in use, but it might be in
a separate package, such as libxml2-utils on Debian.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
2014-10-21 20:46:38 +02:00
$( XMLLINT) --noout --valid postgres.xml
2006-12-10 17:01:06 +01:00
$( XSLTPROC) $( XSLTPROCFLAGS) $^
2013-09-11 16:20:27 +02:00
%-A4.fo.tmp : stylesheet -fo .xsl %.xml
2006-12-10 21:46:03 +01:00
$( XSLTPROC) $( XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
2013-09-11 16:20:27 +02:00
%-US.fo.tmp : stylesheet -fo .xsl %.xml
2006-12-10 21:46:03 +01:00
$( XSLTPROC) $( XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
2004-11-23 17:27:59 +01:00
2013-09-11 16:20:27 +02:00
FOP = fop
# reformat FO output so that locations of errors are easier to find
%.fo : %.fo .tmp
$( XMLLINT) --format --output $@ $^
.SECONDARY : postgres -A 4.fo postgres -US .fo
%-fop.pdf : %.fo
$( FOP) -fo $< -pdf $@
2013-02-14 05:12:21 +01:00
epub : postgres .epub
postgres.epub : postgres .xml
doc: Check DocBook XML validity during the build
Building the documentation with XSLT does not check the DTD, like a
DSSSL build would. One can often get away with having invalid XML, but
the stylesheets might then create incorrect output, as they are not
designed to handle that. Therefore, check the validity of the XML
against the DTD, using xmllint, during the build.
Add xmllint detection to configure, and add some documentation.
xmllint comes with libxml2, which is already in use, but it might be in
a separate package, such as libxml2-utils on Debian.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
2014-10-21 20:46:38 +02:00
$( XMLLINT) --noout --valid $<
2013-02-14 05:12:21 +01:00
$( DBTOEPUB) $<
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
2010-06-12 17:42:44 +02:00
$( DB2X_TEXIXML) --encoding= iso-8859-1//TRANSLIT $< --to-stdout > $@
2006-12-10 02:53:15 +01:00
%.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
2013-09-11 20:34:28 +02: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
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
2015-05-07 16:26:08 +02:00
# If the install used a man directory shared with other applications, this will remove all files.
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 :
2012-04-19 21:38:14 +02:00
@( ! grep ' ' $( wildcard $( srcdir) /*.sgml $( srcdir) /ref/*.sgml $( srcdir) /*.dsl $( srcdir) /*.xsl) ) || ( echo "Tabs appear in SGML/XML files" 1>& 2; 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
2014-02-11 02:48:04 +01:00
.SECONDARY : INSTALL .html
2009-08-15 03:56:35 +02:00
.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
2014-02-11 02:48:04 +01:00
rm -f INSTALL
rm -f INSTALL.html
2010-06-12 23:40:31 +02:00
# single-page output
rm -f postgres.html postgres.txt
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
2013-09-11 16:20:27 +02:00
rm -f postgres.xml postgres.xmltmp htmlhelp.hhp toc.hhc index.hhk *.fo *.fo.tmp
2013-02-14 05:12:21 +01:00
# EPUB
rm -f postgres.epub
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