]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - scripts/Makefile.modbuiltin
WAR:media:i2c:ov5693: add flip and mirror setting
[hercules2020/nv-tegra/linux-4.4.git] / scripts / Makefile.modbuiltin
1 # ==========================================================================
2 # Generating modules.builtin
3 # ==========================================================================
4
5 src := $(obj)
6
7 PHONY := __modbuiltin
8 __modbuiltin:
9
10 -include include/config/auto.conf
11 # tristate.conf sets tristate variables to uppercase 'Y' or 'M'
12 # That way, we get the list of built-in modules in obj-Y
13 -include include/config/tristate.conf
14
15 include scripts/Kbuild.include
16
17 ifneq ($(KBUILD_SRC),)
18 # Create output directory if not already present
19 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
20 endif
21
22 # The filename Kbuild has precedence over Makefile
23 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
24 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
25 ifneq ("$(wildcard $(kbuild-file))", "")
26 include $(kbuild-file)
27 endif
28 include $(srctree)/scripts/Makefile.tegra
29
30 include scripts/Makefile.lib
31 __subdir-Y     := $(patsubst %/,%,$(filter %/, $(obj-Y)))
32 subdir-Y       += $(__subdir-Y)
33 subdir-ym      := $(sort $(subdir-y) $(subdir-Y) $(subdir-m))
34 subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
35 obj-Y          := $(addprefix $(obj)/,$(obj-Y))
36
37 modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym))
38 modbuiltin-mods    := $(filter %.ko, $(obj-Y:.o=.ko))
39 modbuiltin-target  := $(obj)/modules.builtin
40
41 __modbuiltin: $(modbuiltin-target) $(subdir-ym)
42         @:
43
44 $(modbuiltin-target): $(subdir-ym) FORCE
45         $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done;     \
46         cat /dev/null $(modbuiltin-subdirs)) > $@
47
48 PHONY += FORCE
49
50 FORCE:
51
52 # Descending
53 # ---------------------------------------------------------------------------
54
55 PHONY += $(subdir-ym)
56 $(subdir-ym):
57         $(Q)$(MAKE) $(modbuiltin)=$@
58
59
60 # Declare the contents of the .PHONY variable as phony.  We keep that
61 # information in a variable se we can use it in if_changed and friends.
62
63 .PHONY: $(PHONY)