source: trunk/postgis/Makefile.in

Last change on this file was 17945, checked in by Raul Marin, 5 years ago

Revert r17925

References #4546

  • Property svn:eol-style set to native
File size: 8.3 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@
26PROTOC_VERSION=@PROTOC_VERSION@
27MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@
28MODULEDIR=contrib/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
29MODULEPATH = $$libdir/postgis-@POSTGIS_MAJOR_VERSION@
30
31ifeq (@LIBINCLUDEMINORVERSION@,yes)
32MODULEPATH=$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
33MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
34endif
35
36# Files to be copied to the contrib/ directory
37SQL_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
38DATA=../spatial_ref_sys.sql
39
40# SQL objects (files requiring pre-processing)
41SQL_objs=postgis.sql legacy.sql legacy_minimal.sql
42
43GEOM_BACKEND_OBJ = lwgeom_geos.o
44SFCGAL_BACKEND_OBJ = lwgeom_sfcgal.o
45
46ifeq (@SFCGAL@,sfcgal)
47DATA_built=$(SQL_built) sfcgal.sql sfcgal_upgrade.sql uninstall_sfcgal.sql
48SQL_OBJS=$(SQL_objs) sfcgal.sql
49BACKEND_OBJ=$(GEOM_BACKEND_OBJ) $(SFCGAL_BACKEND_OBJ)
50else
51BACKEND_OBJ=$(GEOM_BACKEND_OBJ)
52DATA_built=$(SQL_built)
53SQL_OBJS=$(SQL_objs)
54endif
55
56ifeq (@HAVE_SPGIST@,yes)
57SPGIST_OBJ= gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o
58endif
59
60ifeq (@HAVE_PROTOBUF@,yes)
61PROTOBUF_OBJ = vector_tile.pb-c.o
62ifeq (@HAVE_GEOBUF@,yes)
63PROTOBUF_OBJ += geobuf.pb-c.o
64endif
65UTHASH_INCLUDE = -I../deps/uthash/include
66endif
67
68WAGYU_LIBPATH = ../deps/wagyu/@WAGYU_LIB@
69ifeq (@HAVE_WAGYU@,yes)
70WAYGU_INCLUDE = -I../deps/wagyu
71WAYGU_LIB = $(WAGYU_LIBPATH) @WAGYU_LDFLAGS@
72WAGYU_DEP = $(WAGYU_LIBPATH)
73endif
74
75# SQL preprocessor
76SQLPP = @SQLPP@
77
78# PostgreSQL objects
79PG_OBJS= \
80 postgis_module.o \
81 lwgeom_accum.o \
82 lwgeom_spheroid.o \
83 lwgeom_ogc.o \
84 lwgeom_functions_analytic.o \
85 lwgeom_inout.o \
86 lwgeom_functions_basic.o \
87 lwgeom_btree.o \
88 lwgeom_box.o \
89 lwgeom_box3d.o \
90 $(BACKEND_OBJ) \
91 lwgeom_geos_prepared.o \
92 lwgeom_geos_clean.o \
93 lwgeom_geos_relatematch.o \
94 lwgeom_export.o \
95 lwgeom_in_gml.o \
96 lwgeom_in_kml.o \
97 lwgeom_in_geohash.o \
98 lwgeom_in_geojson.o \
99 lwgeom_in_encoded_polyline.o \
100 lwgeom_triggers.o \
101 lwgeom_dump.o \
102 lwgeom_dumppoints.o \
103 lwgeom_functions_lrs.o \
104 lwgeom_functions_temporal.o \
105 lwgeom_rectree.o \
106 long_xact.o \
107 lwgeom_sqlmm.o \
108 lwgeom_rtree.o \
109 lwgeom_transform.o \
110 lwgeom_window.o \
111 gserialized_typmod.o \
112 gserialized_gist_2d.o \
113 gserialized_gist_nd.o \
114 gserialized_supportfn.o \
115 $(SPGIST_OBJ) \
116 brin_2d.o \
117 brin_nd.o \
118 brin_common.o \
119 gserialized_estimate.o \
120 geography_inout.o \
121 geography_btree.o \
122 geography_centroid.o \
123 geography_measurement.o \
124 geography_measurement_trees.o \
125 geometry_inout.o \
126 postgis_libprotobuf.o \
127 $(PROTOBUF_OBJ) \
128 mvt.o \
129 lwgeom_out_mvt.o \
130 geobuf.o \
131 lwgeom_out_geobuf.o \
132 lwgeom_out_geojson.o \
133 postgis_legacy.o
134
135# Objects to build using PGXS
136OBJS=$(PG_OBJS)
137
138# Libraries to link into the module (proj, geos)
139#
140# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
141# -L... -l options to prevent issues with some platforms trying to link
142# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
143# older version of PostGIS, rather than with the static liblwgeom.a
144# supplied with newer versions of PostGIS
145PG_CPPFLAGS += -I../liblwgeom @CFLAGS@ -I../libpgcommon $(WAYGU_INCLUDE) $(UTHASH_INCLUDE) @CPPFLAGS@ @PICFLAGS@
146SHLIB_LINK_F = $(WAYGU_LIB) ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@
147
148# Add SFCGAL Flags if defined
149ifeq (@SFCGAL@,sfcgal)
150PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
151SHLIB_LINK_F += @SFCGAL_LDFLAGS@
152endif
153
154# Extra files to remove during 'make clean'
155EXTRA_CLEAN=$(SQL_OBJS) \
156 uninstall_postgis.sql \
157 uninstall_legacy.sql \
158 uninstall_sfcgal.sql \
159 postgis_upgrade.sql.in \
160 postgis_upgrade.sql \
161 sfcgal_upgrade.sql.in \
162 sfcgal_upgrade.sql \
163 vector_tile.pb-c.c \
164 vector_tile.pb-c.h \
165 geobuf.pb-c.c \
166 geobuf.pb-c.h
167
168# PGXS information
169PG_CONFIG := @PG_CONFIG@
170PGXS := @PGXS@
171# NO_TEMP_INSTALL is a workaround for a 9.5dev bug. See:
172# http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
173NO_TEMP_INSTALL=yes
174include $(PGXS)
175
176# Set PERL _after_ the include of PGXS
177PERL=@PERL@
178
179# This is to workaround a bug in PGXS 8.4 win32 link line,
180# see http://trac.osgeo.org/postgis/ticket/1158#comment:57
181SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK)
182
183# If REGRESS=1 passed as a parameter, change the default install paths
184# so that no prefix is included. This allows us to relocate to a temporary
185# directory for regression testing.
186ifeq ($(REGRESS),1)
187 bindir=/bin
188 pkglibdir=/lib
189 datadir=/share
190 datamoduledir=contrib/postgis
191endif
192
193# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
194# change is made, a PostGIS rebuild is triggered.
195#
196# Also they are all dependent on postgis_config.h
197# and thus postgis_svn_revision.h
198#
199$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_svn_revision.h $(WAGYU_DEP)
200
201../postgis_svn_revision.h:
202 $(MAKE) -C .. postgis_svn_revision.h
203
204../liblwgeom/.libs/liblwgeom.a:
205 $(MAKE) -C ../liblwgeom liblwgeom.la
206
207../libpgcommon/libpgcommon.a:
208 $(MAKE) -C ../libpgcommon libpgcommon.a
209
210$(WAGYU_LIBPATH):
211 $(MAKE) -C ../deps/wagyu all
212
213# Get protobuf-c compiler command
214PROTOCC=@PROTOCC@
215
216# Generate Mapbox Vector Tile encoder/decoder using protobuf-c compiler
217vector_tile.pb-c.c vector_tile.pb-c.h: vector_tile.proto
218 $(PROTOCC) --c_out=. $<
219
220# Generate Geobuf encoder/decoder using protobuf-c compiler
221geobuf.pb-c.c geobuf.pb-c.h: geobuf.proto
222 $(PROTOCC) --c_out=. $<
223
224ifeq (@HAVE_PROTOBUF@,yes)
225lwgeom_out_mvt.o: vector_tile.pb-c.h
226mvt.o: vector_tile.pb-c.h
227ifeq (@HAVE_GEOBUF@,yes)
228lwgeom_out_geobuf.o: geobuf.pb-c.h
229geobuf.o: geobuf.pb-c.h
230endif
231endif
232
233# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
234# and adding the version number
235# replace @extschema@. with nothing, this is only used as placeholder for extension install
236%.sql: %.sql.in
237 $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
238 $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
239
240#this is redundant but trying to fold in with extension just hangs
241postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl
242 $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
243
244postgis_proc_set_search_path.sql: postgis.sql ../utils/postgis_proc_set_search_path.pl
245 $(PERL) ../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
246
247postgis_upgrade.sql: postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql
248 echo "BEGIN;" > $@
249 cat $^ >> $@
250 echo "COMMIT;" >> $@
251
252sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
253 $(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
254
255sfcgal_upgrade.sql: sfcgal_upgrade.sql.in postgis_after_upgrade.sql
256 cat $^ > $@
257
258# SQL objects are also dependent on postgis_config.h for PostgreSQL version
259$(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h
260
261#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c
262
263uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
264 $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
265
266uninstall_legacy.sql: legacy.sql ../utils/create_undef.pl
267 $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
268
269uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
270 $(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
271
272distclean: clean
273 rm -f Makefile
274
275check-unit:
276
277check-regress:
278
279maintainer-clean: distclean
Note: See TracBrowser for help on using the repository browser.