Allow building in postgres contrib source
authorMark Wong <[email protected]>
Fri, 8 Sep 2023 20:29:40 +0000 (20:29 +0000)
committerMark Wong <[email protected]>
Fri, 8 Sep 2023 20:31:11 +0000 (13:31 -0700)
Makefile

index 4a06d31449205eccf85a019fa19f4edeb000e91a..1f9ce26fc7741d900b68a13524bab3dc85d5e6cf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,10 @@ DATA := $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql),$(wildcard c
 DOCS := $(wildcard doc/*)
 MODULES := $(patsubst %.c,%,$(wildcard src/*.c))
 SCRIPTS := $(wildcard contrib/*.sh) $(wildcard contrib/*.pl)
+
+ifdef USE_PGXS
 PG_CONFIG = pg_config
 PG91 := $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
-
 ifeq ($(PG91),yes)
 all: sql/$(EXTENSION)--$(EXTVERSION).sql
 
@@ -21,3 +22,9 @@ endif
 
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
+else
+subdir = contrib/pg_proctab
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif