2008-05-22 14:31:02 +00:00
|
|
|
#
|
|
|
|
# PostGIS PGXS build system
|
|
|
|
#
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2010-12-15 18:29:29 +00:00
|
|
|
# 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)
|
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# Files to be copied to the contrib/ directory
|
|
|
|
DATA_built=topology.sql
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# SQL objects (files requiring C pre-processing)
|
|
|
|
SQL_OBJS=topology.sql.in
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# Extra files to remove during 'make clean'
|
|
|
|
EXTRA_CLEAN=$(SQL_OBJS)
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# PGXS information
|
2010-12-27 11:56:44 +00:00
|
|
|
PG_CONFIG = @PGCONFIG@
|
2008-11-06 15:15:06 +00:00
|
|
|
PGXS := @PGXS@
|
2008-05-22 14:31:02 +00:00
|
|
|
include $(PGXS)
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2010-12-15 18:29:29 +00:00
|
|
|
# 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
|
|
|
|
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# 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' $< >$@
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2008-05-22 14:31:02 +00:00
|
|
|
# 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 '^#' > $@
|
2005-10-13 16:21:49 +00:00
|
|
|
|
2010-12-15 13:39:52 +00:00
|
|
|
topology.sql.in: sql/sqlmm.sql sql/populate.sql
|
2010-12-15 17:11:34 +00:00
|
|
|
|
|
|
|
check: topology.sql
|
|
|
|
$(MAKE) -C test $@
|