postgis/raster/rt_pg/Makefile.in

71 lines
2.4 KiB
Makefile
Raw Normal View History

#############################################################################
# $Id$
#
# Copyright (c) 2009 Sandro Santilli <strk@keybit.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.
#
#############################################################################
MODULE_big=rtpostgis-@POSTGIS_RASTER_MAJOR_VERSION@.@POSTGIS_RASTER_MINOR_VERSION@
MODULEDIR=contrib/$(MODULE_big)
# Files to be copied to the contrib/ directory
DATA_built=rtpostgis.sql
DATA=
# SQL objects (files requiring C pre-processing)
SQL_OBJS=rtpostgis.sql.in
# Objects to build using PGXS
OBJS=rt_pg.o
# Libraries to link into the module (proj, geos)
#
# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
# -L... -l options to prevent issues with some platforms trying to link
# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
# older version of PostGIS, rather than with the static liblwgeom.a
# supplied with newer versions of PostGIS
#
LIBLWGEOM_LDFLAGS=@LIBLWGEOM_LDFLAGS@
LIBLWGEOM_CFLAGS=@LIBLWGEOM_CFLAGS@
LIBGDAL_CFLAGS=@LIBGDAL_CFLAGS@
LIBGDAL_LDFLAGS=@LIBGDAL_LDFLAGS@
PG_CPPFLAGS+=@CPPFLAGS@ @POSTGIS_RASTER_PG_DEBUG_CFLAGS@ $(LIBLWGEOM_CFLAGS) $(LIBGDAL_CFLAGS) -I../rt_core
SHLIB_LINK+=@SHLIB_LINK@ ../rt_core/librtcore.a $(LIBLWGEOM_LDFLAGS) $(LIBGDAL_LDFLAGS)
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS) rtpostgis.sql
# PGXS information
PG_CONFIG = @PGCONFIG@
PGXS := @PGXS@
include $(PGXS)
# 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 Makefile.pgxs
endif
# Borrow the $libdir substitution from PGXS but customise by adding the version number
%.sql: %.sql.in
sed 's,MODULE_PATHNAME,$$libdir/rtpostgis-@POSTGIS_RASTER_MAJOR_VERSION@.@POSTGIS_RASTER_MINOR_VERSION@,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 '^#' > $@
distclean: clean
$(RM) Makefile