From 4211fd833120b013f8f54c7ce68236623ad7e510 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 13 Sep 2016 15:22:34 +0300 Subject: [PATCH] Try build pg_arman as contrib. --- Makefile | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8bd9b36b..e6e93425 100644 --- a/Makefile +++ b/Makefile @@ -23,14 +23,35 @@ OBJS = backup.o \ EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.c receivelog.h streamutil.c streamutil.h logging.h -PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -override CPPFLAGS := -DFRONTEND $(CPPFLAGS) -PG_LIBS = $(libpq_pgport) ${PTHREAD_LIBS} ${PTHREAD_CFLAGS} - REGRESS = init option show delete backup restore all: checksrcdir datapagemap.h logging.h receivelog.h streamutil.h pg_arman +MAKE_GLOBAL="../../src/Makefile.global" +TEST_GLOBAL:=$(shell test -e ../../src/Makefile.global) +ifeq ($(.SHELLSTATUS),1) +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) + +.PHONY: checksrcdir +checksrcdir: +ifndef top_srcdir + @echo "You must have PostgreSQL source tree available to compile." + @echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir" + @echo "variable: \"make top_srcdir=\"" + @exit 1 +endif +else +subdir=contrib/pg_arman +top_builddir=../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif +PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} +override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS) +PG_LIBS = $(libpq_pgport) ${PTHREAD_CFLAGS} + # This rule's only purpose is to give the user instructions on how to pass # the path to PostgreSQL source tree to the makefile. .PHONY: checksrcdir @@ -61,8 +82,3 @@ streamutil.c: % : $(top_srcdir)/src/bin/pg_basebackup/% rm -f && $(LN_S) $< . streamutil.h: % : $(top_srcdir)/src/bin/pg_basebackup/% rm -f && $(LN_S) $< . - -PG_CONFIG = pg_config -PGXS := $(shell $(PG_CONFIG) --pgxs) -include $(PGXS) -