diff options
author | Michal Marek <mmarek@suse.cz> | 2009-12-07 10:38:33 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2009-12-12 07:08:16 -0500 |
commit | bc081dd6e9f622c73334dc465359168543ccaabf (patch) | |
tree | c015f5eba8e1bc79b2eb3861b8e95f15ee6d047d /Makefile | |
parent | 6299fee7b84ac7b4429b4e2787b99470a89cd5f5 (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-- | Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 |
466 | PHONY += scripts | 466 | PHONY += scripts |
467 | scripts: scripts_basic include/config/auto.conf | 467 | scripts: 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 |
494 | include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd | 494 | include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd |
495 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig | 495 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig |
496 | else | 496 | else |
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) ; | |||
876 | PHONY += $(vmlinux-dirs) | 876 | PHONY += $(vmlinux-dirs) |
877 | $(vmlinux-dirs): prepare scripts | 877 | $(vmlinux-dirs): prepare scripts |
878 | $(Q)$(MAKE) $(build)=$@ | 878 | $(Q)$(MAKE) $(build)=$@ |
879 | ifdef CONFIG_MODULES | ||
880 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
881 | endif | ||
879 | 882 | ||
880 | # Build the kernel release string | 883 | # Build the kernel release string |
881 | # | 884 | # |
@@ -1080,6 +1083,7 @@ all: modules | |||
1080 | PHONY += modules | 1083 | PHONY += modules |
1081 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1084 | modules: $(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 | ||
1368 | clean: rm-dirs := $(MODVERDIR) | 1373 | clean: rm-dirs := $(MODVERDIR) |
1369 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ | 1374 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ |
1370 | $(KBUILD_EXTMOD)/modules.order | 1375 | $(KBUILD_EXTMOD)/modules.order \ |
1376 | $(KBUILD_EXTMOD)/modules.builtin | ||
1371 | clean: $(clean-dirs) | 1377 | clean: $(clean-dirs) |
1372 | $(call cmd,rmdirs) | 1378 | $(call cmd,rmdirs) |
1373 | $(call cmd,rmfiles) | 1379 | $(call cmd,rmfiles) |