forked from postgis/postgis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
153 lines (125 loc) · 5.09 KB
/
Makefile.in
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
# **********************************************************************
# *
# * 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 2020 Regina Obe
# * Copyright 2008 Mark Cave-Ayland
# *
# **********************************************************************
MODULE_NAME=postgis_sfcgal
MODULE_big=$(MODULE_NAME)-@POSTGIS_MAJOR_VERSION@
MODULEDIR=contrib/postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
MODULEPATH=$$libdir/$(MODULE_NAME)-@POSTGIS_MAJOR_VERSION@
POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
ifeq (@LIBINCLUDEMINORVERSION@,yes)
MODULEPATH=$$libdir/$(MODULE_NAME)-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
MODULE_big=$(MODULE_NAME)-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
endif
# Files to be copied to the contrib/ directory
DATA_built=sfcgal.sql uninstall_sfcgal.sql sfcgal_upgrade.sql
DATA=
# SQL preprocessor
SQLPP = @SQLPP@
# SQL objects (files requiring pre-processing)
SQL_OBJS = \
sfcgal.sql
# Objects to build using PGXS
OBJS = lwgeom_sfcgal.o
# Libraries to link into the module (proj, geos)
#
# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
# -L... -l options to prevent issues with some platforms trying to link
# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
# older version of PostGIS, rather than with the static liblwgeom.a
# supplied with newer versions of PostGIS
PG_CPPFLAGS += -I@top_builddir@/liblwgeom -I@top_srcdir@/liblwgeom -I@top_srcdir@/libpgcommon @CFLAGS@ @CPPFLAGS@ @PICFLAGS@
SHLIB_LINK_F = @top_builddir@/libpgcommon/libpgcommon.a @top_builddir@/liblwgeom/.libs/liblwgeom.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_sfcgal.sql \
sfcgal_upgrade.sql.in \
sfcgal_upgrade.sql \
sfcgal_after_upgrade.sql \
sfcgal_before_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)
VPATH := @srcdir@
# 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)
# NOTE: setting LDFLAGS explicitly here avoids getting the
# link line polluted by unrelated PostgreSQL switches that
# may be confusing and out-of-control for the builder of
# PostGIS
LDFLAGS = @LDFLAGS@
# 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_revision.h
#
$(OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a ../postgis_config.h ../postgis_revision.h
# SQL objects are also dependent on postgis_config.h for PostgreSQL
# version
$(SQL_OBJS): ../postgis_config.h ../postgis_revision.h
# 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@top_builddir@/postgis $< | grep -v '^#' | \
$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
sfcgal_upgrade.sql.in: sfcgal.sql ../utils/postgis_proc_upgrade.pl
$(PERL) @top_srcdir@/utils/postgis_proc_upgrade.pl $< UNUSED > $@
sfcgal_upgrade.sql: sfcgal_before_upgrade.sql sfcgal_upgrade.sql.in sfcgal_after_upgrade.sql
echo "BEGIN;" > $@
cat $^ >> $@
echo "COMMIT;" >> $@
uninstall_sfcgal_legacy.sql: sfcgal_legacy.sql ../utils/create_undef.pl
$(PERL) @top_srcdir@/utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
uninstall_sfcgal.sql: sfcgal.sql ../utils/create_undef.pl
$(PERL) @top_srcdir@/utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
distclean: clean
rm -f Makefile
rm -f regress/Makefile
check-unit:
check-regress:
maintainer-clean: distclean
check:
$(MAKE) -C regress check