diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-19 15:38:09 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-12-19 16:00:58 -0500 |
commit | 37a8d9f67f18de1e2cbc7387311ce22d4dbff518 (patch) | |
tree | e28527c8380584fadb6d9eab32fb031445530e03 /scripts | |
parent | a1d94aa5560dc6b06baf30ae477115b51dc25461 (diff) |
kbuild: simplify use of genksyms
Avoid duplicating long list of options in two places
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d21f0eac2e52..c1da14b9f59d 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -151,17 +151,17 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< | |||
151 | $(obj)/%.i: $(src)/%.c FORCE | 151 | $(obj)/%.i: $(src)/%.c FORCE |
152 | $(call if_changed_dep,cc_i_c) | 152 | $(call if_changed_dep,cc_i_c) |
153 | 153 | ||
154 | cmd_gensymtypes = \ | ||
155 | $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ | ||
156 | $(GENKSYMS) -T $@ -a $(ARCH) \ | ||
157 | $(if $(KBUILD_PRESERVE),-p) \ | ||
158 | $(if $(1),-r $(firstword $(wildcard $(@:.symtypes=.symref) /dev/null))) | ||
159 | |||
154 | quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ | 160 | quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ |
155 | cmd_cc_symtypes_c = \ | 161 | cmd_cc_symtypes_c = \ |
156 | set -e; \ | 162 | set -e; \ |
157 | $(CPP) -D__GENKSYMS__ $(c_flags) $< \ | 163 | $(call cmd_gensymtypes, true) >/dev/null; \ |
158 | | $(GENKSYMS) -T $@ \ | 164 | test -s $@ || rm -f $@ |
159 | -r $(firstword $(wildcard \ | ||
160 | $(@:.symtypes=.symref) /dev/null)) \ | ||
161 | $(if $(KBUILD_PRESERVE),-p) \ | ||
162 | -a $(ARCH) \ | ||
163 | >/dev/null; \ | ||
164 | test -s $@ || rm -f $@ | ||
165 | 165 | ||
166 | $(obj)/%.symtypes : $(src)/%.c FORCE | 166 | $(obj)/%.symtypes : $(src)/%.c FORCE |
167 | $(call cmd,cc_symtypes_c) | 167 | $(call cmd,cc_symtypes_c) |
@@ -191,14 +191,8 @@ else | |||
191 | cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< | 191 | cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< |
192 | cmd_modversions = \ | 192 | cmd_modversions = \ |
193 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ | 193 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ |
194 | $(CPP) -D__GENKSYMS__ $(c_flags) $< \ | 194 | $(call cmd_gensymtypes, $(KBUILD_SYMTYPES)) \ |
195 | | $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \ | 195 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
196 | -T $(@:.o=.symtypes)) \ | ||
197 | -r $(firstword $(wildcard \ | ||
198 | $(@:.o=.symref) /dev/null)) \ | ||
199 | $(if $(KBUILD_PRESERVE),-p) \ | ||
200 | -a $(ARCH) \ | ||
201 | > $(@D)/.tmp_$(@F:.o=.ver); \ | ||
202 | \ | 196 | \ |
203 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 197 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
204 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 198 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |