From: Gurjeet Singh Date: Tue, 1 Jun 2010 20:37:40 +0000 (+0530) Subject: Update makefiles for PGXS builds X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=a57e59b0d81a15fc090bc2fbf3985933de13e5e5;p=pg_adviser.git Update makefiles for PGXS builds --- diff --git a/Makefile b/Makefile index 1c08881..c00c8b1 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,22 @@ # PGFILEDESC = "PostgreSQL Index Advisor" + +ifdef USE_PGXS +PGXS := $(shell pg_config --pgxs) +include $(PGXS) +else subdir = contrib/adviser top_builddir = ../.. include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif + all: - $(MAKE) -C index_adviser all - $(MAKE) -C pg_advise all - $(MAKE) -C resources all + $(MAKE) -C index_adviser $@ + $(MAKE) -C pg_advise $@ + $(MAKE) -C resources $@ @echo "PostgreSQL Index Advisor successfully made. Ready to install." install: diff --git a/pg_advise/Makefile b/pg_advise/Makefile index 2574ae8..106aa15 100644 --- a/pg_advise/Makefile +++ b/pg_advise/Makefile @@ -1,7 +1,12 @@ - +ifdef USE_PGXS +PGXS := $(shell pg_config --pgxs) +include $(PGXS) +else subdir = contrib/pgadviser/pg_advise top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif PROGRAM = pg_advise OBJS = advise_index.o util_funcs.o @@ -9,4 +14,3 @@ OBJS = advise_index.o util_funcs.o PG_CPPFLAGS = -I$(libpq_srcdir) PG_LIBS = $(libpq) -include $(top_srcdir)/contrib/contrib-global.mk