From 2a6cf2a3545a4f5e634d7cd7c7d630da388398f0 Mon Sep 17 00:00:00 2001 From: Vadim Yalovets Date: Wed, 1 Dec 2021 21:30:14 +0200 Subject: [PATCH] DISTPG-349 modified build script --- Makefile | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ac1225d..02cdb99 100644 --- a/Makefile +++ b/Makefile @@ -23,19 +23,39 @@ PG_VERSION := $(shell pg_config --version | awk {'print $$1 $$2'}) MAJOR := $(shell echo $(PG_VERSION) | sed -e 's/\.[^./]*$$//') ifneq (,$(findstring PostgreSQL14,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.14.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.14.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.14.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.14.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.14.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL13,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.13.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.13.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.13.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.13.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.13.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL12,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + endif endif ifneq (,$(findstring PostgreSQL11,$(MAJOR))) - CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + ifneq (,$(wildcard ../pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp ../pg_stat_monitor--1.0.sql.in ../pg_stat_monitor--1.0.sql) + endif + ifneq (,$(wildcard pg_stat_monitor--1.0.sql.in)) + CP := $(shell cp pg_stat_monitor--1.0.sql.in pg_stat_monitor--1.0.sql) + endif endif ifdef USE_PGXS