From 0f87acc2b30b3b19fba41e55d30b6d1a7a94fa36 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 29 Apr 2024 15:40:35 +0200 Subject: [PATCH] common.mak: Improve overall Makefile performance Improve overall Makefile performance by dramatically reducing the number of fork and exec system calls through the use of simply expanded variables [1]. Before this change, a simple `make -C libutil` invocation used over 4000 execs, after this change it was reduced to just over 300 execs. [1] https://www.gnu.org/software/make/manual/html_node/Setting.html Reported-by: Ingo Franzki Tested-by: Ingo Franzki Reviewed-by: Ingo Franzki Reviewed-by: Steffen Eiden Signed-off-by: Marc Hartmayer Signed-off-by: Steffen Eiden --- common.mak | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.mak b/common.mak index 85cebff6..e72ef3cb 100644 --- a/common.mak +++ b/common.mak @@ -31,11 +31,11 @@ endif # Global definitions # The variable "DISTRELEASE" should be overwritten in rpm spec files with: # "make DISTRELEASE=%{release}" and "make install DISTRELEASE=%{release}" -VERSION = 2 -RELEASE = 32 -PATCHLEVEL = 0 -DISTRELEASE = build-$(shell date +%Y%m%d) -S390_TOOLS_RELEASE = $(VERSION).$(RELEASE).$(PATCHLEVEL)-$(DISTRELEASE) +VERSION := 2 +RELEASE := 32 +PATCHLEVEL := 0 +DISTRELEASE := build-$(shell date +%Y%m%d) +S390_TOOLS_RELEASE := $(VERSION).$(RELEASE).$(PATCHLEVEL)-$(DISTRELEASE) export S390_TOOLS_RELEASE reldir = $(subst $(realpath $(dir $(filter %common.mak,$(MAKEFILE_LIST))))/,,$(CURDIR)) @@ -293,8 +293,8 @@ INSTDIRS = $(USRSBINDIR) $(USRBINDIR) $(BINDIR) $(LIBDIR) $(MANDIR) \ $(ZFCPDUMP_DIR) $(SYSTEMDSYSTEMUNITDIR) \ $(USRLIB64DIR) $(USRINCLUDEDIR) $(ZKEYKMSPLUGINDIR) \ $(SOINSTALLDIR) $(USRLIBDIR) -OWNER = $(shell id -un) -GROUP = $(shell id -gn) +OWNER := $(shell id -un) +GROUP := $(shell id -gn) export INSTALLDIR BINDIR LIBDIR USRLIBDIR USRLIB64DIR MANDIR OWNER GROUP # Special defines for zfcpdump