chore: compatibility make 4.4+

Port from [PR#10627](https://github.com/emqx/emqx/pull/10627).
This commit is contained in:
JimMoen 2023-05-23 16:53:17 +08:00
parent 04308d7a1e
commit 326c71205d
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
1 changed files with 11 additions and 2 deletions

View File

@ -4,8 +4,6 @@ SCRIPTS = $(CURDIR)/scripts
export EMQX_RELUP ?= true export EMQX_RELUP ?= true
export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/5.0-28:1.13.4-24.3.4.2-2-debian11 export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/5.0-28:1.13.4-24.3.4.2-2-debian11
export EMQX_DEFAULT_RUNNER = debian:11-slim export EMQX_DEFAULT_RUNNER = debian:11-slim
export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
export ELIXIR_VSN ?= $(shell $(CURDIR)/scripts/get-elixir-vsn.sh)
export EMQX_DASHBOARD_VERSION ?= v1.2.1 export EMQX_DASHBOARD_VERSION ?= v1.2.1
export EMQX_EE_DASHBOARD_VERSION ?= e1.0.5 export EMQX_EE_DASHBOARD_VERSION ?= e1.0.5
export EMQX_REL_FORM ?= tgz export EMQX_REL_FORM ?= tgz
@ -17,6 +15,17 @@ else
FIND=find FIND=find
endif endif
# `:=` should be used here, otherwise the `$(shell ...)` will be executed every time when the variable is used
# In make 4.4+, for backward-compatibility the value from the original environment is used.
# so the shell script will be executed tons of times.
# https://github.com/emqx/emqx/pull/10627
ifeq ($(strip $(OTP_VSN)),)
export OTP_VSN := $(shell $(SCRIPTS)/get-otp-vsn.sh)
endif
ifeq ($(strip $(ELIXIR_VSN)),)
export ELIXIR_VSN := $(shell $(SCRIPTS)/get-elixir-vsn.sh)
endif
PROFILE ?= emqx PROFILE ?= emqx
REL_PROFILES := emqx emqx-enterprise REL_PROFILES := emqx emqx-enterprise
PKG_PROFILES := emqx-pkg emqx-enterprise-pkg PKG_PROFILES := emqx-pkg emqx-enterprise-pkg