aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-12-19 15:38:09 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-12-19 16:00:58 -0500
commit37a8d9f67f18de1e2cbc7387311ce22d4dbff518 (patch)
treee28527c8380584fadb6d9eab32fb031445530e03 /scripts/Makefile.build
parenta1d94aa5560dc6b06baf30ae477115b51dc25461 (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/Makefile.build')
-rw-r--r--scripts/Makefile.build30
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
154cmd_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
154quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ 160quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
155cmd_cc_symtypes_c = \ 161cmd_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
191cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< 191cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
192cmd_modversions = \ 192cmd_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); \