1 # ==========================================================================
2 # Generating modules.builtin
3 # ==========================================================================
10 # Read auto2.conf which sets tristate variables to 'Y' instead of 'y'
11 # That way, we get the list of built-in modules in obj-Y
12 -include include/config/auto2.conf
14 include scripts/Kbuild.include
16 # The filename Kbuild has precedence over Makefile
17 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
18 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
19 include $(kbuild-file)
21 include scripts/Makefile.lib
23 modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym))
24 modbuiltin-mods := $(filter %.ko, $(obj-Y:.o=.ko))
25 modbuiltin-target := $(obj)/modules.builtin
27 __modbuiltin: $(modbuiltin-target) $(subdir-ym)
31 for m in $(modbuiltin-mods); do echo kernel/$$m; done; \
32 cat /dev/null $(modbuiltin-subdirs);
34 $(modbuiltin-target): $(subdir-ym) FORCE
35 $(Q)($(modbuiltin-cmds)) > $@
42 # ---------------------------------------------------------------------------
46 $(Q)$(MAKE) $(modbuiltin)=$@
49 # Declare the contents of the .PHONY variable as phony. We keep that
50 # information in a variable se we can use it in if_changed and friends.