Commit 18c32dac75b187d1a4e858f3cfdf03e844129f5e

Authored by Sam Ravnborg
1 parent 1cacc9ab8b

kbuild: fix building with O=.. options

The check introduced in commit:
4f1127e204377cbd2a56d112d323466f668e8334 "kbuild: fix
infinite make recursion"

caused certain external modules not to build and
also caused 'make targz-pkg' to fail.
This is a minimal fix so we revert to previous
behaviour - but we do not overwrite the Makefile
in the top-level directory.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Jay Cliburn <jacliburn@bellsouth.net>
Cc: Jay Cliburn <jacliburn@bellsouth.net>

Showing 2 changed files with 6 additions and 3 deletions Side-by-side Diff

... ... @@ -118,9 +118,6 @@
118 118 KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
119 119 $(if $(KBUILD_OUTPUT),, \
120 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 122 PHONY += $(MAKECMDGOALS) sub-make
126 123  
... ... @@ -11,6 +11,12 @@
11 11  
12 12  
13 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 20 echo " GEN $2/Makefile"
15 21  
16 22 cat << EOF > $2/Makefile