@@ -23,14 +23,35 @@ OBJS = backup.o \
23
23
24
24
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.c receivelog.h streamutil.c streamutil.h logging.h
25
25
26
- PG_CPPFLAGS = -I$(libpq_srcdir ) ${PTHREAD_CFLAGS}
27
- override CPPFLAGS := -DFRONTEND$(CPPFLAGS )
28
- PG_LIBS =$(libpq_pgport ) ${PTHREAD_LIBS} ${PTHREAD_CFLAGS}
29
-
30
26
REGRESS = init option show delete backup restore
31
27
32
28
all : checksrcdir datapagemap.h logging.h receivelog.h streamutil.h pg_arman
33
29
30
+ MAKE_GLOBAL ="../../src/Makefile.global"
31
+ TEST_GLOBAL: =$(shell test -e ../../src/Makefile.global)
32
+ ifeq ($(.SHELLSTATUS ) ,1)
33
+ PG_CONFIG = pg_config
34
+ PGXS :=$(shell $(PG_CONFIG ) --pgxs)
35
+ include $(PGXS )
36
+
37
+ .PHONY : checksrcdir
38
+ checksrcdir :
39
+ ifndef top_srcdir
40
+ @echo "You must have PostgreSQL source tree available to compile."
41
+ @echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
42
+ @echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
43
+ @exit 1
44
+ endif
45
+ else
46
+ subdir =contrib/pg_arman
47
+ top_builddir =../..
48
+ include $(top_builddir ) /src/Makefile.global
49
+ include $(top_srcdir ) /contrib/contrib-global.mk
50
+ endif
51
+ PG_CPPFLAGS = -I$(libpq_srcdir ) ${PTHREAD_CFLAGS}
52
+ override CPPFLAGS := -DFRONTEND$(CPPFLAGS ) $(PG_CPPFLAGS )
53
+ PG_LIBS =$(libpq_pgport ) ${PTHREAD_CFLAGS}
54
+
34
55
# This rule's only purpose is to give the user instructions on how to pass
35
56
# the path to PostgreSQL source tree to the makefile.
36
57
.PHONY : checksrcdir
@@ -61,8 +82,3 @@ streamutil.c: % : $(top_srcdir)/src/bin/pg_basebackup/%
61
82
rm -f&& $(LN_S ) $< .
62
83
streamutil.h :% :$(top_srcdir ) /src/bin/pg_basebackup/%
63
84
rm -f&& $(LN_S ) $< .
64
-
65
- PG_CONFIG = pg_config
66
- PGXS :=$(shell $(PG_CONFIG ) --pgxs)
67
- include $(PGXS )
68
-