Commit 66e01461 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Add a bug trap for people playing with SUBDIRS too much

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.
parent 0434f166
...@@ -9,7 +9,12 @@ include scripts/Makefile.lib ...@@ -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) __modversions: $(modules)
@: @:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment