From: Jóhann B. Guðmundsson Date: Thu, 2 Jun 2022 12:31:50 +0000 (+0000) Subject: fix(Makefile): reduce the number of shell invocations X-Git-Tag: 058~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad7d5bc8ea181ef805f65ae690681ebe5ba29bbe;p=thirdparty%2Fdracut.git fix(Makefile): reduce the number of shell invocations Makefile uses recursively expanded macros and as can be seen by simply adding $(warning Call to shell) in front of $(shell ...) Foo's in the Makefile, we are calling out to shell 9 times just to get the working directory, a working directory which doesn't change during Make! Let's save few pony's and reduce it to 2... --- diff --git a/Makefile b/Makefile index 97e189b46..4bf96036d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -include dracut-version.sh -DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :) +DRACUT_MAIN_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :) ifeq ($(DRACUT_MAIN_VERSION),) DRACUT_MAIN_VERSION = $(DRACUT_VERSION) endif -DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :) +DRACUT_FULL_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :) ifeq ($(DRACUT_FULL_VERSION),) DRACUT_FULL_VERSION = $(DRACUT_VERSION) endif