summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--Rules.make13
2 files changed, 9 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index a0f626123002..0acd5d4f62b7 100644
--- a/Makefile
+++ b/Makefile
@@ -269,8 +269,6 @@ prepare: .hdepend include/config/MARKER
include/asm:
@echo 'Making asm->asm-$(ARCH) symlink'
@ln -s asm-$(ARCH) $@
- @echo 'Making directory include/linux/modules'
- @mkdir include/linux/modules
# Split autoconf.h into include/linux/config/*
@@ -346,9 +344,9 @@ include/linux/modversions.h: FORCE
@(echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
- cd $(TOPDIR)/include/linux/modules; \
- for f in *.ver; do \
- if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \
+ cd $(TOPDIR)/include/linux; \
+ for f in `find modules -name \*.ver`; do \
+ echo "#include <linux/$${f}>"; \
done; \
echo "#endif"; \
) > $@.tmp
diff --git a/Rules.make b/Rules.make
index 161092673672..60aab0a38c91 100644
--- a/Rules.make
+++ b/Rules.make
@@ -303,8 +303,7 @@ script:
ifdef CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" ""
-MODINCL := $(TOPDIR)/include/linux/modules
-MODPREFIX := $(subst /,-,$(RELDIR))__
+MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
#
# Added the SMP separator to stop module accidents between uniprocessor
@@ -320,21 +319,21 @@ endif
# We don't track dependencies for .ver files, so we FORCE to check
# them always (i.e. always at "make dep" time).
-quiet_cmd_create_ver = Creating $@
+quiet_cmd_create_ver = Creating include/linux/modules/$(RELDIR)/$*.ver
cmd_create_ver = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $< | \
$(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
-$(MODINCL)/$(MODPREFIX)%.ver: %.c FORCE
- @echo $(cmd_create_ver)
+$(MODVERDIR)/%.ver: %.c FORCE
+ @mkdir -p $(dir $@)
@$(call cmd,cmd_create_ver)
@if [ -r $@ ] && cmp -s $@ $@.tmp; then \
- echo $@ is unchanged; rm -f $@.tmp; \
+ rm -f $@.tmp; \
else \
mv -f $@.tmp $@; \
fi
# updates .ver files but not modversions.h
-fastdep: $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver))
+fastdep: $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
endif # export-objs