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
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
......
......@@ -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
......
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