source: trunk/doc/Makefile.in @ 5511

Last change on this file since 5511 was 5511, checked in by robe, 6 years ago

First draft of wktraster faq

File size: 6.4 KB
Line 
1#
2# PostGIS documentation build Makefile
3#
4# Written by Mark Cave-Ayland
5#
6# NOTE: We don't use a standard PGXS Makefile here since the DOCS target
7# only allows files to be stored within contrib/ and we currently
8# store documentation under contrib/postgis due to the possibility
9# that we could produce a large number of files (think chunked HTML)
10#
11
12POSTGIS_MAJOR_VERSION=@POSTGIS_MAJOR_VERSION@
13POSTGIS_MINOR_VERSION=@POSTGIS_MINOR_VERSION@
14POSTGIS_MICRO_VERSION=@POSTGIS_MICRO_VERSION@
15
16XSLTPROC = @XSLTPROC@
17XSLBASE = @XSLBASE@
18
19XSLTPROC_COMMONOPTS = \
20        --param section.autolabel 1 \
21        --param section.label.includes.component.label 1 \
22        --param chunk.section.depth 0 \
23        --param generate.section.toc.level 1 \
24        --param funcsynopsis.style ansi \
25        --param admon.graphics 1 \
26        --param admon.textlabel 0 \
27        --param simplesect.in.toc 0 \
28        --param use.id.as.filename 1 \
29        --param chunk.quietly 1
30
31XSLTPROC_HTMLOPTS = \
32        --stringparam html.stylesheet style.css \
33
34HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
35CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
36
37# DBLatex's dblatex script for PDF generation from DocBook
38DBLATEX = @DBLATEX@
39
40# Imagemagick's convert utility program for generated images used in the documentation
41IMAGEMAGICK = @IMAGEMAGICK@
42
43# Directories for postgresql subdirectories
44PGSQL_DOCDIR=@PGSQL_DOCDIR@
45PGSQL_MANDIR=@PGSQL_MANDIR@
46PGSQL_SHAREDIR=@PGSQL_SHAREDIR@
47
48# If XSLTPROC or XSLBASE were not found during configure, we cannot
49# build the documentation
50ifeq ($(XSLTPROC),)
51all: requirements_not_met_xsltproc
52else
53ifeq ($(XSLBASE),)
54all: requirements_not_met_xslbase
55else
56ifeq ($(IMAGEMAGICK),)
57all: requirements_not_met_imagemagick
58else
59all: images html/postgis.html postgis_comments.sql
60endif
61endif
62endif
63
64postgis_aggs_mm.xml: ./xsl/postgis_aggs_mm.xml.xsl postgis.xml
65        $(XSLTPROC) ./xsl/postgis_aggs_mm.xml.xsl postgis.xml > $@
66
67postgis_comments.sql: ./xsl/postgis_comments.sql.xsl postgis.xml postgis_aggs_mm.xml
68        $(XSLTPROC) ./xsl/postgis_comments.sql.xsl postgis.xml > $@
69
70postgis-out.xml: postgis.xml introduction.xml installation.xml faq.xml using_postgis_dataman.xml  using_postgis_app.xml performance_tips.xml reference.xml reference_management.xml reference_constructor.xml reference_accessor.xml reference_editor.xml reference_output.xml reference_operator.xml reference_measure.xml reference_processing.xml reference_lrs.xml reference_transaction.xml reference_misc.xml reference_exception.xml postgis_aggs_mm.xml reference_wktraster.xml faq_wktraster.xml reporting.xml release_notes.xml ../Version.config
71        cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@
72
73chunked-html: postgis-out.xml images
74        $(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
75                --output html/ \
76                --stringparam saxon.character.representation decimal \
77                $(CHUNK_HTML_DOCBOOK_XSL) \
78                $<
79
80html/postgis.html: postgis-out.xml images
81        $(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
82                --output html/postgis.html \
83                $(HTML_DOCBOOK_XSL) \
84                $<
85
86
87postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf: postgis-out.xml images
88        @if test x"$(DBLATEX)" = x; then \
89           echo "Error: dblatex not found, can't build pdf"; \
90           echo "       try installing dblatex and then re-run configure"; \
91           false; \
92        else \
93                dblatex -T native -t pdf \
94                   -I "${PWD}/html" \
95                   -P doc.collab.show=0 \
96                   -P figure.note="${PWD}/html/images/note" \
97                   -P figure.tip="${PWD}/html/images/tip" \
98                   -P figure.important="${PWD}/html/images/important" \
99                   -P figure.warning="${PWD}/html/images/warning" \
100                   -P figure.caution="${PWD}/html/images/caution" \
101                   -P latex.output.revhistory=0 \
102                   -o postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf $<; \
103        fi
104
105pdf: postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
106
107doxygen.cfg: doxygen.cfg.in
108        cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@
109
110doxygen: doxygen.cfg
111        doxygen $<
112
113images:
114        make -C html/image_src images
115       
116clean:
117        make -C html/image_src clean
118        @rm -f postgis-out.xml postgis_aggs_mm.xml
119
120maintainer-clean: clean
121        make -C html/image_src clean
122        @rm -f html/*.html \
123                postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
124
125comments: postgis_comments.sql
126
127comments-install: comments
128        cp postgis_comments.sql $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
129
130comments-uninstall:
131        rm -f $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
132
133install: html/postgis.html man/shp2pgsql.1 man/pgsql2shp.1
134        @mkdir -p $(PGSQL_DOCDIR)/postgis
135        @mkdir -p $(PGSQL_MANDIR)/man1
136        cp html/postgis.html $(PGSQL_DOCDIR)/postgis/postgis.html
137        cp ../README.postgis $(PGSQL_DOCDIR)/postgis/README.postgis
138        cp man/pgsql2shp.1 $(PGSQL_MANDIR)/man1/pgsql2shp.1
139        cp man/shp2pgsql.1 $(PGSQL_MANDIR)/man1/shp2pgsql.1
140
141uninstall:
142        rm -f $(PGSQL_DOCDIR)/postgis/postgis.html
143        rm -f $(PGSQL_DOCDIR)/postgis/README.postgis
144        rm -f $(PGSQL_MANDIR)/man1/shp2pgsql.1
145        rm -f $(PGSQL_MANDIR)/man1/pgsql2shp.1
146
147ifeq ($(XSLTPROC),)
148garden: requirements_not_met_xsltproc
149else
150garden: postgis_aggs_mm.xml
151        $(XSLTPROC) -o gardentest.sql xsl/postgis_gardentest.sql.xsl postgis.xml
152endif
153
154
155
156ifeq ($(XSLTPROC),)
157check: requirements_not_met_xsltproc
158else
159check:  postgis_aggs_mm.xml
160        xmllint --loaddtd --xinclude --valid postgis.xml > /dev/null
161endif
162
163
164requirements_not_met_xsltproc:
165        @echo
166        @echo "configure was unable to find 'xsltproc' which is required to build the documentation."
167        @echo "To build the documentation, install xsltproc and then re-run configure. Alternatively "
168        @echo "refer to online manual:"
169        @echo
170        @echo "  http://postgis.refractions.net/docs"
171        @echo
172
173requirements_not_met_xslbase:
174        @echo
175        @echo "configure was unable to find the Docbook XSL stylesheet directory which is required to build the documentation."
176        @echo "To build the documentation, install the Docbook XSL stylesheets and/or re-run configure with the --with-xsldir option. Alternatively "
177        @echo "refer to online manual:"
178        @echo
179        @echo "  http://postgis.refractions.net/docs"
180        @echo
181
182requirements_not_met_imagemagick:
183        @echo
184        @echo "configure was unable to find the ImageMagick's 'convert' utility program."
185        @echo "To build the documentation, install ImageMagick and then re-run configure. Alternatively "
186        @echo "refer to online manual:"
187        @echo
188        @echo "  http://postgis.refractions.net/docs"
189        @echo
190       
191.PHONY: html
192
Note: See TracBrowser for help on using the repository browser.