File: Makefile.in

package info (click to toggle)
postgis 2.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 58,660 kB
  • ctags: 10,181
  • sloc: ansic: 132,858; sql: 131,148; xml: 46,460; sh: 4,832; perl: 4,476; makefile: 2,749; python: 1,198; yacc: 442; lex: 131
file content (219 lines) | stat: -rw-r--r-- 7,159 bytes parent folder | download | duplicates (2)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# **********************************************************************
# *
# * PostGIS - Spatial Types for PostgreSQL
# * http://postgis.net
# *
# * PostGIS 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.
# *
# * PostGIS 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 PostGIS.  If not, see <http://www.gnu.org/licenses/>.
# *
# **********************************************************************
# *
# * Copyright 2008 Mark Cave-Ayland
# *
# **********************************************************************

POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
MODULEDIR=contrib/$(MODULE_big)

# Files to be copied to the contrib/ directory
SQL_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 
DATA=../spatial_ref_sys.sql

# SQL objects (files requiring pre-processing)
SQL_objs=postgis.sql postgis_for_extension.sql legacy.sql legacy_minimal.sql

GEOM_BACKEND_OBJ = lwgeom_geos.o
SFCGAL_BACKEND_OBJ = lwgeom_sfcgal.o

ifeq (@SFCGAL@,sfcgal)
DATA_built=$(SQL_built) sfcgal.sql sfcgal_upgrade.sql uninstall_sfcgal.sql
SQL_OBJS=$(SQL_objs) sfcgal.sql
BACKEND_OBJ=$(GEOM_BACKEND_OBJ) $(SFCGAL_BACKEND_OBJ)
else
BACKEND_OBJ=$(GEOM_BACKEND_OBJ)
DATA_built=$(SQL_built)
SQL_OBJS=$(SQL_objs)
endif

ifeq (@HAVE_BRIN@,yes)
BRIN_OBJ= brin_2d.o brin_nd.o brin_common.o
endif


# SQL preprocessor
SQLPP = @SQLPP@

# PostgreSQL objects
PG_OBJS= \
	postgis_module.o \
	lwgeom_accum.o \
	lwgeom_spheroid.o \
	lwgeom_ogc.o \
	lwgeom_functions_analytic.o \
	lwgeom_inout.o \
	lwgeom_functions_basic.o \
	lwgeom_btree.o \
	lwgeom_box.o \
	lwgeom_box3d.o \
	$(BACKEND_OBJ) \
	lwgeom_backend_api.o \
	lwgeom_geos_prepared.o \
	lwgeom_geos_clean.o \
	lwgeom_geos_relatematch.o \
	lwgeom_export.o \
	lwgeom_in_gml.o \
	lwgeom_in_kml.o \
	lwgeom_in_geohash.o \
	lwgeom_in_geojson.o \
	lwgeom_in_encoded_polyline.o \
	lwgeom_triggers.o \
	lwgeom_dump.o \
	lwgeom_dumppoints.o \
	lwgeom_functions_lrs.o \
	lwgeom_functions_temporal.o \
	long_xact.o \
	lwgeom_sqlmm.o \
	lwgeom_rtree.o \
	lwgeom_transform.o \
	lwgeom_window.o \
	gserialized_typmod.o \
	gserialized_gist_2d.o \
	gserialized_gist_nd.o \
	$(BRIN_OBJ) \
	gserialized_estimate.o \
	geography_inout.o \
	geography_btree.o \
	geography_measurement.o \
	geography_measurement_trees.o \
	geometry_inout.o

# Objects to build using PGXS
OBJS=$(PG_OBJS)

# Libraries to link into the module (proj, geos)
override CFLAGS := -I../liblwgeom $(CFLAGS)
PG_CPPFLAGS += -I../libpgcommon @CPPFLAGS@ -fPIC
SHLIB_LINK_F = -L../liblwgeom/.libs -llwgeom ../libpgcommon/libpgcommon.a @SHLIB_LINK@

# Add SFCGAL Flags if defined
ifeq (@SFCGAL@,sfcgal)
PG_CPPFLAGS += @SFCGAL_CPPFLAGS@
SHLIB_LINK_F += @SFCGAL_LDFLAGS@
endif

# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS) \
	uninstall_postgis.sql \
	uninstall_legacy.sql \
	uninstall_sfcgal.sql \
	postgis_upgrade.sql.in \
	postgis_upgrade.sql \
	sfcgal_upgrade.sql.in \
	sfcgal_upgrade.sql 

# PGXS information
PG_CONFIG = @PG_CONFIG@
PGXS := @PGXS@
# NO_TEMP_INSTALL is a workaround for a 9.5dev bug. See:
# http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
NO_TEMP_INSTALL=yes
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)

# 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

# Make all PostGIS objects depend upon liblwgeom, so that if an underlying
# change is made, a PostGIS rebuild is triggered.
#
# Also they are all dependent on postgis_config.h
# and thus postgis_svn_revision.h
#
$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_svn_revision.h

../postgis_svn_revision.h:
	$(MAKE) -C .. postgis_svn_revision.h

../liblwgeom/.libs/liblwgeom.a:
	$(MAKE) -C ../liblwgeom liblwgeom.la

../libpgcommon/libpgcommon.a:
	$(MAKE) -C ../libpgcommon libpgcommon.a

# Borrow the $libdir substitution from PGXS but customise by running the preprocessor
# and adding the version number
# replace @extschema@. with nothing, this is only used as placeholder for extension install
%.sql: %.sql.in
	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g;s'@extschema@\.''g" > $@
	
postgis_upgrade_for_extension.sql: postgis_drop_before.sql postgis_upgrade_for_extension.sql.in postgis_drop_after.sql
	cat $^ >> $@
	
postgis_for_extension.sql: postgis.sql.in
	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@

#this is redundant but trying to fold in with extension just hangs
postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl
	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
	
postgis_upgrade_for_extension.sql.in: postgis_for_extension.sql ../utils/postgis_proc_upgrade.pl
	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
	
postgis_proc_set_search_path.sql: postgis.sql ../utils/postgis_proc_set_search_path.pl
	$(PERL) ../utils/postgis_proc_set_search_path.pl $< UNUSED > $@

postgis_upgrade.sql: postgis_drop_before.sql postgis_upgrade.sql.in postgis_drop_after.sql
	echo "BEGIN;" > $@
	cat $^ >> $@
	echo "COMMIT;" >> $@

sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl 
	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@

sfcgal_upgrade.sql: sfcgal_upgrade.sql.in postgis_drop_after.sql
	cat $^ > $@

# SQL objects are also dependent on postgis_config.h for PostgreSQL version
$(SQL_OBJS): ../postgis_config.h ../postgis_svn_revision.h

#postgis.sql.in: sqldefines.h long_xact.sql.in.c geography.sql.in.c

uninstall_postgis.sql: postgis.sql ../utils/create_undef.pl
	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@

uninstall_legacy.sql: legacy.sql ../utils/create_undef.pl
	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@

uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
	$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@

distclean: clean
	rm -f Makefile

maintainer-clean: distclean