aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.(none)>2007-09-26 13:38:44 -0400
committerSam Ravnborg <sam@neptun.(none)>2007-10-12 15:15:32 -0400
commit4f1127e204377cbd2a56d112d323466f668e8334 (patch)
tree8d73e1d7bd0e4a728f7896b766f6ce596bd8e0b2 /Makefile
parenta67cb1319f53fa68012a23d6ca45279c6bc627f8 (diff)
kbuild: fix infinite make recursion
Jan Engelhardt <jengelh@computergmbh.de> reported: You can cause a recursion in kbuild/make with the following: make O=$PWD kernel/time.o make mrproper Of course no one would use O=$PWD (that's just the testcase), but this happened too often: /ws/linux/linux-2.6.23$ make O=/ws/linux/linux-2.6.23 kernel/time.o (Oops - should have been O=/ws/linux/obj-2.6.23!) Fixed by an explicit test for this case - we error out if output directory and source directory are the same. Tested-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2738966e1d37..1b0d84d49612 100644
--- a/Makefile
+++ b/Makefile
@@ -115,7 +115,9 @@ saved-output := $(KBUILD_OUTPUT)
115KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) 115KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
116$(if $(KBUILD_OUTPUT),, \ 116$(if $(KBUILD_OUTPUT),, \
117 $(error output directory "$(saved-output)" does not exist)) 117 $(error output directory "$(saved-output)" does not exist))
118 118# Check that OUTPUT directory is not the same as where we have kernel src
119$(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \
120 $(error Output directory (O=...) specifies kernel src dir))
119PHONY += $(MAKECMDGOALS) 121PHONY += $(MAKECMDGOALS)
120 122
121$(filter-out _all,$(MAKECMDGOALS)) _all: 123$(filter-out _all,$(MAKECMDGOALS)) _all: