2008-12-08 04:32:10 +00:00
|
|
|
#
|
2012-11-10 22:33:57 +00:00
|
|
|
# pg_repack: bin/Makefile
|
2008-12-08 04:32:10 +00:00
|
|
|
#
|
2012-09-20 15:36:47 +00:00
|
|
|
# Portions Copyright (c) 2008-2012, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
|
2011-04-29 05:06:48 +00:00
|
|
|
# Portions Copyright (c) 2011, Itagaki Takahiro
|
2012-11-11 03:00:00 +00:00
|
|
|
# Portions Copyright (c) 2012, The Reorg Development Team
|
2008-12-08 04:32:10 +00:00
|
|
|
#
|
2013-04-18 00:29:23 +01:00
|
|
|
|
|
|
|
PG_CONFIG ?= pg_config
|
|
|
|
|
|
|
|
# version as a number, e.g. 9.1.4 -> 90104
|
|
|
|
VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
|
|
|
|
INTVERSION := $(shell echo $(VERSION) | sed -E 's/([0-9]+)\.([0-9]+)\.?([0-9]+)?.*/(\1*100+\2)*100+0\3/' | bc)
|
|
|
|
|
2012-11-10 22:33:57 +00:00
|
|
|
SRCS = pg_repack.c pgut/pgut.c pgut/pgut-fe.c
|
2009-04-22 07:26:12 +00:00
|
|
|
OBJS = $(SRCS:.c=.o)
|
2012-11-10 22:33:57 +00:00
|
|
|
PROGRAM = pg_repack
|
2008-12-08 04:32:10 +00:00
|
|
|
|
2013-04-18 00:29:23 +01:00
|
|
|
ifeq ($(shell echo $$(($(INTVERSION) >= 90100))),1)
|
|
|
|
REGRESS = init-extension
|
|
|
|
else
|
|
|
|
REGRESS = init-legacy
|
|
|
|
endif
|
|
|
|
|
|
|
|
REGRESS += repack tablespace
|
2012-11-10 14:20:15 +00:00
|
|
|
|
2012-11-11 18:30:27 +00:00
|
|
|
# The version number of the program. It should be the same of the library.
|
|
|
|
REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
|
2012-11-16 10:36:16 +00:00
|
|
|
| sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/')
|
2012-11-11 18:30:27 +00:00
|
|
|
|
|
|
|
PG_CPPFLAGS = -I$(libpq_srcdir) -DREPACK_VERSION=$(REPACK_VERSION)
|
|
|
|
|
|
|
|
ifdef DEBUG_REPACK
|
|
|
|
PG_CPPFLAGS += -DDEBUG_REPACK
|
2008-12-08 04:32:10 +00:00
|
|
|
endif
|
2012-11-11 18:30:27 +00:00
|
|
|
|
2008-12-08 04:32:10 +00:00
|
|
|
PG_LIBS = $(libpq)
|
|
|
|
|
2011-01-06 09:35:15 +00:00
|
|
|
USE_PGXS = 1 # use pgxs if not in contrib directory
|
|
|
|
PG_CONFIG = pg_config
|
|
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
2008-12-08 04:32:10 +00:00
|
|
|
include $(PGXS)
|
2010-06-01 07:35:01 +00:00
|
|
|
|
|
|
|
# remove dependency to libxml2 and libxslt
|
|
|
|
LIBS := $(filter-out -lxml2, $(LIBS))
|
|
|
|
LIBS := $(filter-out -lxslt, $(LIBS))
|
2012-09-20 15:36:47 +00:00
|
|
|
|