Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: move cmd_cc_o_c and cmd_as_o_S to scripts/Malefile.lib

The cmd_cc_o_c and cmd_as_o_S macros are duplicated in
scripts/Makefile.{build,modfinal,vmlinux}.

This commit factors them out to scripts/Makefile.lib.

No functional changes are intended.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+13 -21
-8
scripts/Makefile.build
··· 135 135 cmd_ld_single_m = $(if $(is-single-obj-m), ; $(LD) $(ld_flags) -r -o $(tmp-target) $@; mv $(tmp-target) $@) 136 136 endif 137 137 138 - quiet_cmd_cc_o_c = CC $(quiet_modtag) $@ 139 - cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< \ 140 - $(cmd_ld_single_m) \ 141 - $(cmd_objtool) 142 - 143 138 ifdef CONFIG_MODVERSIONS 144 139 # When module versioning is enabled the following steps are executed: 145 140 # o compile a <file>.o from <file>.c ··· 316 321 317 322 $(obj)/%.s: $(obj)/%.S FORCE 318 323 $(call if_changed_dep,cpp_s_S) 319 - 320 - quiet_cmd_as_o_S = AS $(quiet_modtag) $@ 321 - cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< $(cmd_objtool) 322 324 323 325 ifdef CONFIG_ASM_MODVERSIONS 324 326
+12
scripts/Makefile.lib
··· 298 298 $(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3)))) 299 299 endef 300 300 301 + # Build commands 302 + # =========================================================================== 303 + # These are shared by some Makefile.* files. 304 + 305 + quiet_cmd_cc_o_c = CC $(quiet_modtag) $@ 306 + cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< \ 307 + $(cmd_ld_single_m) \ 308 + $(cmd_objtool) 309 + 310 + quiet_cmd_as_o_S = AS $(quiet_modtag) $@ 311 + cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< $(cmd_objtool) 312 + 301 313 # Copy a file 302 314 # =========================================================================== 303 315 # 'cp' preserves permissions. If you use it to copy a file in read-only srctree,
+1 -5
scripts/Makefile.modfinal
··· 8 8 9 9 include $(objtree)/include/config/auto.conf 10 10 include $(srctree)/scripts/Kbuild.include 11 - 12 - # for c_flags 13 11 include $(srctree)/scripts/Makefile.lib 14 12 15 13 # find all modules listed in modules.order ··· 21 23 part-of-module = y 22 24 GCOV_PROFILE := n 23 25 KCSAN_SANITIZE := n 24 - 25 - quiet_cmd_cc_o_c = CC [M] $@ 26 - cmd_cc_o_c = $(CC) $(filter-out $(CC_FLAGS_CFI), $(c_flags)) -c -o $@ $< 26 + ccflags-remove-y := $(CC_FLAGS_CFI) 27 27 28 28 %.mod.o: %.mod.c FORCE 29 29 $(call if_changed_dep,cc_o_c)
-8
scripts/Makefile.vmlinux
··· 5 5 6 6 include include/config/auto.conf 7 7 include $(srctree)/scripts/Kbuild.include 8 - 9 - # for c_flags 10 8 include $(srctree)/scripts/Makefile.lib 11 9 12 10 targets := 13 11 14 - quiet_cmd_cc_o_c = CC $@ 15 - cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< 16 - 17 12 %.o: %.c FORCE 18 13 $(call if_changed_dep,cc_o_c) 19 - 20 - quiet_cmd_as_o_S = AS $@ 21 - cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< 22 14 23 15 %.o: %.S FORCE 24 16 $(call if_changed_dep,as_o_S)