diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | scripts/mkmakefile | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -118,9 +118,6 @@ saved-output := $(KBUILD_OUTPUT) | |||
118 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | 118 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
119 | $(if $(KBUILD_OUTPUT),, \ | 119 | $(if $(KBUILD_OUTPUT),, \ |
120 | $(error output directory "$(saved-output)" does not exist)) | 120 | $(error output directory "$(saved-output)" does not exist)) |
121 | # Check that OUTPUT directory is not the same as where we have kernel src | ||
122 | $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ | ||
123 | $(error Output directory (O=...) specifies kernel src dir)) | ||
124 | 121 | ||
125 | PHONY += $(MAKECMDGOALS) sub-make | 122 | PHONY += $(MAKECMDGOALS) sub-make |
126 | 123 | ||
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index ee39facee152..9ad1bd793252 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile | |||
@@ -11,6 +11,12 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 | 13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
14 | # Only overwrite automatically generated Makefiles | ||
15 | # (so we do not overwrite kernel Makefile) | ||
16 | if ! grep -q Automatically $2/Makefile | ||
17 | then | ||
18 | exit 0 | ||
19 | fi | ||
14 | echo " GEN $2/Makefile" | 20 | echo " GEN $2/Makefile" |
15 | 21 | ||
16 | cat << EOF > $2/Makefile | 22 | cat << EOF > $2/Makefile |