File: Makefile.in

package info (click to toggle)
postgis 2.1.4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 35,424 kB
  • ctags: 8,886
  • sloc: sql: 113,491; ansic: 97,254; xml: 41,127; sh: 11,925; java: 5,662; perl: 3,113; makefile: 2,265; python: 1,198; yacc: 438; lex: 114
file content (123 lines) | stat: -rw-r--r-- 4,892 bytes parent folder | download
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
#############################################################################
# $Id: Makefile.in 12594 2014-05-29 07:53:37Z strk $
#
# Copyright (c) 2009-2011 Sandro Santilli <strk@keybit.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
#############################################################################

POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@

MODULE_big=rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
MODULEDIR=contrib/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@

# Files to be copied to the contrib/ directory
DATA_built=rtpostgis.sql rtpostgis_upgrade_20_21.sql rtpostgis_upgrade_21_minor.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
DATA=

# SQL preprocessor
SQLPP = @SQLPP@

# SQL objects (files requiring pre-processing)
SQL_OBJS=rtpostgis.sql rtpostgis_drop.sql rtpostgis_upgrade_cleanup.sql rtpostgis_legacy.sql

# Objects to build using PGXS
OBJS=rt_pg.o

# Libraries to link into the module (proj, geos)
LIBLWGEOM_LDFLAGS=-L../../liblwgeom/.libs -llwgeom
LIBLWGEOM_CFLAGS="-I../../liblwgeom"
LIBPGCOMMON_CFLAGS="-I../../libpgcommon"
LIBPGCOMMON_LDFLAGS=../../libpgcommon/libpgcommon.a
LIBGDAL_CFLAGS=@LIBGDAL_CFLAGS@
LIBGDAL_LDFLAGS=@LIBGDAL_LDFLAGS@
LIBPROJ_CFLAGS=@PROJ_CPPFLAGS@

PG_CPPFLAGS+=@CPPFLAGS@ $(LIBLWGEOM_CFLAGS) $(LIBGDAL_CFLAGS) $(LIBPGCOMMON_CFLAGS) $(LIBPROJ_CFLAGS) -I../rt_core
SHLIB_LINK_F = ../rt_core/librtcore.a $(LIBLWGEOM_LDFLAGS) $(LIBPGCOMMON_LDFLAGS) $(LIBGDAL_LDFLAGS) @SHLIB_LINK@ 

# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS) $(DATA_built) rtpostgis_upgrade.sql

# PGXS information
PG_CONFIG = @PG_CONFIG@ 
PGXS := @PGXS@
include $(PGXS)

# Set PERL _after_ the include of PGXS
PERL=@PERL@

# This is to workaround a bug in PGXS 8.4 win32 link line,
# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)

# 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

# If REGRESS=1 passed as a parameter, change the default install paths
# so that no prefix is included. This allows us to relocate to a temporary
# directory for regression testing.
ifeq ($(REGRESS),1)
        bindir=/bin
        pkglibdir=/lib
        datadir=/share
        datamoduledir=contrib/postgis
endif

# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
# and adding the version number
%.sql: %.sql.in
	$(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' | \
	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@


# Objects dependencies
$(OBJS): ../../liblwgeom/.libs/liblwgeom.a ../../libpgcommon/libpgcommon.a ../../postgis_config.h ../../postgis_svn_revision.h

# Generate any .sql.in files from .sql.in.c files by running them through the SQL pre-processor 
#$(SQL_OBJS): %.in: %.in.c
#	$(SQLPP) -I../../postgis/ -I../../ $< | grep -v '^#' > $@

# SQL objects deps here
$(SQL_OBJS): ../../postgis/sqldefines.h ../../postgis_svn_revision.h

#remove all create object types since these can't be done cleanly in an upgrade
rtpostgis_upgrade.sql: rtpostgis.sql ../../utils/postgis_proc_upgrade.pl
	$(PERL) ../../utils/postgis_proc_upgrade.pl $< 2.0 > $@
	#$(PERL) -0777 -ne 's/^(CREATE|ALTER) (CAST|OPERATOR|TYPE|TABLE|SCHEMA|DOMAIN|TRIGGER).*?;//msg;print;' $< > $@

rtpostgis_upgrade_20_21.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_upgrade.sql rtpostgis_drop.sql 
	echo 'BEGIN;' > $@
	cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@
	echo 'COMMIT;' >> $@

rtpostgis_upgrade_21_minor.sql: rtpostgis.sql ../../utils/postgis_proc_upgrade.pl
	$(PERL) ../../utils/postgis_proc_upgrade.pl rtpostgis.sql 2.1 > $@

uninstall_rtpostgis.sql: rtpostgis.sql ../../utils/create_undef.pl 
	$(PERL) ../../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@

distclean: clean
	rm -f Makefile