-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.in
67 lines (54 loc) · 2.07 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
#######################################################################
#
# Makefile.in
#
# Copyright (C) 2015 Sandro Santilli <[email protected]>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU General Public Licence version 3 or later.
# See the COPYING file.
#
#######################################################################
CC = @CC@
CFLAGS = @CFLAGS@
LWGEOM_LDFLAGS = @LWGEOM_LDFLAGS@
LWGEOM_CFLAGS = @LWGEOM_CFLAGS@
#PG_CONFIG = @PG_CONFIG@
PGXS = @PGXS@
OBJS = fineltra.o
SED = sed
EXTENSION = fineltra
EXTVERSION = $(shell cat Version.config)
EXTVERSION_MAJOR = $(shell echo $(EXTVERSION) | cut -d. -f1,2)
MODULE_big = $(EXTENSION)-$(EXTVERSION_MAJOR)
UPGRADABLE =
UPGRADES = \
$(shell echo $(UPGRADABLE) | \
$(SED) 's/^/$(EXTENSION)--/' | \
$(SED) 's/$$/--$(EXTVERSION).sql/' | \
$(SED) 's/ /--$(EXTVERSION).sql $(EXTENSION)--/g') \
$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql \
$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql
DATA_built = \
$(EXTENSION).control \
$(EXTENSION)--$(EXTVERSION).sql \
$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql
REGRESS = fineltra
REGRESS_OPTS = --inputdir=regress --outputdir=regress --load-extension=postgis --load-extension=fineltra
# Add in build/link flags for lib
PG_CPPFLAGS += -I. $(LWGEOM_CFLAGS)
SHLIB_LINK += $(LWGEOM_LDFLAGS) `geos-config --clibs` -Wl,--exclude-libs,ALL
# We are going to use PGXS for sure
include $(PGXS)
$(EXTENSION).control: $(EXTENSION).control.in Makefile
$(SED) -e 's/@VERSION@/$(EXTVERSION)/' \
-e 's/@VERSION_MAJOR@/$(EXTVERSION_MAJOR)/' $< > $@
$(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql.in Makefile
$(SED) -e 's/@VERSION@/$(EXTVERSION)/' $< > $@
# NOTE: relies on PERL being defined by PGXS
$(EXTENSION)--%--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql ../util/proc_upgrade.pl
cat $< | ../util/proc_upgrade.pl > $@
$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: $(EXTENSION)--$(EXTVERSION).sql
ln -f $< $@
$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql
ln -f $< $@