forked from pramsey/pgsql-ogr-fdw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (45 loc) · 1.34 KB
/
Makefile
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
# ogr_fdw/Makefile
MODULE_big = ogr_fdw
OBJS = \
ogr_fdw.o \
ogr_fdw_deparse.o \
ogr_fdw_common.o \
ogr_fdw_func.o \
stringbuffer_pg.o
EXTENSION = ogr_fdw
DATA = \
ogr_fdw--1.0--1.1.sql \
ogr_fdw--1.1.sql
REGRESS = ogr_fdw
EXTRA_CLEAN = sql/*.sql expected/*.out
GDAL_CONFIG = gdal-config
GDAL_CFLAGS = $(shell $(GDAL_CONFIG) --cflags)
GDAL_LIBS = $(shell $(GDAL_CONFIG) --libs)
PG_CONFIG = pg_config
REGRESS_OPTS = --encoding=UTF8
PG_CPPFLAGS += $(GDAL_CFLAGS)
LIBS += $(GDAL_LIBS)
SHLIB_LINK := $(LIBS)
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
PG_VERSION_NUM = $(shell awk '/PG_VERSION_NUM/ { print $$3 }' $(shell $(PG_CONFIG) --includedir-server)/pg_config.h)
HAS_IMPORT_SCHEMA = $(shell [ $(PG_VERSION_NUM) -ge 90500 ] && echo yes)
# order matters, file first, import last
REGRESS = file pgsql
ifeq ($(HAS_IMPORT_SCHEMA),yes)
REGRESS += import
endif
###############################################################
# Build the utility program after PGXS to override the
# PGXS environment
CFLAGS = $(GDAL_CFLAGS)
LIBS = $(GDAL_LIBS)
ogr_fdw_info$(X): ogr_fdw_info.o ogr_fdw_common.o stringbuffer.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
clean-exe:
rm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o
install-exe: all
$(INSTALL_PROGRAM) ogr_fdw_info$(X) '$(DESTDIR)$(bindir)'
all: ogr_fdw_info$(X)
clean: clean-exe
install: install-exe