From 908067bdf92dd52a665ebc6a1e4b7a6da21fa705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Wed, 10 May 2023 17:29:02 +0200 Subject: [PATCH] common.mak: Fix slow build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The relative subdirectory path of a build target is determined via a separate shell command that issues 'cd' and 'pwd'. Spawning a separate shell is very costly and can lead to extremely slow builds in some circumstances. Replace the shell command with the make built-in command 'realpath' to accomplish the same result more efficiently. Tested-by: Alexander Egorenkov Signed-off-by: Jan Höppner Signed-off-by: Steffen Eiden --- common.mak | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common.mak b/common.mak index e3a5e217..0d44a999 100644 --- a/common.mak +++ b/common.mak @@ -22,8 +22,7 @@ DISTRELEASE = build-$(shell date +%Y%m%d) S390_TOOLS_RELEASE = $(VERSION).$(RELEASE).$(PATCHLEVEL)-$(DISTRELEASE) export S390_TOOLS_RELEASE -reldir = $(subst $(shell cd -P $(dir $(filter %common.mak,$(MAKEFILE_LIST))); \ - pwd)/,,$(CURDIR)) +reldir = $(subst $(realpath $(dir $(filter %common.mak,$(MAKEFILE_LIST))))/,,$(CURDIR)) rootdir= $(dir $(filter %common.mak,$(MAKEFILE_LIST))) export S390_TEST_LIB_PATH=$(rootdir)/s390-tools-testsuite/lib