source: trunk/postgis/Makefile.in

Last change on this file was 15041, checked in by robe, 3 weeks ago

schema qualify function and operator calls in geometry and geography functions

Closes #3496
Closes #3494
Closes #3486
Closes #3076

  • Property svn:eol-style set to native
File size: 7.4 KB
Line 
1# **********************************************************************
2# *
3# * PostGIS - Spatial Types for PostgreSQL
4# * http://postgis.net
5# *
6# * PostGIS is free software: you can redistribute it and/or modify
7# * it under the terms of the GNU General Public License as published by
8# * the Free Software Foundation, either version 2 of the License, or
9# * (at your option) any later version.
10# *
11# * PostGIS is distributed in the hope that it will be useful,
12# * but WITHOUT ANY WARRANTY; without even the implied warranty of
13# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# * GNU General Public License for more details.
15# *
16# * You should have received a copy of the GNU General Public License
17# * along with PostGIS.  If not, see <http://www.gnu.org/licenses/>.
18# *
19# **********************************************************************
20# *
21# * Copyright 2008 Mark Cave-Ayland
22# *
23# **********************************************************************
24
25POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
26MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
27MODULEDIR=contrib/$(MODULE_big)
28
29# Files to be copied to the contrib/ directory
30SQL_built=postgis.sql postgis_for_extension.sql uninstall_postgis.sql postgis_upgrade.sql postgis_upgrade_for_extension.sql postgis_proc_set_search_path.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql
31DATA=../spatial_ref_sys.sql
32
33# SQL objects (files requiring pre-processing)
34SQL_objs=postgis.sql postgis_for_extension.sql legacy.sql legacy_minimal.sql
35
36GEOM_BACKEND_OBJ = lwgeom_geos.o
37SFCGAL_BACKEND_OBJ = lwgeom_sfcgal.o
38
39ifeq (@SFCGAL@,sfcgal)
40DATA_built=$(SQL_built) sfcgal.sql sfcgal_upgrade.sql uninstall_sfcgal.sql
41SQL_OBJS=$(SQL_objs) sfcgal.sql
42BACKEND_OBJ=$(GEOM_BACKEND_OBJ) $(SFCGAL_BACKEND_OBJ)
43else
44BACKEND_OBJ=$(GEOM_BACKEND_OBJ)
45DATA_built=$(SQL_built)
46SQL_OBJS=$(SQL_objs)
47endif
48
49ifeq (@HAVE_BRIN@,yes)
50BRIN_OBJ= brin_2d.o brin_nd.o brin_common.o
51endif
52
53
54# SQL preprocessor
55SQLPP = @SQLPP@
56
57# PostgreSQL objects
58PG_OBJS= \
59        postgis_module.o \
60        lwgeom_accum.o \
61        lwgeom_spheroid.o \
62        lwgeom_ogc.o \
63        lwgeom_functions_analytic.o \
64        lwgeom_inout.o \
65        lwgeom_functions_basic.o \
66        lwgeom_btree.o \
67        lwgeom_box.o \
68        lwgeom_box3d.o \
69        $(BACKEND_OBJ) \
70        lwgeom_backend_api.o \
71        lwgeom_geos_prepared.o \
72        lwgeom_geos_clean.o \
73        lwgeom_geos_relatematch.o \
74        lwgeom_export.o \
75        lwgeom_in_gml.o \
76        lwgeom_in_kml.o \
77        lwgeom_in_geohash.o \
78        lwgeom_in_geojson.o \
79        lwgeom_in_encoded_polyline.o \
80        lwgeom_triggers.o \
81        lwgeom_dump.o \
82        lwgeom_dumppoints.o \
83        lwgeom_functions_lrs.o \
84        lwgeom_functions_temporal.o \
85        long_xact.o \
86        lwgeom_sqlmm.o \
87        lwgeom_rtree.o \
88        lwgeom_transform.o \
89        lwgeom_window.o \
90        gserialized_typmod.o \
91        gserialized_gist_2d.o \
92        gserialized_gist_nd.o \
93        $(BRIN_OBJ) \
94        gserialized_estimate.o \
95        geography_inout.o \
96        geography_btree.o \
97        geography_measurement.o \
98        geography_measurement_trees.o \
99        geometry_inout.o
100
101# Objects to build using PGXS
102OBJS=$(PG_OBJS)
103
104# Libraries to link into the module (proj, geos)
105#
106# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
107# -L... -l options to prevent issues with some platforms trying to link
108# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
109# older version of PostGIS, rather than with the static liblwgeom.a
110# supplied with newer versions of PostGIS
111PG_CPPFLAGS += -I../liblwgeom -I../libpgcommon @CPPFLAGS@ -fPIC
112SHLIB_LINK_F = ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
113
114# Add SFCGAL Flags if defined
115ifeq (@SFCGAL@,sfcgal)
116PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
117SHLIB_LINK_F += @SFCGAL_LDFLAGS@
118endif
119
120# Extra files to remove during 'make clean'
121EXTRA_CLEAN=$(SQL_OBJS) \
122        uninstall_postgis.sql \
123        uninstall_legacy.sql \
124        uninstall_sfcgal.sql \
125        postgis_upgrade.sql.in \
126        postgis_upgrade.sql \
127        sfcgal_upgrade.sql.in \
128        sfcgal_upgrade.sql
129
130# PGXS information
131PG_CONFIG = @PG_CONFIG@
132PGXS := @PGXS@
133# NO_TEMP_INSTALL is a workaround for a 9.5dev bug. See:
134# http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
135NO_TEMP_INSTALL=yes
136include $(PGXS)
137
138# Set PERL _after_ the include of PGXS
139PERL=@PERL@
140
141# This is to workaround a bug in PGXS 8.4 win32 link line,
142# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
143SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)
144
145# If REGRESS=1 passed as a parameter, change the default install paths
146# so that no prefix is included. This allows us to relocate to a temporary
147# directory for regression testing.
148ifeq ($(REGRESS),1)
149        bindir=/bin
150        pkglibdir=/lib
151        datadir=/share
152        datamoduledir=contrib/postgis
153endif
154
155# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
156# change is made, a PostGIS rebuild is triggered.
157#
158# Also they are all dependent on postgis_config.h
159# and thus postgis_svn_revision.h
160#
161$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_svn_revision.h
162
163../postgis_svn_revision.h:
164        $(MAKE) -C .. postgis_svn_revision.h
165
166../liblwgeom/.libs/liblwgeom.a:
167        $(MAKE) -C ../liblwgeom liblwgeom.la
168
169../libpgcommon/libpgcommon.a:
170        $(MAKE) -C ../libpgcommon libpgcommon.a
171
172# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
173# and adding the version number
174# replace @extschema@. with nothing, this is only used as placeholder for extension install
175%.sql: %.sql.in
176        $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
177        $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g;s'@extschema@\.''g" > $@
178       
179postgis_upgrade_for_extension.sql: postgis_upgrade_for_extension.sql.in
180        $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
181        $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@
182       
183postgis_for_extension.sql: postgis.sql.in
184        $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
185        $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@
186
187#this is redundant but trying to fold in with extension just hangs
188postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl
189        $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
190       
191postgis_upgrade_for_extension.sql.in: postgis_for_extension.sql ../utils/postgis_proc_upgrade.pl
192        $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
193       
194postgis_proc_set_search_path.sql: postgis.sql ../utils/postgis_proc_set_search_path.pl
195        $(PERL) ../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
196
197postgis_upgrade.sql: postgis_drop_before.sql postgis_upgrade.sql.in postgis_drop_after.sql
198        echo "BEGIN;" > $@
199        cat $^ >> $@
200        echo "COMMIT;" >> $@
201
202sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
203        $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
204
205sfcgal_upgrade.sql: sfcgal_upgrade.sql.in postgis_drop_after.sql
206        cat $^ > $@
207
208# SQL objects are also dependent on postgis_config.h for PostgreSQL version
209$(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h
210
211#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c
212
213uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
214        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
215
216uninstall_legacy.sql: legacy.sql ../utils/create_undef.pl
217        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
218
219uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
220        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
221
222distclean: clean
223        rm -f Makefile
224
225maintainer-clean: distclean
Note: See TracBrowser for help on using the repository browser.