1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
|
#
# PostGIS - Spatial Types for PostgreSQL
# http://www.postgis.net
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU General Public Licence. See the COPYING file.
#
# PostGIS documentation build Makefile
#
# Copyright 2003-2012 Sandro Santilli <strk@kbt.io>
# Copyright 2004-2012 Paul Ramsey <pramsey@cleverelephant.ca>
# Copyright 2009-2011 Regina Obe <lr@pcorp.us>
# Copyright 2008-2010 Mark Cave-Ayland
# Copyright 2008-2010 Kevin Neufeld <kneufeld.ca@gmail.com>
# Copyright 2009-2010 Olivier Courtin <olivier.courtin@camptocamp.com>
# Copyright 2005-2006 Markus Schaber <markus@schabi.de>
#
# 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)
#
translations = it_IT pt_BR fr es pl ko_KR de_DE ja
POSTGIS_MAJOR_VERSION=@POSTGIS_MAJOR_VERSION@
POSTGIS_MINOR_VERSION=@POSTGIS_MINOR_VERSION@
POSTGIS_MICRO_VERSION=@POSTGIS_MICRO_VERSION@
ifneq (,$(findstring dev,$(POSTGIS_MICRO_VERSION)))
POSTGIS_DOWNLOAD_URL=http://postgis.net/stuff
else
POSTGIS_DOWNLOAD_URL=http://download.osgeo.org/postgis/source
endif
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
XSLTPROC=@XSLTPROC@
XSLBASE=@XSLBASE@
XMLLINT=@XMLLINT@
CAN_BUILD_COMMENTS=@CAN_BUILD_COMMENTS@
PERL=@PERL@
# To allow network access use:
#
# $(MAKE) html XSLTPROCFLAGS=
#
ifeq ($(XSLTPROCFLAGS),)
XSLTPROCFLAGS=--nonet
endif
XSLTPROC_COMMONOPTS= \
--param section.autolabel 1 \
--param section.label.includes.component.label 1 \
--param chunk.section.depth 0 \
--param generate.section.toc.level 2 \
--param funcsynopsis.style kr \
--param admon.graphics 1 \
--param admon.textlabel 0 \
--param make.clean.html 1 \
--param simplesect.in.toc 0 \
--param use.id.as.filename 1 \
--param chunk.quietly 1 \
--param header.rule 0 \
--param footer.rule 0 \
--param table.borders.with.css 1 \
--stringparam chunker.output.encoding UTF-8 \
--stringparam chunker.output.indent no \
--stringparam saxon.character.representation decimal \
--stringparam html.stylesheet style.css \
$(XSLTPROCFLAGS)
HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
# DBLatex's dblatex script for PDF generation from DocBook
DBLATEX=@DBLATEX@
# Imagemagick's convert utility program for generated images used in the documentation
IMAGEMAGICK=@IMAGEMAGICK@
# Gettext for translated documentation
MSGMERGE=msgmerge
# XML gettext tools
XML2POT=xml2pot
# DOCBOOK to EPUB
DBTOEPUB=dbtoepub
# Directories for postgresql subdirectories
PGSQL_DOCDIR=@PGSQL_DOCDIR@
PGSQL_MANDIR=@PGSQL_MANDIR@
PGSQL_SHAREDIR=@PGSQL_SHAREDIR@
BUILD_TARGET =
ifeq ($(CAN_BUILD_COMMENTS),yes)
BUILD_TARGET += comments
endif
ifeq ($(CAN_BUILD_PDF),yes)
BUILD_TARGET += pdf
endif
# TODO: add "html" to the BUILD_TARGET if it can be built
all: $(BUILD_TARGET)
XML_SOURCES = \
extras_address_standardizer.xml \
extras_historytable.xml \
extras_tigergeocoder.xml \
extras_topology.xml \
extras.xml \
faq_raster.xml \
faq.xml \
installation.xml \
introduction.xml \
performance_tips.xml \
postgis.xml \
reference_accessor.xml \
reference_constructor.xml \
reference_editor.xml \
reference_exception.xml \
reference_guc.xml \
reference_lrs.xml \
reference_management.xml \
reference_measure.xml \
reference_sfcgal.xml \
reference_misc.xml \
reference_operator.xml \
reference_output.xml \
reference_processing.xml \
reference_raster.xml \
reference_temporal.xml \
reference_transaction.xml \
reference_type.xml \
reference.xml \
release_notes.xml \
reporting.xml \
using_postgis_app.xml \
using_postgis_dataman.xml \
using_raster_dataman.xml
XML_GENERATED_SOURCES = \
postgis_aggs_mm.xml \
postgis-out.xml \
XML_INPUTS = $(XML_SOURCES) $(XML_GENERATED_SOURCES)
XML_INPUTS_POT = $(XML_SOURCES:%.xml=po/templates/%.xml.pot)
.PHONY: $(XML_INPUTS_POT)
$(XML_INPUTS_POT): po/templates/%.xml.pot: %.xml
@if test -f $@; then \
$(XML2POT) $< > $@.tmp; \
changed=`diff $@.tmp $@ | grep -v '^[<>] "POT-Creation-Date:' | wc -l`; \
if expr $${changed} \> 3 >/dev/null; then \
echo "$@ updated"; \
mv $@.tmp $@; \
else \
echo "$@ unchanged"; \
rm $@.tmp; \
fi; \
else \
$(XML2POT) $< > $@; \
fi;
# Update translation templates
update-pot: $(XML_INPUTS_POT)
# Creates or updates translation files
update-po: $(XML_INPUTS_POT)
@for lang in $(translations); do \
echo "Creating po files for language $$lang..." ; \
for pot in $(XML_INPUTS_POT); do \
mkdir -p po/$$lang; \
po=po/$$lang/`basename $$pot .pot`.po; \
if test -f $$po; then \
$(MSGMERGE) --update $$po $$pot; \
else \
cp $$pot $$po; \
fi; \
done; \
done
pull-tx:
tx pull --all
$(MAKE) update-po
push-tx:
tx push -s -t --skip
# Register transifex resources, run when adding a new .xml file
update-tx:
for f in $(XML_INPUTS_POT); do \
f=`basename $${f} .pot`; \
res=`echo "$${f}" | sed 's/\.//g'`pot; \
tx set --auto-local -r postgis.$${res} "po/<lang>/$${f}.po" \
--source-lang en --source-file "po/templates/$${f}.pot" \
--execute; \
done
ifeq ($(XSLTPROC),)
postgis_aggs_mm.xml: requirements_not_met_xsltproc
else
postgis_aggs_mm.xml: ./xsl/postgis_aggs_mm.xml.xsl Makefile postgis-out.xml $(XML_SOURCES)
$(XSLTPROC) --novalid ./xsl/postgis_aggs_mm.xml.xsl postgis-out.xml > $@
endif
postgis_comments.sql: ./xsl/postgis_comments.sql.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/postgis_comments.sql.xsl postgis-out.xml > $@
postgis_cheatsheet.html: ./xsl/postgis_cheatsheet.html.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/postgis_cheatsheet.html.xsl postgis-out.xml > $@
raster_comments.sql: ./xsl/raster_comments.sql.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/raster_comments.sql.xsl postgis-out.xml > $@
raster_cheatsheet.html: ./xsl/raster_cheatsheet.html.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/raster_cheatsheet.html.xsl postgis-out.xml > $@
topology_comments.sql: ./xsl/topology_comments.sql.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/topology_comments.sql.xsl postgis-out.xml > $@
topology_cheatsheet.html: ./xsl/topology_cheatsheet.html.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/topology_cheatsheet.html.xsl postgis-out.xml > $@
sfcgal_comments.sql: ./xsl/sfcgal_comments.sql.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/sfcgal_comments.sql.xsl postgis-out.xml > $@
sfcgal_cheatsheet.html: ./xsl/sfcgal_cheatsheet.html.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/sfcgal_cheatsheet.html.xsl postgis-out.xml > $@
tiger_geocoder_comments.sql: ./xsl/tiger_geocoder_comments.sql.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/tiger_geocoder_comments.sql.xsl postgis-out.xml > $@
tiger_geocoder_cheatsheet.html: ./xsl/tiger_geocoder_cheatsheet.html.xsl $(XML_INPUTS)
$(XSLTPROC) --novalid ./xsl/tiger_geocoder_cheatsheet.html.xsl postgis-out.xml > $@
postgis-out.xml: postgis.xml Makefile
$(PERL) -lpe "s'@@LAST_RELEASE_VERSION@@'${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}'g;s'@@POSTGIS_DOWNLOAD_URL@@'${POSTGIS_DOWNLOAD_URL}'g;" $< > $@
chunked-html: postgis-out.xml Makefile images $(XML_INPUTS)
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
--output html/ \
$(CHUNK_HTML_DOCBOOK_XSL) \
$<
chunked-html-web: postgis-out.xml Makefile images $(XML_INPUTS)
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
--output html/ \
--stringparam html.script ga.js \
$(CHUNK_HTML_DOCBOOK_XSL) \
$<
html: html/postgis$(DOCSUFFIX).html
html-localized:
@for lang in $(translations); do \
echo "Creating html for language $$lang..."; \
$(MAKE) -C po/$$lang local-html; \
done
html/postgis$(DOCSUFFIX).html: postgis-out.xml Makefile images $(XML_INPUTS)
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
--output html/postgis$(DOCSUFFIX).html \
$(HTML_DOCBOOK_XSL) \
$<
postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).pdf: postgis-out.xml images $(XML_INPUTS)
if test x"$(DBLATEX)" = x; then \
echo "Error: dblatex not found, can't build pdf"; \
echo " try installing dblatex and then re-run configure"; \
false; \
else \
$(DBLATEX) -T native -t pdf \
-I "${PWD}/html" \
-P doc.collab.show=0 \
-P figure.note="${PWD}/html/images/note" \
-P figure.tip="${PWD}/html/images/tip" \
-P figure.important="${PWD}/html/images/important" \
-P figure.warning="${PWD}/html/images/warning" \
-P figure.caution="${PWD}/html/images/caution" \
-P latex.output.revhistory=0 \
-s "${PWD}/texstyle.sty" \
-o postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).pdf $<; \
fi
postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).epub: postgis-out.xml images $(XML_INPUTS)
if test x"$(DBTOEPUB)" = x; then \
echo "Error: dbtoepub not found, can't build epub"; \
echo " try installing dbtoepub"; \
false; \
else \
$(DBTOEPUB) -c "${PWD}/html/style.css" \
-o postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).epub \
$<; \
fi
epub: postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).epub
pdf: postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}$(DOCSUFFIX).pdf
pdf-localized:
@for lang in $(translations); do \
echo "Creating pdf for language $$lang..."; \
$(MAKE) -C po/$$lang local-pdf; \
done
doxygen.cfg: doxygen.cfg.in
$(PERL) -lpe "s'@@LAST_RELEASE_VERSION@@'${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}'g" $< > $@
doxygen: doxygen.cfg
doxygen $<
images:
$(MAKE) -C html/image_src images
images-clean:
$(MAKE) -C html/image_src images-clean
clean:
rm -f html/*.html
rm -f postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
rm -f *.epub
$(MAKE) -C html/image_src clean
rm -f $(XML_GENERATED_SOURCES)
rm -f postgis_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql
rm -f raster_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql
distclean: clean
$(MAKE) -C html/image_src distclean
rm -f Makefile Makefile.comments html/image_src/Makefile
maintainer-clean: clean images-clean
rm -f postgis_comments.sql raster_comments.sql topology_comments.sql tiger_geocoder_comments.sql sfcgal_comments.sql
ifneq ($(CAN_BUILD_COMMENTS),yes)
comments:
else
comments: postgis_comments.sql raster_comments.sql topology_comments.sql sfcgal_comments.sql tiger_geocoder_comments.sql
endif
cheatsheets: postgis_cheatsheet.html raster_cheatsheet.html topology_cheatsheet.html sfcgal_cheatsheet.html tiger_geocoder_cheatsheet.html
ifneq ($(CAN_BUILD_COMMENTS),yes)
comments-install:
if test -e postgis_comments.sql -a \
-e raster_comments.sql -a \
-e topology_comments.sql -a \
-e sfcgal_comments.sql -a \
-e tiger_geocoder_comments.sql; then \
$(MAKE) -f Makefile.comments install; \
fi
else
comments-install: comments
$(MAKE) -f Makefile.comments install
endif
comments-uninstall:
$(MAKE) -f Makefile.comments uninstall
man-install: man/shp2pgsql.1 man/pgsql2shp.1
mkdir -p $(DESTDIR)$(PGSQL_MANDIR)/man1
$(INSTALL_DATA) man/pgsql2shp.1 $(DESTDIR)$(PGSQL_MANDIR)/man1/pgsql2shp.1
$(INSTALL_DATA) man/shp2pgsql.1 $(DESTDIR)$(PGSQL_MANDIR)/man1/shp2pgsql.1
man-uninstall:
rm -f $(DESTDIR)$(PGSQL_MANDIR)/man1/shp2pgsql.1
rm -f $(DESTDIR)$(PGSQL_MANDIR)/man1/pgsql2shp.1
docs-install: html/postgis.html html/style.css
mkdir -p $(DESTDIR)$(PGSQL_DOCDIR)/postgis/images
$(INSTALL_DATA) html/postgis.html $(DESTDIR)$(PGSQL_DOCDIR)/postgis/
$(INSTALL_DATA) html/style.css $(DESTDIR)$(PGSQL_DOCDIR)/postgis/
$(INSTALL_DATA) html/images/* $(DESTDIR)$(PGSQL_DOCDIR)/postgis/images/
$(INSTALL_DATA) ../README.postgis $(DESTDIR)$(PGSQL_DOCDIR)/postgis/README.postgis
docs-uninstall:
rm -f $(DESTDIR)$(PGSQL_DOCDIR)/postgis/postgis.html
rm -f $(DESTDIR)$(PGSQL_DOCDIR)/postgis/style.css
rm -rf $(DESTDIR)$(PGSQL_DOCDIR)/postgis/images
rm -f $(DESTDIR)$(PGSQL_DOCDIR)/postgis/README.postgis
install: comments-install
uninstall: comments-uninstall
ifeq ($(XSLTPROC),)
garden: requirements_not_met_xsltproc
else
garden: xsl/postgis_gardentest.sql.xsl $(XML_INPUTS)
$(XSLTPROC) -o postgis_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql xsl/postgis_gardentest.sql.xsl postgis-out.xml
$(XSLTPROC) -o raster_gardentest_${POSTGIS_MAJOR_VERSION}${POSTGIS_MINOR_VERSION}.sql xsl/raster_gardentest.sql.xsl postgis-out.xml
endif
ifeq ($(XMLLINT),)
check: requirements_not_met_xmllint
else
check: $(XML_INPUTS)
$(XMLLINT) --loaddtd --xinclude --valid postgis-out.xml > /dev/null
endif
check-localized:
@for lang in $(translations); do \
echo "Creating html for language $$lang..."; \
$(MAKE) -C po/$$lang local-check; \
done
requirements_not_met_xsltproc:
@echo
@echo "configure was unable to find 'xsltproc' which is required"
@echo "to build the documentation."
@echo "Install xsltproc and then re-run configure. Alternatively "
@echo "refer to online manual:"
@echo
@echo " http://postgis.net/documentation"
@echo
requirements_not_met_xmllint:
@echo
@echo "configure was unable to find 'xmllint' which is required"
@echo "to test the documentation."
@echo "Install xmllint and then re-run configure. Alternatively "
@echo "refer to online manual:"
@echo
@echo " http://postgis.net/documentation"
@echo
requirements_not_met_xslbase:
@echo
@echo "configure was unable to find the Docbook XSL stylesheet directory"
@echo "which is required to build the documentation."
@echo "Install the Docbook XSL stylesheets and/or re-run configure "
@echo "with the --with-xsldir option."
@echo "Alternatively refer to online manual:"
@echo
@echo " http://postgis.net/documentation"
@echo
requirements_not_met_imagemagick:
@echo
@echo "configure was unable to find the ImageMagick's 'convert' utility program."
@echo "To build the documentation, install ImageMagick and then re-run configure. Alternatively "
@echo "refer to online manual:"
@echo
@echo " http://postgis.net/documentation"
@echo
|