postgis/topology/Makefile.in
Sandro Santilli f5bd1c82a6 Detect PERL locally
git-svn-id: http://svn.osgeo.org/postgis/trunk@8840 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-16 13:56:11 +00:00

82 lines
3.1 KiB
Makefile

# **********************************************************************
# * $Id$
# *
# * PostGIS - Spatial Types for PostgreSQL
# * http://postgis.refractions.net
# *
# * Copyright (C) 2010-2011 Sandro Santilli <strk@keybit.net>
# * Copyright (C) 2008 Mark Cave-Ayland
# * Copyright (C) 2005 Refractions Research Inc.
# *
# * 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 PGXS build system
#
POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
# NOTE: we can't use MODULE_big or PGXS insists in building a library...
PGIS_MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
MODULEDIR=contrib/$(PGIS_MODULE_big)
# Files to be copied to the contrib/ directory
DATA_built=topology.sql topology_upgrade_20_minor.sql uninstall_topology.sql
# SQL objects (files requiring C pre-processing)
SQL_OBJS=topology.sql.in topology_drop_before.sql.in topology_drop_after.sql.in
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS)
# PGXS information
PG_CONFIG = @PGCONFIG@
PGXS := @PGXS@
include $(PGXS)
# Set PERL _after_ the include of PGXS
PERL=@PERL@
# PGXS override feature. The ability to allow PostGIS to install itself
# in a versioned directory is only available in PostgreSQL >= 8.5. To
# do this by default on older PostgreSQL versions, we need to override
# the existing PGXS targets.
#
# Once PostgreSQL 8.5 becomes the minimum supported version, this entire
# section and its associated Makefile.pgxs should be removed.
PGXSOVERRIDE = @PGXSOVERRIDE@
ifeq ($(PGXSOVERRIDE),1)
include ../postgis/Makefile.pgxs
endif
# Unfortunately we have to copy this from the PGXS Makefile as it only gets picked up
# if MODULE_big is defined
%.sql: %.sql.in
sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@
# Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor
$(SQL_OBJS): %.in: %.in.c
$(CPP) -traditional-cpp $< | grep -v '^#' > $@
#Generate upgrade script by stripping things that can't be reinstalled
#e.g. don't bother with tables, types, triggers, and domains
topology_upgrade.sql: topology.sql
sed -e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\).*;/d' \
-e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\)/,/\;/d' \
$< > $@
topology_upgrade_20_minor.sql: topology_drop_before.sql topology_upgrade.sql topology_drop_after.sql
cat $^ > $@
topology.sql.in: sql/sqlmm.sql.in.c sql/populate.sql.in.c sql/polygonize.sql.in.c sql/gml.sql.in.c sql/query/getnodebypoint.sql.in.c sql/query/getedgebypoint.sql.in.c sql/query/getfacebypoint.sql.in.c sql/query/GetRingEdges.sql.in.c sql/manage/TopologySummary.sql.in.c sql/manage/CopyTopology.sql.in.c sql/manage/ManageHelper.sql.in.c sql/topoelement/topoelement_agg.sql.in.c sql/topogeometry/type.sql.in.c sql/topogeometry/totopogeom.sql.in.c sql/predicates.sql.in.c
uninstall_topology.sql: topology.sql ../utils/create_undef.pl
$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
check: topology.sql
$(MAKE) -C test $@