1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/toolchain: fix command -v multiple commands

`command -v first second third` only works in `bash` and not in `sh`.
So replace with multiple calls to `command`.

This fixes using `objcopy` when the toolchain `objcopy` is not available.
This commit is contained in:
Gaëtan Harter 2019-01-25 16:52:10 +01:00
parent 579925b81d
commit 566c990eba
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ export NM = $(PREFIX)nm
export LINK = $(PREFIX)gcc
export LINKXX = $(PREFIX)g++
export SIZE = $(PREFIX)size
export OBJCOPY ?= $(shell command -v $(PREFIX)objcopy gobjcopy objcopy | head -n 1)
export OBJCOPY ?= $(shell command -v $(PREFIX)objcopy || command -v gobjcopy || command -v objcopy)
ifeq ($(OBJCOPY),)
$(warning objcopy not found. Hex file will not be created.)
export OBJCOPY = true

View File

@ -20,7 +20,7 @@ export LINK = $(PREFIX)gcc
export LINKXX = $(PREFIX)g++
# objcopy does not have a clear substitute in LLVM, use GNU binutils
#export OBJCOPY = $(LLVMPREFIX)objcopy
export OBJCOPY ?= $(shell command -v $(PREFIX)objcopy gobjcopy objcopy | head -n 1)
export OBJCOPY ?= $(shell command -v $(PREFIX)objcopy || command -v gobjcopy || command -v objcopy)
ifeq ($(OBJCOPY),)
$(warning objcopy not found. Hex file will not be created.)
export OBJCOPY = true