pg_repack/bin/Makefile

48 lines
1.2 KiB
Makefile
Raw Normal View History

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
#
# Portions Copyright (c) 2008-2012, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
# Portions Copyright (c) 2011, Itagaki Takahiro
# Portions Copyright (c) 2012, The Reorg Development Team
2008-12-08 04:32:10 +00: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
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
# The version number of the program. It should be the same of the library.
REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
| sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/')
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
2008-12-08 04:32:10 +00:00
PG_LIBS = $(libpq)
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))