1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-04 10:44:46 +02:00
pg_probackup/Makefile

109 lines
3.9 KiB
Makefile
Raw Normal View History

2016-11-16 19:34:21 +02:00
PROGRAM = pg_probackup
# utils
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
OBJS += src/archive.o src/backup.o src/catalog.o src/checkdb.o src/configure.o src/data.o \
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 \
src/validate.o
# borrowed files
OBJS += src/pg_crc.o src/datapagemap.o src/receivelog.o src/streamutil.o \
2019-01-27 00:11:52 +02:00
src/xlogreader.o
EXTRA_CLEAN = src/pg_crc.c src/datapagemap.c src/datapagemap.h \
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h \
src/xlogreader.c src/instr_time.h
INCLUDES = src/datapagemap.h src/streamutil.h src/receivelog.h src/instr_time.h
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)
# !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
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
srchome=$(top_srcdir)
endif
2019-11-08 18:18:38 +02:00
#ifneq (,$(filter 9.5 9.6 10 11,$(MAJORVERSION)))
ifneq (12,$(MAJORVERSION))
EXTRA_CLEAN += src/logging.h
INCLUDES += src/logging.h
endif
2019-01-27 00:11:52 +02:00
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
OBJS += src/walmethods.o
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
INCLUDES += src/walmethods.h
endif
2018-10-23 16:29:38 +02:00
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -Isrc -I$(top_srcdir)/$(subdir)/src
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
all: checksrcdir $(INCLUDES);
$(PROGRAM): $(OBJS)
src/instr_time.h: $(top_srcdir)/src/include/portability/instr_time.h
rm -f $@ && $(LN_S) $(srchome)/src/include/portability/instr_time.h $@
2017-07-05 16:36:22 +02:00
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/pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm -f $@ && $(LN_S) $(srchome)/src/backend/utils/hash/pg_crc.c $@
2017-07-05 16:36:22 +02:00
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 $@
src/xlogreader.c: $(top_srcdir)/src/backend/access/transam/xlogreader.c
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
2017-06-15 15:54:29 +02:00
2019-11-08 18:18:38 +02:00
#ifneq (,$(filter 9.5 9.6 10 11,$(MAJORVERSION)))
ifneq (12,$(MAJORVERSION))
2019-10-18 11:36:42 +02:00
src/logging.h: $(top_srcdir)/src/bin/pg_rewind/logging.h
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/logging.h $@
endif
2019-01-27 00:11:52 +02:00
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
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
2018-06-07 18:13:11 +02:00
2016-12-08 13:57:28 +02:00
ifeq ($(PORTNAME), aix)
CC=xlc_r
endif
# 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