From: Masahiro Yamada Date: Sat, 22 Jun 2019 16:07:04 +0000 (+0900) Subject: kbuild: save $(strip ...) for calling any-prepreq X-Git-Tag: v5.4-rc1~587^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93f31bbda43603da1e8af06667b45b410c6c897a;p=platform%2Fkernel%2Flinux-rpi.git kbuild: save $(strip ...) for calling any-prepreq The string returned by $(filter-out ...) does not contain any leading or trailing spaces. So, only the space that matters is the one between $(filter-out $(PHONY),$?) and $(filter-out $(PHONY) $(wildcard $^),$^) By removing it from the code, we can save $(strip ...) evaluation. This refactoring is possible because $(any-prereq) is only passed to the first argument of $(if ...), so we are only interested in whether or not it is empty. This is also the prerequisite for the next commit. Signed-off-by: Masahiro Yamada --- diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index ee3fec40..6f9e887 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -225,7 +225,7 @@ make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1)))) # Find any prerequisites that is newer than target or that does not exist. # PHONY targets skipped in both cases. -any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) +any-prereq = $(filter-out $(PHONY),$?)$(filter-out $(PHONY) $(wildcard $^),$^) # Execute command if command has changed or prerequisite(s) are updated. if_changed = $(if $(strip $(any-prereq) $(cmd-check)), \ @@ -268,7 +268,7 @@ ifeq ($(KBUILD_VERBOSE),2) why = \ $(if $(filter $@, $(PHONY)),- due to target is PHONY, \ $(if $(wildcard $@), \ - $(if $(strip $(any-prereq)),- due to: $(any-prereq), \ + $(if $(any-prereq),- due to: $(any-prereq), \ $(if $(cmd-check), \ $(if $(cmd_$@),- due to command line change, \ $(if $(filter $@, $(targets)), \