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 <nbd@nbd.name>
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)