Commit 81e93fe6 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Use deep directory structure for include/linux/modules

We used to force the obvious deep structure of all objects which
export symbols into a flat list in include/linux/modules. This
initially caused the restriction the no two exporting objects could
have the same name (Ever wondered why there's ksyms.c and
i386_ksyms.c?)

With the ALSA merge this restriction was mostly lifted by some hack,
but some cases still don't work right (Hi XFS). As it's much cleaner
to just use a normal tree under include/linux/modules, reflecting the
source tree, we now do just that.
parent 04bd7217
...@@ -269,8 +269,6 @@ prepare: .hdepend include/config/MARKER ...@@ -269,8 +269,6 @@ prepare: .hdepend include/config/MARKER
include/asm: include/asm:
@echo 'Making asm->asm-$(ARCH) symlink' @echo 'Making asm->asm-$(ARCH) symlink'
@ln -s asm-$(ARCH) $@ @ln -s asm-$(ARCH) $@
@echo 'Making directory include/linux/modules'
@mkdir include/linux/modules
# Split autoconf.h into include/linux/config/* # Split autoconf.h into include/linux/config/*
...@@ -346,9 +344,9 @@ include/linux/modversions.h: FORCE ...@@ -346,9 +344,9 @@ include/linux/modversions.h: FORCE
@(echo "#ifndef _LINUX_MODVERSIONS_H";\ @(echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \ echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \ echo "#include <linux/modsetver.h>"; \
cd $(TOPDIR)/include/linux/modules; \ cd $(TOPDIR)/include/linux; \
for f in *.ver; do \ for f in `find modules -name \*.ver`; do \
if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \ echo "#include <linux/$${f}>"; \
done; \ done; \
echo "#endif"; \ echo "#endif"; \
) > $@.tmp ) > $@.tmp
......
...@@ -303,8 +303,7 @@ script: ...@@ -303,8 +303,7 @@ script:
ifdef CONFIG_MODVERSIONS ifdef CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" "" ifneq "$(strip $(export-objs))" ""
MODINCL := $(TOPDIR)/include/linux/modules MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
MODPREFIX := $(subst /,-,$(RELDIR))__
# #
# Added the SMP separator to stop module accidents between uniprocessor # Added the SMP separator to stop module accidents between uniprocessor
...@@ -320,21 +319,21 @@ endif ...@@ -320,21 +319,21 @@ endif
# We don't track dependencies for .ver files, so we FORCE to check # We don't track dependencies for .ver files, so we FORCE to check
# them always (i.e. always at "make dep" time). # 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__ $< | \ cmd_create_ver = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $< | \
$(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
$(MODINCL)/$(MODPREFIX)%.ver: %.c FORCE $(MODVERDIR)/%.ver: %.c FORCE
@echo $(cmd_create_ver) @mkdir -p $(dir $@)
@$(call cmd,cmd_create_ver) @$(call cmd,cmd_create_ver)
@if [ -r $@ ] && cmp -s $@ $@.tmp; then \ @if [ -r $@ ] && cmp -s $@ $@.tmp; then \
echo $@ is unchanged; rm -f $@.tmp; \ rm -f $@.tmp; \
else \ else \
mv -f $@.tmp $@; \ mv -f $@.tmp $@; \
fi fi
# updates .ver files but not modversions.h # 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 endif # export-objs
......
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