From 14bad2001f3f205af6d029ee8b55a0f6c4f0f4d0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 6 Oct 2020 13:39:58 +0200 Subject: [PATCH] build: prevent excessive re-evaluation of PKG_VERSION version_abbrev uses $(shell) and the ?= is causing make to run the command over and over again, causing a significant build slowdown Signed-off-by: Felix Fietkau --- include/download.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/download.mk b/include/download.mk index 9c8ada052b..d393bf3907 100644 --- a/include/download.mk +++ b/include/download.mk @@ -12,9 +12,11 @@ OPENWRT_GIT = $(PROJECT_GIT) LEDE_GIT = $(PROJECT_GIT) ifdef PKG_SOURCE_VERSION -PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION)) -PKG_SOURCE_SUBDIR ?= $(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE ?= $(PKG_SOURCE_SUBDIR).tar.xz + ifndef PKG_VERSION + PKG_VERSION := $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION)) + endif + PKG_SOURCE_SUBDIR ?= $(PKG_NAME)-$(PKG_VERSION) + PKG_SOURCE ?= $(PKG_SOURCE_SUBDIR).tar.xz endif DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED) -- 2.30.2