]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/blob - scripts/Makefile.modbuiltin
Revert "HACK: ARM: dts: dra7-ipu-common: Revert to CMA pools for IPU early boots"
[rpmsg/rpmsg.git] / scripts / Makefile.modbuiltin
1 # SPDX-License-Identifier: GPL-2.0
2 # ==========================================================================
3 # Generating modules.builtin
4 # ==========================================================================
6 src := $(obj)
8 PHONY := __modbuiltin
9 __modbuiltin:
11 include include/config/auto.conf
12 # tristate.conf sets tristate variables to uppercase 'Y' or 'M'
13 # That way, we get the list of built-in modules in obj-Y
14 include include/config/tristate.conf
16 include scripts/Kbuild.include
18 ifneq ($(KBUILD_SRC),)
19 # Create output directory if not already present
20 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
21 endif
23 # The filename Kbuild has precedence over Makefile
24 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
25 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
26 include $(kbuild-file)
28 include scripts/Makefile.lib
29 __subdir-Y     := $(patsubst %/,%,$(filter %/, $(obj-Y)))
30 subdir-Y       += $(__subdir-Y)
31 subdir-ym      := $(sort $(subdir-y) $(subdir-Y) $(subdir-m))
32 subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
33 obj-Y          := $(addprefix $(obj)/,$(obj-Y))
35 modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym))
36 modbuiltin-mods    := $(filter %.ko, $(obj-Y:.o=.ko))
37 modbuiltin-target  := $(obj)/modules.builtin
39 __modbuiltin: $(modbuiltin-target) $(subdir-ym)
40         @:
42 $(modbuiltin-target): $(subdir-ym) FORCE
43         $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done;     \
44         cat /dev/null $(modbuiltin-subdirs)) > $@
46 PHONY += FORCE
48 FORCE:
50 # Descending
51 # ---------------------------------------------------------------------------
53 PHONY += $(subdir-ym)
54 $(subdir-ym):
55         $(Q)$(MAKE) $(modbuiltin)=$@
57 .PHONY: $(PHONY)