2016-11-16 19:34:21 +02:00
|
|
|
PROGRAM = pg_probackup
|
2017-06-20 11:37:10 +02:00
|
|
|
OBJS = src/backup.o src/catalog.o src/configure.o src/data.o \
|
|
|
|
src/delete.o src/dir.o src/fetch.o src/help.o src/init.o \
|
|
|
|
src/pg_probackup.o src/restore.o src/show.o src/status.o \
|
|
|
|
src/util.o src/validate.o src/datapagemap.o src/parsexlog.o \
|
|
|
|
src/xlogreader.o src/streamutil.o src/receivelog.o \
|
2018-06-06 13:07:10 +02:00
|
|
|
src/archive.o src/utils/parray.o src/utils/pgut.o src/utils/logger.o \
|
2018-08-02 10:57:39 +02:00
|
|
|
src/utils/json.o src/utils/thread.o src/merge.o
|
2009-12-08 02:21:28 +02:00
|
|
|
|
2017-06-20 13:12:16 +02:00
|
|
|
EXTRA_CLEAN = src/datapagemap.c src/datapagemap.h src/xlogreader.c \
|
|
|
|
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h src/logging.h
|
2013-12-24 21:48:36 +03:00
|
|
|
|
2017-08-07 15:23:37 +02:00
|
|
|
INCLUDES = src/datapagemap.h src/logging.h src/receivelog.h src/streamutil.h
|
2016-01-15 16:47:38 +02:00
|
|
|
|
2017-06-15 15:54:29 +02:00
|
|
|
ifdef USE_PGXS
|
2016-09-13 14:22:34 +02:00
|
|
|
PG_CONFIG = pg_config
|
|
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
|
|
include $(PGXS)
|
2017-08-07 15:23:37 +02:00
|
|
|
# !USE_PGXS
|
2016-09-13 14:22:34 +02:00
|
|
|
else
|
2016-11-16 19:34:21 +02:00
|
|
|
subdir=contrib/pg_probackup
|
2016-09-13 14:22:34 +02:00
|
|
|
top_builddir=../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
include $(top_srcdir)/contrib/contrib-global.mk
|
2017-08-07 15:23:37 +02:00
|
|
|
endif # USE_PGXS
|
|
|
|
|
|
|
|
ifeq ($(top_srcdir),../..)
|
2017-10-27 14:32:24 +02:00
|
|
|
ifeq ($(LN_S),ln -s)
|
|
|
|
srchome=$(top_srcdir)/..
|
|
|
|
endif
|
2017-07-05 16:36:22 +02:00
|
|
|
else
|
2017-08-07 15:23:37 +02:00
|
|
|
srchome=$(top_srcdir)
|
|
|
|
endif
|
|
|
|
|
2018-10-09 13:56:56 +02:00
|
|
|
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
|
2017-08-07 15:23:37 +02:00
|
|
|
OBJS += src/walmethods.o
|
|
|
|
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
|
|
|
|
INCLUDES += src/walmethods.h
|
2017-07-05 16:36:22 +02:00
|
|
|
endif
|
2017-08-07 15:23:37 +02:00
|
|
|
|
|
|
|
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -Isrc
|
|
|
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
|
|
|
|
PG_LIBS = $(libpq_pgport) ${PTHREAD_CFLAGS}
|
|
|
|
|
2017-08-15 12:18:14 +02:00
|
|
|
all: checksrcdir $(INCLUDES);
|
2017-08-07 15:23:37 +02:00
|
|
|
|
|
|
|
$(PROGRAM): $(OBJS)
|
|
|
|
|
2017-07-05 16:36:22 +02:00
|
|
|
src/xlogreader.c: $(top_srcdir)/src/backend/access/transam/xlogreader.c
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
|
|
|
|
src/datapagemap.c: $(top_srcdir)/src/bin/pg_rewind/datapagemap.c
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.c $@
|
|
|
|
src/datapagemap.h: $(top_srcdir)/src/bin/pg_rewind/datapagemap.h
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.h $@
|
|
|
|
src/logging.h: $(top_srcdir)/src/bin/pg_rewind/logging.h
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/logging.h $@
|
|
|
|
src/receivelog.c: $(top_srcdir)/src/bin/pg_basebackup/receivelog.c
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.c $@
|
|
|
|
src/receivelog.h: $(top_srcdir)/src/bin/pg_basebackup/receivelog.h
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.h $@
|
|
|
|
src/streamutil.c: $(top_srcdir)/src/bin/pg_basebackup/streamutil.c
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.c $@
|
|
|
|
src/streamutil.h: $(top_srcdir)/src/bin/pg_basebackup/streamutil.h
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.h $@
|
2017-06-15 15:54:29 +02:00
|
|
|
|
2018-06-07 18:13:11 +02:00
|
|
|
|
2018-10-09 13:56:56 +02:00
|
|
|
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
|
2017-08-07 15:23:37 +02:00
|
|
|
src/walmethods.c: $(top_srcdir)/src/bin/pg_basebackup/walmethods.c
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.c $@
|
|
|
|
src/walmethods.h: $(top_srcdir)/src/bin/pg_basebackup/walmethods.h
|
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.h $@
|
|
|
|
endif
|
2016-09-13 14:22:34 +02:00
|
|
|
|
2016-12-08 13:57:28 +02:00
|
|
|
ifeq ($(PORTNAME), aix)
|
|
|
|
CC=xlc_r
|
|
|
|
endif
|
|
|
|
|
2016-01-15 16:47:38 +02:00
|
|
|
# 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
|
|
|
|
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=<path to PostgreSQL source tree>\""
|
|
|
|
@exit 1
|
|
|
|
endif
|