kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
authorMichal Marek <mmarek@suse.cz>
Mon, 16 May 2011 14:37:34 +0000 (16:37 +0200)
committerMichal Marek <mmarek@suse.cz>
Mon, 16 May 2011 14:39:28 +0000 (16:39 +0200)
Based on a patch by Rabin Vincent.

Fix building with KBUILD_NOCMDDEP=1, which currently does not work
because it does not build built-in.o with no dependencies:

  LD      fs/notify/built-in.o
ld: cannot find fs/notify/dnotify/built-in.o: No such file or directory
ld: cannot find fs/notify/inotify/built-in.o: No such file or directory
ld: cannot find fs/notify/fanotify/built-in.o: No such file or directory

Reported-and-tested-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/Kbuild.include

index c034dd7161a6a257f3a5746ddba849cf43539790..be39cd1c74cff6009eac1120c1eafe18085ed37e 100644 (file)
@@ -197,6 +197,8 @@ ifneq ($(KBUILD_NOCMDDEP),1)
 # User may override this check using make KBUILD_NOCMDDEP=1
 arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
                     $(filter-out $(cmd_$@),   $(cmd_$(1))) )
+else
+arg-check = $(if $(strip $(cmd_$@)),,1)
 endif
 
 # >'< substitution is for echo to work,