@@ -30,27 +30,24 @@ all: checksrcdir datapagemap.h logging.h receivelog.h streamutil.h pg_probackup
3030
3131MAKE_GLOBAL ="../../src/Makefile.global"
3232TEST_GLOBAL: =$(shell test -e ../../src/Makefile.global)
33- ifeq ($(.SHELLSTATUS ) ,1)
33+
34+ ifdef USE_PGXS
3435PG_CONFIG = pg_config
3536PGXS :=$(shell $(PG_CONFIG ) --pgxs)
3637include $(PGXS )
37-
38- .PHONY : checksrcdir
39- checksrcdir :
4038ifndef top_srcdir
4139@echo "You must have PostgreSQL source tree available to compile."
4240@echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
4341@echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
4442@exit 1
4543endif
4644else
47- # TODO: fix me
48- REGRESS =
4945subdir =contrib/pg_probackup
5046top_builddir =../..
5147include $(top_builddir ) /src/Makefile.global
5248include $(top_srcdir ) /contrib/contrib-global.mk
5349endif
50+
5451PG_CPPFLAGS = -I$(libpq_srcdir ) ${PTHREAD_CFLAGS}
5552override CPPFLAGS := -DFRONTEND$(CPPFLAGS ) $(PG_CPPFLAGS )
5653PG_LIBS =$(libpq_pgport ) ${PTHREAD_CFLAGS}