aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2009-12-07 10:38:33 -0500
committerMichal Marek <mmarek@suse.cz>2009-12-12 07:08:16 -0500
commitbc081dd6e9f622c73334dc465359168543ccaabf (patch)
treec015f5eba8e1bc79b2eb3861b8e95f15ee6d047d /Makefile
parent6299fee7b84ac7b4429b4e2787b99470a89cd5f5 (diff)
kbuild: generate modules.builtin
To make it easier for module-init-tools and scripts like mkinitrd to distinguish builtin and missing modules, install a modules.builtin file listing all builtin modules. This is done by generating an additional config file (tristate.conf) with tristate options set to uppercase 'Y' or 'M'. If we source that config file, the builtin modules appear in obj-Y. Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index aa608c2959f5..391fcb396324 100644
--- a/Makefile
+++ b/Makefile
@@ -464,7 +464,7 @@ ifeq ($(KBUILD_EXTMOD),)
464# Carefully list dependencies so we do not try to build scripts twice 464# Carefully list dependencies so we do not try to build scripts twice
465# in parallel 465# in parallel
466PHONY += scripts 466PHONY += scripts
467scripts: scripts_basic include/config/auto.conf 467scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
468 $(Q)$(MAKE) $(build)=$(@) 468 $(Q)$(MAKE) $(build)=$(@)
469 469
470# Objects we will link into vmlinux / subdirs we need to visit 470# Objects we will link into vmlinux / subdirs we need to visit
@@ -491,7 +491,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
491# with it and forgot to run make oldconfig. 491# with it and forgot to run make oldconfig.
492# if auto.conf.cmd is missing then we are probably in a cleaned tree so 492# if auto.conf.cmd is missing then we are probably in a cleaned tree so
493# we execute the config step to be sure to catch updated Kconfig files 493# we execute the config step to be sure to catch updated Kconfig files
494include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 494include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
495 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 495 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
496else 496else
497# external modules needs include/generated/autoconf.h and include/config/auto.conf 497# external modules needs include/generated/autoconf.h and include/config/auto.conf
@@ -876,6 +876,9 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
876PHONY += $(vmlinux-dirs) 876PHONY += $(vmlinux-dirs)
877$(vmlinux-dirs): prepare scripts 877$(vmlinux-dirs): prepare scripts
878 $(Q)$(MAKE) $(build)=$@ 878 $(Q)$(MAKE) $(build)=$@
879ifdef CONFIG_MODULES
880 $(Q)$(MAKE) $(modbuiltin)=$@
881endif
879 882
880# Build the kernel release string 883# Build the kernel release string
881# 884#
@@ -1080,6 +1083,7 @@ all: modules
1080PHONY += modules 1083PHONY += modules
1081modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1084modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
1082 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1085 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1086 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
1083 @$(kecho) ' Building modules, stage 2.'; 1087 @$(kecho) ' Building modules, stage 2.';
1084 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1088 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1085 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild 1089 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
@@ -1109,6 +1113,7 @@ _modinst_:
1109 ln -s $(objtree) $(MODLIB)/build ; \ 1113 ln -s $(objtree) $(MODLIB)/build ; \
1110 fi 1114 fi
1111 @cp -f $(objtree)/modules.order $(MODLIB)/ 1115 @cp -f $(objtree)/modules.order $(MODLIB)/
1116 @cp -f $(objtree)/modules.builtin $(MODLIB)/
1112 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1117 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1113 1118
1114# This depmod is only for convenience to give the initial 1119# This depmod is only for convenience to give the initial
@@ -1169,7 +1174,7 @@ clean: archclean $(clean-dirs)
1169 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1174 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
1170 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1175 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1171 -o -name '*.symtypes' -o -name 'modules.order' \ 1176 -o -name '*.symtypes' -o -name 'modules.order' \
1172 -o -name '.tmp_*.o.*' \ 1177 -o modules.order -o -name '.tmp_*.o.*' \
1173 -o -name '*.gcno' \) -type f -print | xargs rm -f 1178 -o -name '*.gcno' \) -type f -print | xargs rm -f
1174 1179
1175# mrproper - Delete all generated files, including .config 1180# mrproper - Delete all generated files, including .config
@@ -1367,7 +1372,8 @@ $(clean-dirs):
1367 1372
1368clean: rm-dirs := $(MODVERDIR) 1373clean: rm-dirs := $(MODVERDIR)
1369clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ 1374clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
1370 $(KBUILD_EXTMOD)/modules.order 1375 $(KBUILD_EXTMOD)/modules.order \
1376 $(KBUILD_EXTMOD)/modules.builtin
1371clean: $(clean-dirs) 1377clean: $(clean-dirs)
1372 $(call cmd,rmdirs) 1378 $(call cmd,rmdirs)
1373 $(call cmd,rmfiles) 1379 $(call cmd,rmfiles)