]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: Inform user to pass ARCH= for make mrproper only when necessary
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 22 Aug 2019 04:46:09 +0000 (13:46 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 29 Aug 2019 14:54:29 +0000 (23:54 +0900)
Since commit 3a475b2166fd ("kbuild: Inform user to pass ARCH= for make
mrproper"), if you try out-of-tree build with an unclean source tree,
it suggests to run 'make ARCH=<ARCH> mrproper'.

This looks odd when you are not cross-compiling the kernel. Show the
'ARCH=<ARCH>' part only when ARCH= was given from the command line.
If ARCH is the default (native build) or came from the environment,
it should simply suggest 'make mrproper' as before.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile

index c79c85126f0c515fb0f366c08232a4168693256b..d5d0742efeb2feaed3c977017793e68c2b7149cf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1118,7 +1118,7 @@ ifdef building_out_of_srctree
        $(Q)if [ -f $(srctree)/.config -o \
                 -d $(srctree)/include/config -o \
                 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
-               echo >&2 "  $(srctree) is not clean, please run 'make ARCH=$(ARCH) mrproper'"; \
+               echo >&2 "  $(srctree) is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \
                echo >&2 "  in the '$(srctree)' directory.";\
                /bin/false; \
        fi;