aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build27
1 files changed, 16 insertions, 11 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index c33e62bde6b0..e48e60da3040 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -4,17 +4,18 @@
4 4
5src := $(obj) 5src := $(obj)
6 6
7.PHONY: __build 7PHONY := __build
8__build: 8__build:
9 9
10# Read .config if it exist, otherwise ignore 10# Read .config if it exist, otherwise ignore
11-include .config 11-include .config
12 12
13include scripts/Kbuild.include
14
13# The filename Kbuild has precedence over Makefile 15# The filename Kbuild has precedence over Makefile
14kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 16kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
15include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 17include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
16 18
17include scripts/Kbuild.include
18include scripts/Makefile.lib 19include scripts/Makefile.lib
19 20
20ifdef host-progs 21ifdef host-progs
@@ -128,7 +129,7 @@ $(multi-objs-y:.o=.s) : modname = $(modname-multi)
128$(multi-objs-y:.o=.lst) : modname = $(modname-multi) 129$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
129 130
130quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ 131quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
131cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< 132cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
132 133
133%.s: %.c FORCE 134%.s: %.c FORCE
134 $(call if_changed_dep,cc_s_c) 135 $(call if_changed_dep,cc_s_c)
@@ -165,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
165cmd_modversions = \ 166cmd_modversions = \
166 if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ 167 if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
167 $(CPP) -D__GENKSYMS__ $(c_flags) $< \ 168 $(CPP) -D__GENKSYMS__ $(c_flags) $< \
168 | $(GENKSYMS) \ 169 | $(GENKSYMS) -a $(ARCH) \
169 > $(@D)/.tmp_$(@F:.o=.ver); \ 170 > $(@D)/.tmp_$(@F:.o=.ver); \
170 \ 171 \
171 $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ 172 $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
@@ -177,12 +178,10 @@ cmd_modversions = \
177endif 178endif
178 179
179define rule_cc_o_c 180define rule_cc_o_c
180 $(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \ 181 $(call echo-cmd,checksrc) $(cmd_checksrc) \
181 $(cmd_checksrc) \ 182 $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
182 $(if $($(quiet)cmd_cc_o_c),echo ' $(call escsq,$($(quiet)cmd_cc_o_c))';) \
183 $(cmd_cc_o_c); \
184 $(cmd_modversions) \ 183 $(cmd_modversions) \
185 scripts/basic/fixdep $(depfile) $@ '$(call escsq,$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp; \ 184 scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp; \
186 rm -f $(depfile); \ 185 rm -f $(depfile); \
187 mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd 186 mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
188endef 187endef
@@ -309,14 +308,14 @@ targets += $(multi-used-y) $(multi-used-m)
309# Descending 308# Descending
310# --------------------------------------------------------------------------- 309# ---------------------------------------------------------------------------
311 310
312.PHONY: $(subdir-ym) 311PHONY += $(subdir-ym)
313$(subdir-ym): 312$(subdir-ym):
314 $(Q)$(MAKE) $(build)=$@ 313 $(Q)$(MAKE) $(build)=$@
315 314
316# Add FORCE to the prequisites of a target to force it to be always rebuilt. 315# Add FORCE to the prequisites of a target to force it to be always rebuilt.
317# --------------------------------------------------------------------------- 316# ---------------------------------------------------------------------------
318 317
319.PHONY: FORCE 318PHONY += FORCE
320 319
321FORCE: 320FORCE:
322 321
@@ -331,3 +330,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
331ifneq ($(cmd_files),) 330ifneq ($(cmd_files),)
332 include $(cmd_files) 331 include $(cmd_files)
333endif 332endif
333
334
335# Declare the contents of the .PHONY variable as phony. We keep that
336# information in a variable se we can use it in if_changed and friends.
337
338.PHONY: $(PHONY)