source: trunk/postgis/Makefile.in

Last change on this file was 14750, checked in by robe, 5 months ago

Revise script generation to exclude SQL functions that are NOT STRICT.
Integrate into testing
Integrate into create extension
References #3490 for PostGIS 2.3

  • Property svn:eol-style set to native
File size: 6.5 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 uninstall_postgis.sql postgis_upgrade.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 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
49
50
51# SQL preprocessor
52SQLPP = @SQLPP@
53
54# PostgreSQL objects
55PG_OBJS= \
56        postgis_module.o \
57        lwgeom_accum.o \
58        lwgeom_spheroid.o \
59        lwgeom_ogc.o \
60        lwgeom_functions_analytic.o \
61        lwgeom_inout.o \
62        lwgeom_functions_basic.o \
63        lwgeom_btree.o \
64        lwgeom_box.o \
65        lwgeom_box3d.o \
66        $(BACKEND_OBJ) \
67        lwgeom_backend_api.o \
68        lwgeom_geos_prepared.o \
69        lwgeom_geos_clean.o \
70        lwgeom_geos_relatematch.o \
71        lwgeom_export.o \
72        lwgeom_in_gml.o \
73        lwgeom_in_kml.o \
74        lwgeom_in_geohash.o \
75        lwgeom_in_geojson.o \
76        lwgeom_in_encoded_polyline.o \
77        lwgeom_triggers.o \
78        lwgeom_dump.o \
79        lwgeom_dumppoints.o \
80        lwgeom_functions_lrs.o \
81        lwgeom_functions_temporal.o \
82        long_xact.o \
83        lwgeom_sqlmm.o \
84        lwgeom_rtree.o \
85        lwgeom_transform.o \
86        lwgeom_window.o \
87        gserialized_typmod.o \
88        gserialized_gist_2d.o \
89        gserialized_gist_nd.o \
90        gserialized_estimate.o \
91        geography_inout.o \
92        geography_btree.o \
93        geography_measurement.o \
94        geography_measurement_trees.o \
95        geometry_inout.o
96
97# Objects to build using PGXS
98OBJS=$(PG_OBJS)
99
100# Libraries to link into the module (proj, geos)
101#
102# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
103# -L... -l options to prevent issues with some platforms trying to link
104# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
105# older version of PostGIS, rather than with the static liblwgeom.a
106# supplied with newer versions of PostGIS
107PG_CPPFLAGS += -I../liblwgeom -I../libpgcommon @CPPFLAGS@ -fPIC
108SHLIB_LINK_F = ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
109
110# Add SFCGAL Flags if defined
111ifeq (@SFCGAL@,sfcgal)
112PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
113SHLIB_LINK_F += @SFCGAL_LDFLAGS@
114endif
115
116# Extra files to remove during 'make clean'
117EXTRA_CLEAN=$(SQL_OBJS) \
118        uninstall_postgis.sql \
119        uninstall_legacy.sql \
120        uninstall_sfcgal.sql \
121        postgis_upgrade.sql.in \
122        postgis_upgrade.sql \
123        sfcgal_upgrade.sql.in \
124        sfcgal_upgrade.sql
125
126# PGXS information
127PG_CONFIG = @PG_CONFIG@
128PGXS := @PGXS@
129# NO_TEMP_INSTALL is a workaround for a 9.5dev bug. See:
130# http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
131NO_TEMP_INSTALL=yes
132include $(PGXS)
133
134# Set PERL _after_ the include of PGXS
135PERL=@PERL@
136
137# This is to workaround a bug in PGXS 8.4 win32 link line,
138# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
139SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)
140
141# If REGRESS=1 passed as a parameter, change the default install paths
142# so that no prefix is included. This allows us to relocate to a temporary
143# directory for regression testing.
144ifeq ($(REGRESS),1)
145        bindir=/bin
146        pkglibdir=/lib
147        datadir=/share
148        datamoduledir=contrib/postgis
149endif
150
151# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
152# change is made, a PostGIS rebuild is triggered.
153#
154# Also they are all dependent on postgis_config.h
155# and thus postgis_svn_revision.h
156#
157$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_svn_revision.h
158
159../postgis_svn_revision.h:
160        $(MAKE) -C .. postgis_svn_revision.h
161
162../liblwgeom/.libs/liblwgeom.a:
163        $(MAKE) -C ../liblwgeom liblwgeom.la
164
165../libpgcommon/libpgcommon.a:
166        $(MAKE) -C ../libpgcommon libpgcommon.a
167
168# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
169# and adding the version number
170%.sql: %.sql.in
171        $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
172        $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@
173
174postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl
175        $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
176       
177postgis_proc_set_search_path.sql: postgis.sql ../utils/postgis_proc_set_search_path.pl
178        $(PERL) ../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
179
180postgis_upgrade.sql: postgis_drop_before.sql postgis_upgrade.sql.in postgis_drop_after.sql
181        echo "BEGIN;" > $@
182        cat $^ >> $@
183        echo "COMMIT;" >> $@
184
185sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
186        $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
187
188sfcgal_upgrade.sql: sfcgal_upgrade.sql.in postgis_drop_after.sql
189        cat $^ > $@
190
191# SQL objects are also dependent on postgis_config.h for PostgreSQL version
192$(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h
193
194#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c
195
196uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
197        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
198
199uninstall_legacy.sql: legacy.sql ../utils/create_undef.pl
200        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
201
202uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
203        $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
204
205distclean: clean
206        rm -f Makefile
207
208maintainer-clean: distclean
Note: See TracBrowser for help on using the repository browser.