aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build12
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.
268cmd_link_o_target = $(intcmp $(words $(obj-y)),1,\ 268ifeq ($(words $(obj-y)),0)
269 rm -f $@; $(AR) rcs $@,\ 269cmd_link_o_target = rm -f $@; $(AR) rcs $@
270 cp $(obj-y) $@,\ 270else
271ifeq ($(words $(obj-y)),1)
272cmd_link_o_target = cp $(obj-y) $@
273else
274cmd_link_o_target = \
271 $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) 275 $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^))
272endif 276endif
277endif
278endif
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)