kbuild: Inform user to pass ARCH= for make mrproper
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 9 Jul 2019 13:26:39 +0000 (15:26 +0200)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 10 Jul 2019 15:05:09 +0000 (00:05 +0900)
When cross-compiling an out-of-tree build with an unclean source tree
directory, the build fails with:

  /path/to/kernel/source/tree is not clean, please run 'make mrproper'
  in the '/path/to/kernel/source/tree' directory.

However, doing so does not fix the problem, as "make mrproper" now
requires passing the target architecture to the make command, else it
won't remove $(srctree)/arch/$(SRCARCH)/include/generated.
"git ls-files -o" doesn't give a clue, as it doesn't list (empty)
directories, only files.

Improve usability by including the ARCH= option in the error output.

Fixes: a788b2ed81ab ("kbuild: check arch/$(SRCARCH)/include/generated before out-of-tree build")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile

index 357fd3623144063aac2a602a6273a07b779e7f41..d076840904e292870538f9b871b496c2a3dc600e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1107,7 +1107,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 mrproper'"; \
+               echo >&2 "  $(srctree) is not clean, please run 'make ARCH=$(ARCH) mrproper'"; \
                echo >&2 "  in the '$(srctree)' directory.";\
                /bin/false; \
        fi;