mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
kbuild: simplify use of genksyms
Avoid duplicating long list of options in two places Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
a1d94aa556
commit
37a8d9f67f
@ -151,17 +151,17 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
|
|||||||
$(obj)/%.i: $(src)/%.c FORCE
|
$(obj)/%.i: $(src)/%.c FORCE
|
||||||
$(call if_changed_dep,cc_i_c)
|
$(call if_changed_dep,cc_i_c)
|
||||||
|
|
||||||
|
cmd_gensymtypes = \
|
||||||
|
$(CPP) -D__GENKSYMS__ $(c_flags) $< | \
|
||||||
|
$(GENKSYMS) -T $@ -a $(ARCH) \
|
||||||
|
$(if $(KBUILD_PRESERVE),-p) \
|
||||||
|
$(if $(1),-r $(firstword $(wildcard $(@:.symtypes=.symref) /dev/null)))
|
||||||
|
|
||||||
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
|
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
|
||||||
cmd_cc_symtypes_c = \
|
cmd_cc_symtypes_c = \
|
||||||
set -e; \
|
set -e; \
|
||||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
$(call cmd_gensymtypes, true) >/dev/null; \
|
||||||
| $(GENKSYMS) -T $@ \
|
test -s $@ || rm -f $@
|
||||||
-r $(firstword $(wildcard \
|
|
||||||
$(@:.symtypes=.symref) /dev/null)) \
|
|
||||||
$(if $(KBUILD_PRESERVE),-p) \
|
|
||||||
-a $(ARCH) \
|
|
||||||
>/dev/null; \
|
|
||||||
test -s $@ || rm -f $@
|
|
||||||
|
|
||||||
$(obj)/%.symtypes : $(src)/%.c FORCE
|
$(obj)/%.symtypes : $(src)/%.c FORCE
|
||||||
$(call cmd,cc_symtypes_c)
|
$(call cmd,cc_symtypes_c)
|
||||||
@ -191,14 +191,8 @@ else
|
|||||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
|
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
|
||||||
cmd_modversions = \
|
cmd_modversions = \
|
||||||
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
|
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
|
||||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
$(call cmd_gensymtypes, $(KBUILD_SYMTYPES)) \
|
||||||
| $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
|
> $(@D)/.tmp_$(@F:.o=.ver); \
|
||||||
-T $(@:.o=.symtypes)) \
|
|
||||||
-r $(firstword $(wildcard \
|
|
||||||
$(@:.o=.symref) /dev/null)) \
|
|
||||||
$(if $(KBUILD_PRESERVE),-p) \
|
|
||||||
-a $(ARCH) \
|
|
||||||
> $(@D)/.tmp_$(@F:.o=.ver); \
|
|
||||||
\
|
\
|
||||||
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
|
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
|
||||||
-T $(@D)/.tmp_$(@F:.o=.ver); \
|
-T $(@D)/.tmp_$(@F:.o=.ver); \
|
||||||
|
Loading…
Reference in New Issue
Block a user