mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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>
This commit is contained in:
parent
91ca8be3c4
commit
000e22a80d
@ -135,11 +135,6 @@ ifdef CONFIG_LTO_CLANG
|
|||||||
cmd_ld_single_m = $(if $(is-single-obj-m), ; $(LD) $(ld_flags) -r -o $(tmp-target) $@; mv $(tmp-target) $@)
|
cmd_ld_single_m = $(if $(is-single-obj-m), ; $(LD) $(ld_flags) -r -o $(tmp-target) $@; mv $(tmp-target) $@)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
|
||||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< \
|
|
||||||
$(cmd_ld_single_m) \
|
|
||||||
$(cmd_objtool)
|
|
||||||
|
|
||||||
ifdef CONFIG_MODVERSIONS
|
ifdef CONFIG_MODVERSIONS
|
||||||
# When module versioning is enabled the following steps are executed:
|
# When module versioning is enabled the following steps are executed:
|
||||||
# o compile a <file>.o from <file>.c
|
# o compile a <file>.o from <file>.c
|
||||||
@ -322,9 +317,6 @@ cmd_cpp_s_S = $(CPP) $(a_flags) -o $@ $<
|
|||||||
$(obj)/%.s: $(obj)/%.S FORCE
|
$(obj)/%.s: $(obj)/%.S FORCE
|
||||||
$(call if_changed_dep,cpp_s_S)
|
$(call if_changed_dep,cpp_s_S)
|
||||||
|
|
||||||
quiet_cmd_as_o_S = AS $(quiet_modtag) $@
|
|
||||||
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< $(cmd_objtool)
|
|
||||||
|
|
||||||
ifdef CONFIG_ASM_MODVERSIONS
|
ifdef CONFIG_ASM_MODVERSIONS
|
||||||
|
|
||||||
# versioning matches the C process described above, with difference that
|
# versioning matches the C process described above, with difference that
|
||||||
|
@ -298,6 +298,18 @@ $(foreach m, $1, \
|
|||||||
$(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3))))
|
$(addprefix $(obj)/, $(call suffix-search, $(patsubst $(obj)/%,%,$m), $2, $3))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Build commands
|
||||||
|
# ===========================================================================
|
||||||
|
# These are shared by some Makefile.* files.
|
||||||
|
|
||||||
|
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
||||||
|
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< \
|
||||||
|
$(cmd_ld_single_m) \
|
||||||
|
$(cmd_objtool)
|
||||||
|
|
||||||
|
quiet_cmd_as_o_S = AS $(quiet_modtag) $@
|
||||||
|
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< $(cmd_objtool)
|
||||||
|
|
||||||
# Copy a file
|
# Copy a file
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# 'cp' preserves permissions. If you use it to copy a file in read-only srctree,
|
# 'cp' preserves permissions. If you use it to copy a file in read-only srctree,
|
||||||
|
@ -8,8 +8,6 @@ __modfinal:
|
|||||||
|
|
||||||
include $(objtree)/include/config/auto.conf
|
include $(objtree)/include/config/auto.conf
|
||||||
include $(srctree)/scripts/Kbuild.include
|
include $(srctree)/scripts/Kbuild.include
|
||||||
|
|
||||||
# for c_flags
|
|
||||||
include $(srctree)/scripts/Makefile.lib
|
include $(srctree)/scripts/Makefile.lib
|
||||||
|
|
||||||
# find all modules listed in modules.order
|
# find all modules listed in modules.order
|
||||||
@ -23,9 +21,7 @@ modname = $(notdir $(@:.mod.o=))
|
|||||||
part-of-module = y
|
part-of-module = y
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
KCSAN_SANITIZE := n
|
KCSAN_SANITIZE := n
|
||||||
|
ccflags-remove-y := $(CC_FLAGS_CFI)
|
||||||
quiet_cmd_cc_o_c = CC [M] $@
|
|
||||||
cmd_cc_o_c = $(CC) $(filter-out $(CC_FLAGS_CFI), $(c_flags)) -c -o $@ $<
|
|
||||||
|
|
||||||
%.mod.o: %.mod.c FORCE
|
%.mod.o: %.mod.c FORCE
|
||||||
$(call if_changed_dep,cc_o_c)
|
$(call if_changed_dep,cc_o_c)
|
||||||
|
@ -5,21 +5,13 @@ __default: vmlinux
|
|||||||
|
|
||||||
include include/config/auto.conf
|
include include/config/auto.conf
|
||||||
include $(srctree)/scripts/Kbuild.include
|
include $(srctree)/scripts/Kbuild.include
|
||||||
|
|
||||||
# for c_flags
|
|
||||||
include $(srctree)/scripts/Makefile.lib
|
include $(srctree)/scripts/Makefile.lib
|
||||||
|
|
||||||
targets :=
|
targets :=
|
||||||
|
|
||||||
quiet_cmd_cc_o_c = CC $@
|
|
||||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.c FORCE
|
%.o: %.c FORCE
|
||||||
$(call if_changed_dep,cc_o_c)
|
$(call if_changed_dep,cc_o_c)
|
||||||
|
|
||||||
quiet_cmd_as_o_S = AS $@
|
|
||||||
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.S FORCE
|
%.o: %.S FORCE
|
||||||
$(call if_changed_dep,as_o_S)
|
$(call if_changed_dep,as_o_S)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user