postgis/doc/Makefile.in
2008-09-26 02:50:51 +00:00

119 lines
3.5 KiB
Makefile

#
# PostGIS documentation build Makefile
#
# Written by Mark Cave-Ayland
#
# NOTE: We don't use a standard PGXS Makefile here since the DOCS target
# only allows files to be stored within contrib/ and we currently
# store documentation under contrib/postgis due to the possibility
# that we could produce a large number of files (think chunked HTML)
#
XSLTPROC = @XSLTPROC@
XSLBASE = @XSLBASE@
XSLTPROC_COMMONOPTS = \
--param section.autolabel 1 \
--param section.label.includes.component.label 1 \
--param chunk.section.depth 0 \
--param generate.section.toc.level 1 \
--param funcsynopsis.style ansi \
--param admon.graphics 1 \
--param admon.textlabel 0 \
--param simplesect.in.toc 0 \
--param use.id.as.filename 1 \
--param chunk.quietly 1
XSLTPROC_HTMLOPTS = \
--stringparam html.stylesheet style.css \
HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
# OpenJade's db2pdf script for PDF generation from DocBook
DB2PDF = @DB2PDF@
# Directories for documentation and man pages
PGSQL_DOCDIR=@PGSQL_DOCDIR@
PGSQL_MANDIR=@PGSQL_MANDIR@
# If XSLTPROC or XSLBASE were not found during configure, we cannot
# build the documentation
ifeq ($(XSLTPROC),)
all: requirements_not_met_xsltproc
else
ifeq ($(XSLBASE),)
all: requirements_not_met_xslbase
else
all: html/postgis.html
endif
endif
postgis-out.xml: postgis.xml introduction.xml installation.xml faq.xml using_postgis.xml performance_tips.xml reference.xml reference_new.xml reporting.xml release_notes.xml ../Version.config
cat $< | sed "s/@@LAST_RELEASE_VERSION@@/@POSTGIS_LIB_VERSION@/g" > $@
chunked-html: postgis-out.xml
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
--output html/ \
--stringparam saxon.character.representation decimal \
$(CHUNK_HTML_DOCBOOK_XSL) \
$<
html/postgis.html: postgis-out.xml
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
--output html/postgis.html \
$(HTML_DOCBOOK_XSL) \
$<
postgis.pdf: postgis-out.xml
@if test x"$(DB2PDF)" = x; then \
echo "Error: db2pdf not found, can't build posgis.pdf"; \
echo " try installing docbook-utils package and then re-run configure"; \
false; \
else \
$(DB2PDF) $< && mv postgis-out.pdf postgis.pdf; \
fi
clean:
@rm -f \
postgis-out.xml \
postgis-*.pdf
maintainer-clean: clean
@rm -f html/*.html
install: html/postgis.html man/shp2pgsql.1 man/pgsql2shp.1
@mkdir -p $(PGSQL_DOCDIR)/postgis
@mkdir -p $(PGSQL_MANDIR)/man1
cp html/postgis.html $(PGSQL_DOCDIR)/postgis/postgis.html
cp ../README.postgis $(PGSQL_DOCDIR)/postgis/README.postgis
cp man/pgsql2shp.1 $(PGSQL_MANDIR)/man1/pgsql2shp.1
cp man/shp2pgsql.1 $(PGSQL_MANDIR)/man1/shp2pgsql.1
uninstall:
rm -f $(PGSQL_DOCDIR)/postgis/postgis.html
rm -f $(PGSQL_DOCDIR)/postgis/README.postgis
rm -f $(PGSQL_MANDIR)/man1/shp2pgsql.1
rm -f $(PGSQL_MANDIR)/man1/pgsql2shp.1
requirements_not_met_xsltproc:
@echo
@echo "configure was unable to find 'xsltproc' which is required to build the documentation."
@echo "To build the documentation, install xsltproc and then re-run configure. Alternatively "
@echo "refer to online manual:"
@echo
@echo " http://postgis.refractions.net/docs"
@echo
requirements_not_met_xslbase:
@echo
@echo "configure was unable to find the Docbook XSL stylesheet directory which is required to build the documentation."
@echo "To build the documentation, install the Docbook XSL stylesheets and/or re-run configure with the --with-xsldir option. Alternatively "
@echo "refer to online manual:"
@echo
@echo " http://postgis.refractions.net/docs"
@echo
.PHONY: html