diff options
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 27 |
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 | ||
5 | src := $(obj) | 5 | src := $(obj) |
6 | 6 | ||
7 | .PHONY: __build | 7 | PHONY := __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 | ||
13 | include scripts/Kbuild.include | ||
14 | |||
13 | # The filename Kbuild has precedence over Makefile | 15 | # The filename Kbuild has precedence over Makefile |
14 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) | 16 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) |
15 | include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) | 17 | include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) |
16 | 18 | ||
17 | include scripts/Kbuild.include | ||
18 | include scripts/Makefile.lib | 19 | include scripts/Makefile.lib |
19 | 20 | ||
20 | ifdef host-progs | 21 | ifdef 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 | ||
130 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ | 131 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ |
131 | cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< | 132 | cmd_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) $< | |||
165 | cmd_modversions = \ | 166 | cmd_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 = \ | |||
177 | endif | 178 | endif |
178 | 179 | ||
179 | define rule_cc_o_c | 180 | define 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 |
188 | endef | 187 | endef |
@@ -309,14 +308,14 @@ targets += $(multi-used-y) $(multi-used-m) | |||
309 | # Descending | 308 | # Descending |
310 | # --------------------------------------------------------------------------- | 309 | # --------------------------------------------------------------------------- |
311 | 310 | ||
312 | .PHONY: $(subdir-ym) | 311 | PHONY += $(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 | 318 | PHONY += FORCE |
320 | 319 | ||
321 | FORCE: | 320 | FORCE: |
322 | 321 | ||
@@ -331,3 +330,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) | |||
331 | ifneq ($(cmd_files),) | 330 | ifneq ($(cmd_files),) |
332 | include $(cmd_files) | 331 | include $(cmd_files) |
333 | endif | 332 | endif |
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) | ||