]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: save $(strip ...) for calling any-prepreq
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 22 Jun 2019 16:07:04 +0000 (01:07 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 1 Jul 2019 01:03:15 +0000 (10:03 +0900)
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 <yamada.masahiro@socionext.com>
scripts/Kbuild.include

index ee3fec40111efca766c988a47b1b70db337ce636..6f9e88716ff422cca3ca2cd0e53005903bde23ee 100644 (file)
@@ -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)),                       \