]> git.hungrycats.org Git - linux/commitdiff
kbuild: Add a bug trap for people playing with SUBDIRS too much
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sat, 8 Feb 2003 08:33:21 +0000 (02:33 -0600)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sat, 8 Feb 2003 08:33:21 +0000 (02:33 -0600)
If SUBDIRS is set manually on the command line, the contents of
.tmp_versions are not deleted before descending and can accumulate
stale entries. Print a warning if that case is detected, but deal with
it gracefully.

scripts/Makefile.modver

index 0c3f27ce764fa947bd2763d60c13af7207c79f51..0c2a5df8fc87862a3b18a0fa17b874dfc1ab760f 100644 (file)
@@ -9,7 +9,12 @@ include scripts/Makefile.lib
 
 #
 
-modules := $(shell cd $(MODVERDIR); cat *.mod)
+__modules := $(shell cd $(MODVERDIR); cat *.mod)
+modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
+
+ifneq ($(filter-out $(modules),$(__modules)),)
+  $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS, don't complain if something goes wrong.)
+endif
 
 __modversions: $(modules)
        @: