Commit 81106eac authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Remove obsolete CONFIG_MODVERSIONS cruft

Though the CONFIG_MODVERSIONS option was removed with rusty's module
rewrite and the associated code broken, a lot of that code was still
living on here and there. Now it's gone for good.
parent 61cfcb3d
......@@ -380,7 +380,7 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS): .hdepend prepare
$(SUBDIRS): prepare
$(Q)$(MAKE) $(build)=$@
# Things we need done before we descend to build or make
......@@ -471,61 +471,11 @@ include/linux/version.h: Makefile
) > $@.tmp
@$(update-if-changed)
# Generate module versions
# ---------------------------------------------------------------------------
# The targets are still named depend / dep for traditional
# reasons, but the only thing we do here is generating
# the module version checksums.
.PHONY: depend dep $(patsubst %,_sfdep_%,$(SUBDIRS))
depend dep: .hdepend
# .hdepend is our (misnomed) marker for whether we've
# generated module versions
make-versions := $(strip $(if $(filter dep depend,$(MAKECMDGOALS)),1) \
$(if $(wildcard .hdepend),,1))
.hdepend: prepare FORCE
ifneq ($(make-versions),)
@$(MAKE) include/linux/modversions.h
@touch $@
endif
ifdef CONFIG_MODVERSIONS
# Update modversions.h, but only if it would change.
.PHONY: __rm_tmp_export-objs
__rm_tmp_export-objs:
@rm -rf .tmp_export-objs
include/linux/modversions.h: $(patsubst %,_modver_%,$(SUBDIRS))
@echo -n ' Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
cd .tmp_export-objs >/dev/null; \
for f in `find modules -name \*.ver -print | sort`; do \
echo "#include <linux/$${f}>"; \
done; \
echo "#endif"; \
) > $@.tmp; \
$(update-if-changed)
.PHONY: $(patsubst %, _modver_%, $(SUBDIRS))
$(patsubst %, _modver_%, $(SUBDIRS)): __rm_tmp_export-objs
$(Q)$(MAKE) -f scripts/Makefile.modver obj=$(patsubst _modver_%,%,$@)
else # !CONFIG_MODVERSIONS
.PHONY: include/linux/modversions.h
include/linux/modversions.h:
endif # CONFIG_MODVERSIONS
.PHONY: depend dep
depend dep:
@echo'*** Warning: make $@ is unnecessary now.'
# ---------------------------------------------------------------------------
# Modules
......@@ -534,10 +484,6 @@ ifdef CONFIG_MODULES
# Build modules
ifdef CONFIG_MODVERSIONS
MODFLAGS += -include include/linux/modversions.h
endif
.PHONY: modules
modules: $(SUBDIRS)
......@@ -570,6 +516,7 @@ _modinst_post:
.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
$(patsubst %, _modinst_%, $(SUBDIRS)) :
$(Q)$(MAKE) -rR -f scripts/Makefile.modinst obj=$(patsubst _modinst_%,%,$@)
else # CONFIG_MODULES
# Modules not configured
......@@ -620,7 +567,7 @@ spec:
rpm: clean spec
find . $(RCS_FIND_IGNORE) \
\( -size 0 -o -name .depend -o -name .hdepend \) \
\( -size 0 -o -name .depend -o -name .hdepend\) \
-type f -print | xargs rm -f
set -e; \
cd $(TOPDIR)/.. ; \
......
......@@ -34,14 +34,9 @@ obj-m := $(filter-out %/, $(obj-m))
subdir-ym := $(sort $(subdir-y) $(subdir-m))
# export.o is never a composite object, since $(export-objs) has a
# fixed meaning (== objects which EXPORT_SYMBOL())
__obj-y = $(filter-out export.o,$(obj-y))
__obj-m = $(filter-out export.o,$(obj-m))
# if $(foo-objs) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used := $(multi-used-y) $(multi-used-m)
single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))
......@@ -59,9 +54,6 @@ subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(EXTRA_TARGETS)
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
# Only build module versions for files which are selected to be built
export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
# C code
# Executables compiled from a single .c file
host-csingle := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
......@@ -96,7 +88,6 @@ EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
build-targets := $(addprefix $(obj)/,$(build-targets))
obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m))
export-objs := $(addprefix $(obj)/,$(export-objs))
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
......@@ -217,7 +208,6 @@ if_changed_rule = $(if $(strip $? \
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \
mkdir -p $(dir $@); \
$(rule_$(1)))
# If quiet is set, only print short version of command
......
......@@ -2,121 +2,3 @@
# Module versions
# ===========================================================================
src := $(obj)
MODVERDIR := include/linux/modules
.PHONY: modver
modver:
include .config
include $(obj)/Makefile
include scripts/Makefile.lib
# ===========================================================================
ifeq ($(strip $(export-objs)),)
# If we don't export any symbols in this dir, just descend
# ---------------------------------------------------------------------------
modver: $(subdir-ym)
@:
else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
#
# Added the SMP separator to stop module accidents between uniprocessor
# and SMP Intel boxes - AC - from bits by Michael Chastain
#
ifdef CONFIG_SMP
genksyms_smp_prefix := -p smp_
else
genksyms_smp_prefix :=
endif
# Don't include modversions.h, we're just about to generate it here.
CFLAGS_MODULE := $(filter-out -include include/linux/modversions.h,$(CFLAGS_MODULE))
$(addprefix $(MODVERDIR)/,$(real-objs-y:.o=.ver)): modkern_cflags := $(CFLAGS_KERNEL)
$(addprefix $(MODVERDIR)/,$(real-objs-m:.o=.ver)): modkern_cflags := $(CFLAGS_MODULE)
$(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver)): export_flags := -D__GENKSYMS__
# Default for not multi-part modules
modname = $(*F)
$(addprefix $(MODVERDIR)/,$(multi-objs:.o=.ver)) : modname = $(modname-multi)
# Our objects only depend on modversions.h, not on the individual .ver
# files (fix-dep filters them), so touch modversions.h if any of the .ver
# files changes
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$*.ver
cmd_cc_ver_c = $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
-k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
# Okay, let's explain what's happening in rule_make_cc_ver_c:
# o echo the command
# o execute the command
# o If the $(CPP) fails, we won't notice because it's output is piped
# to $(GENKSYMS) which does not fail. We recognize this case by
# looking if the generated $(depfile) exists, though.
# o If the .ver file changed, touch modversions.h, which is our marker
# of any changed .ver files.
# o Move command line and deps into their normal .*.cmd place.
define rule_cc_ver_c
$(if $($(quiet)cmd_cc_ver_c),echo ' $($(quiet)cmd_cc_ver_c)';) \
$(cmd_cc_ver_c); \
if [ ! -r $(depfile) ]; then exit 1; fi; \
scripts/fixdep $(depfile) $@ '$(cmd_cc_ver_c)' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \
if [ ! -r $@ ] || cmp -s $@ $@.tmp; then \
touch include/linux/modversions.h; \
fi; \
mv -f $@.tmp $@
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
endef
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
$(MODVERDIR)/%.ver: %.c FORCE
@$(call if_changed_rule,cc_ver_c)
modver: $(targets) $(subdir-ym)
@mkdir -p $(dir $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver)))
@touch $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver))
endif # export-objs
# Descending
# ---------------------------------------------------------------------------
.PHONY: $(subdir-ym)
$(subdir-ym):
$(Q)$(MAKE) -f scripts/Makefile.modver obj=$@
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
.PHONY: FORCE
FORCE:
# Read all saved command lines and dependencies for the $(targets) we
# may be building above, using $(if_changed{,_dep}). As an
# optimization, we don't need to read them if the target does not
# exist, we will rebuild anyway in that case.
targets := $(wildcard $(sort $(targets)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
endif
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