11PROGRAM = pg_probackup
2- OBJS = backup.o \
3- catalog.o \
4- configure.o \
5- data.o \
6- delete.o \
7- dir.o \
8- fetch.o \
9- help.o \
10- init.o \
11- parray.o \
12- pg_probackup.o \
13- restore.o \
14- show.o \
15- status.o \
16- util.o \
17- validate.o \
18- datapagemap.o \
19- parsexlog.o \
20- xlogreader.o \
21- streamutil.o \
22- receivelog.o \
23- pgut/pgut.o
2+ OBJS = src/backup.o src/catalog.o src/configure.o src/data.o \
3+ src/delete.o src/dir.o src/fetch.o src/help.o src/init.o \
4+ src/pg_probackup.o src/restore.o src/show.o src/status.o \
5+ src/util.o src/validate.o src/datapagemap.o src/parsexlog.o \
6+ src/xlogreader.o src/streamutil.o src/receivelog.o \
7+ src/archive.o src/utils/parray.o src/utils/pgut.o src/utils/logger.o
248
25- EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.c receivelog.h streamutil.c streamutil.h logging.h
9+ EXTRA_CLEAN = src/datapagemap.c src/datapagemap.h src/xlogreader.c \
10+ src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h src/logging.h
2611
27- all : checksrcdir datapagemap.h logging.h receivelog.h streamutil.h pg_probackup
12+ all : checksrcdir src/ datapagemap.h src/ logging.h src/ receivelog.h src/ streamutil.h pg_probackup
2813
29- MAKE_GLOBAL ="../../src/Makefile.global"
30- TEST_GLOBAL: =$(shell test -e ../../src/Makefile.global)
31- ifeq ($(.SHELLSTATUS ) ,1)
14+ ifdef USE_PGXS
3215PG_CONFIG = pg_config
3316PGXS := $(shell $(PG_CONFIG ) --pgxs)
3417include $(PGXS )
35-
36- .PHONY : checksrcdir
37- checksrcdir :
3818ifndef top_srcdir
3919 @echo "You must have PostgreSQL source tree available to compile."
4020 @echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
4121 @echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
4222 @exit 1
4323endif
24+ # Those files are symlinked from the PostgreSQL sources.
25+ src/xlogreader.c : % : $(top_srcdir ) /src/backend/access/transam/xlogreader.c
26+ rm -f $@ && $(LN_S ) $< ./src/xlogreader.c
27+ src/datapagemap.c : % : $(top_srcdir ) /src/bin/pg_rewind/datapagemap.c
28+ rm -f $@ && $(LN_S ) $< ./src/datapagemap.c
29+ src/datapagemap.h : % : $(top_srcdir ) /src/bin/pg_rewind/datapagemap.h
30+ rm -f $@ && $(LN_S ) $< src/datapagemap.h
31+ src/logging.h : % : $(top_srcdir ) /src/bin/pg_rewind/logging.h
32+ rm -f $@ && $(LN_S ) $< ./src
33+ src/receivelog.c : % : $(top_srcdir ) /src/bin/pg_basebackup/receivelog.c
34+ rm -f $@ && $(LN_S ) $< ./src
35+ src/receivelog.h : % : $(top_srcdir ) /src/bin/pg_basebackup/receivelog.h
36+ rm -f $@ && $(LN_S ) $< ./src
37+ src/streamutil.c : % : $(top_srcdir ) /src/bin/pg_basebackup/streamutil.c
38+ rm -f $@ && $(LN_S ) $< ./src
39+ src/streamutil.h : % : $(top_srcdir ) /src/bin/pg_basebackup/streamutil.h
40+ rm -f $@ && $(LN_S ) $< ./src
4441else
45- # TODO: fix me
46- REGRESS =
4742subdir =contrib/pg_probackup
4843top_builddir =../..
4944include $(top_builddir ) /src/Makefile.global
5045include $(top_srcdir ) /contrib/contrib-global.mk
46+ # Those files are symlinked from the PostgreSQL sources.
47+ src/xlogreader.c : % : $(top_srcdir ) /src/backend/access/transam/xlogreader.c
48+ rm -f $@ && $(LN_S ) ../$< ./src/xlogreader.c
49+ src/datapagemap.c : % : $(top_srcdir ) /src/bin/pg_rewind/datapagemap.c
50+ rm -f $@ && $(LN_S ) ../$< ./src/datapagemap.c
51+ src/datapagemap.h : % : $(top_srcdir ) /src/bin/pg_rewind/datapagemap.h
52+ rm -f $@ && $(LN_S ) ../$< src/datapagemap.h
53+ src/logging.h : % : $(top_srcdir ) /src/bin/pg_rewind/logging.h
54+ rm -f $@ && $(LN_S ) ../$< ./src
55+ src/receivelog.c : % : $(top_srcdir ) /src/bin/pg_basebackup/receivelog.c
56+ rm -f $@ && $(LN_S ) ../$< ./src
57+ src/receivelog.h : % : $(top_srcdir ) /src/bin/pg_basebackup/receivelog.h
58+ rm -f $@ && $(LN_S ) ../$< ./src
59+ src/streamutil.c : % : $(top_srcdir ) /src/bin/pg_basebackup/streamutil.c
60+ rm -f $@ && $(LN_S ) ../$< ./src
61+ src/streamutil.h : % : $(top_srcdir ) /src/bin/pg_basebackup/streamutil.h
62+ rm -f $@ && $(LN_S ) ../$< ./src
5163endif
64+
5265PG_CPPFLAGS = -I$(libpq_srcdir ) ${PTHREAD_CFLAGS}
5366override CPPFLAGS := -DFRONTEND $(CPPFLAGS ) $(PG_CPPFLAGS )
5467PG_LIBS = $(libpq_pgport ) ${PTHREAD_CFLAGS}
@@ -58,7 +71,7 @@ ifeq ($(PORTNAME), aix)
5871endif
5972
6073envtest :
61- : top_srcdir=$(top_srcdir )
74+ : top_srcdir=$( )
6275 : libpq_srcdir = $(libpq_srcdir )
6376
6477# This rule's only purpose is to give the user instructions on how to pass
@@ -71,23 +84,3 @@ ifndef top_srcdir
7184 @echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
7285 @exit 1
7386endif
74-
75- # Those files are symlinked from the PostgreSQL sources.
76- xlogreader.c : % : $(top_srcdir ) /src/backend/access/transam/%
77- rm -f $@ && $(LN_S ) $< .
78- datapagemap.c : % : $(top_srcdir ) /src/bin/pg_rewind/%
79- rm -f $@ && $(LN_S ) $< .
80- datapagemap.h : % : $(top_srcdir ) /src/bin/pg_rewind/%
81- rm -f && $(LN_S ) $< .
82- # logging.c: % : $(top_srcdir)/src/bin/pg_rewind/%
83- # rm -f && $(LN_S) $< .
84- logging.h : % : $(top_srcdir ) /src/bin/pg_rewind/%
85- rm -f && $(LN_S ) $< .
86- receivelog.c : % : $(top_srcdir ) /src/bin/pg_basebackup/%
87- rm -f && $(LN_S ) $< .
88- receivelog.h : % : $(top_srcdir ) /src/bin/pg_basebackup/%
89- rm -f && $(LN_S ) $< .
90- streamutil.c : % : $(top_srcdir ) /src/bin/pg_basebackup/%
91- rm -f && $(LN_S ) $< .
92- streamutil.h : % : $(top_srcdir ) /src/bin/pg_basebackup/%
93- rm -f && $(LN_S ) $< .
0 commit comments