diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2a9f451f3..cd5592b34 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -265,11 +265,17 @@ else | |||
265 | # zero or one object files. In the latter case copy the object to | 265 | # zero or one object files. In the latter case copy the object to |
266 | # the target. This avoids the need to use the linker: the llvm | 266 | # the target. This avoids the need to use the linker: the llvm |
267 | # linker doesn't support the -r option. | 267 | # linker doesn't support the -r option. |
268 | cmd_link_o_target = $(intcmp $(words $(obj-y)),1,\ | 268 | ifeq ($(words $(obj-y)),0) |
269 | rm -f $@; $(AR) rcs $@,\ | 269 | cmd_link_o_target = rm -f $@; $(AR) rcs $@ |
270 | cp $(obj-y) $@,\ | 270 | else |
271 | ifeq ($(words $(obj-y)),1) | ||
272 | cmd_link_o_target = cp $(obj-y) $@ | ||
273 | else | ||
274 | cmd_link_o_target = \ | ||
271 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) | 275 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) |
272 | endif | 276 | endif |
277 | endif | ||
278 | endif | ||
273 | 279 | ||
274 | $(builtin-target): $(obj-y) FORCE | 280 | $(builtin-target): $(obj-y) FORCE |
275 | $(call if_changed,link_o_target) | 281 | $(call if_changed,link_o_target) |