2016-11-16 19:34:21 +02:00
|
|
|
PROGRAM = pg_probackup
|
2009-12-08 02:21:28 +02:00
|
|
|
|
2018-10-26 16:49:39 +02:00
|
|
|
# utils
|
2018-11-01 18:10:20 +02:00
|
|
|
OBJS = src/utils/configuration.o src/utils/json.o src/utils/logger.o \
|
2018-11-29 18:58:40 +02:00
|
|
|
src/utils/parray.o src/utils/pgut.o src/utils/thread.o src/utils/remote.o src/utils/file.o
|
2013-12-24 21:48:36 +03:00
|
|
|
|
2019-05-31 17:15:43 +02:00
|
|
|
OBJS += src/archive.o src/backup.o src/catalog.o src/checkdb.o src/configure.o src/data.o \
|
2018-10-26 16:49:39 +02:00
|
|
|
src/delete.o src/dir.o src/fetch.o src/help.o src/init.o src/merge.o \
|
2019-12-23 17:23:29 +02:00
|
|
|
src/parsexlog.o src/ptrack.o src/pg_probackup.o src/restore.o src/show.o src/util.o \
|
2020-09-02 18:28:44 +02:00
|
|
|
src/validate.o src/datapagemap.o
|
2018-10-26 16:49:39 +02:00
|
|
|
|
|
|
|
# borrowed files
|
2020-09-02 18:28:44 +02:00
|
|
|
OBJS += src/pg_crc.o src/receivelog.o src/streamutil.o \
|
2019-01-27 00:11:52 +02:00
|
|
|
src/xlogreader.o
|
2018-10-26 16:49:39 +02:00
|
|
|
|
2020-09-02 18:28:44 +02:00
|
|
|
EXTRA_CLEAN = src/pg_crc.c \
|
2018-10-26 16:49:39 +02:00
|
|
|
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h \
|
2020-03-24 23:19:46 +02:00
|
|
|
src/xlogreader.c src/instr_time.h
|
2018-10-26 16:49:39 +02:00
|
|
|
|
2020-07-29 14:28:25 +02:00
|
|
|
ifdef top_srcdir
|
|
|
|
srchome := $(abspath $(top_srcdir))
|
|
|
|
else
|
|
|
|
top_srcdir=../..
|
|
|
|
ifneq (,$(wildcard ../../../contrib/pg_probackup))
|
|
|
|
# separate build directory support
|
|
|
|
srchome := $(abspath $(top_srcdir)/..)
|
|
|
|
else
|
|
|
|
srchome := $(abspath $(top_srcdir))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# OBJS variable must be finally defined before invoking the include directive
|
|
|
|
ifneq (,$(wildcard $(srchome)/src/bin/pg_basebackup/walmethods.c))
|
|
|
|
OBJS += src/walmethods.o
|
|
|
|
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
|
|
|
|
endif
|
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)
|
|
|
|
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
|
2019-10-28 11:12:15 +02:00
|
|
|
endif
|
|
|
|
|
2020-07-29 14:28:25 +02:00
|
|
|
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -Isrc -I$(srchome)/$(subdir)/src
|
2017-08-07 15:23:37 +02:00
|
|
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
|
2019-03-04 16:08:50 +02:00
|
|
|
PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
|
2017-08-07 15:23:37 +02:00
|
|
|
|
2020-07-29 14:28:25 +02:00
|
|
|
src/utils/configuration.o: src/datapagemap.h
|
|
|
|
src/archive.o: src/instr_time.h
|
|
|
|
src/backup.o: src/receivelog.h src/streamutil.h
|
2017-08-07 15:23:37 +02:00
|
|
|
|
2020-07-29 14:28:25 +02:00
|
|
|
src/instr_time.h: $(srchome)/src/include/portability/instr_time.h
|
2020-03-24 23:19:46 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/include/portability/instr_time.h $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/pg_crc.c: $(srchome)/src/backend/utils/hash/pg_crc.c
|
2018-10-26 16:49:39 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/backend/utils/hash/pg_crc.c $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/receivelog.c: $(srchome)/src/bin/pg_basebackup/receivelog.c
|
2017-07-05 16:36:22 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.c $@
|
2020-07-29 14:28:25 +02:00
|
|
|
ifneq (,$(wildcard $(srchome)/src/bin/pg_basebackup/walmethods.c))
|
|
|
|
src/receivelog.h: src/walmethods.h $(srchome)/src/bin/pg_basebackup/receivelog.h
|
|
|
|
else
|
|
|
|
src/receivelog.h: $(srchome)/src/bin/pg_basebackup/receivelog.h
|
|
|
|
endif
|
2017-07-05 16:36:22 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.h $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/streamutil.c: $(srchome)/src/bin/pg_basebackup/streamutil.c
|
2017-07-05 16:36:22 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.c $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/streamutil.h: $(srchome)/src/bin/pg_basebackup/streamutil.h
|
2017-07-05 16:36:22 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.h $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/xlogreader.c: $(srchome)/src/backend/access/transam/xlogreader.c
|
2018-10-26 16:49:39 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/walmethods.c: $(srchome)/src/bin/pg_basebackup/walmethods.c
|
2019-01-27 00:11:52 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.c $@
|
2020-07-29 14:28:25 +02:00
|
|
|
src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h
|
2019-01-27 00:11:52 +02:00
|
|
|
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.h $@
|
2018-06-07 18:13:11 +02:00
|
|
|
|
2016-12-08 13:57:28 +02:00
|
|
|
ifeq ($(PORTNAME), aix)
|
|
|
|
CC=xlc_r
|
|
|
|
endif
|