Skip to content

Commit 18c32da

Browse files
author
Sam Ravnborg
committed
kbuild: fix building with O=.. options
The check introduced in commit: 4f1127e "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>
1 parent 1cacc9a commit 18c32da

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎Makefile‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ saved-output := $(KBUILD_OUTPUT)
118118
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
119119
$(if $(KBUILD_OUTPUT),, \
120120
$(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))
124121

125122
PHONY += $(MAKECMDGOALS) sub-make
126123

‎scripts/mkmakefile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212

1313
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
1420
echo " GEN $2/Makefile"
1521

1622
cat << EOF > $2/Makefile

0 commit comments

Comments
 (0)