aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-02-20 12:53:39 +0000
committerRon Yorston <rmy@pobox.com>2024-02-20 13:11:01 +0000
commit17992d06810a9b0c60bab404f720bbd7539bdb93 (patch)
treee99c9776bc2dab67ebc87d27b291842571ac4e7e /scripts
parent0200baa675d3b51c0f021da7728353ee7ceedba4 (diff)
downloadbusybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.tar.gz
busybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.tar.bz2
busybox-w32-17992d06810a9b0c60bab404f720bbd7539bdb93.zip
build system: fix for older GNU make
Commit 992387539 (build system: more clang/llvm tweaks) added a test in scripts/Makefile.build which used the intcmp function. This isn't present in GNU make prior to 4.4. Rewrite the test so it works with older versions of GNU make.
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)