makefiles/toolchain: fallback to 'objdump'

When '$(PREFIX)objdump' is not present fallback to native '(g)objdump'.
'objdump' is used when flashing for some boards but the toolchain may
not be installed when building in docker.

This will allow using 'objdump' in 'cpu/kinetis/dist/check-fcfield.sh'.
This commit is contained in:
Gaëtan Harter
2019-05-28 14:04:31 +02:00
parent 0f8372fac4
commit f47b09faa4
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ ifeq ($(OBJCOPY),)
$(warning objcopy not found. Hex file will not be created.)
export OBJCOPY = true
endif
export OBJDUMP = $(PREFIX)objdump
# Default to the native (g)objdump, helps when using toolchain from docker
export OBJDUMP ?= $(or $(shell command -v $(PREFIX)objdump || command -v gobjdump),objdump)
# We use GDB for debugging
include $(RIOTMAKE)/tools/gdb.inc.mk
+2 -1
View File
@@ -25,7 +25,8 @@ ifeq ($(OBJCOPY),)
$(warning objcopy not found. Hex file will not be created.)
export OBJCOPY = true
endif
export OBJDUMP = $(LLVMPREFIX)objdump
# Default to the native (g)objdump, helps when using toolchain from docker
export OBJDUMP ?= $(or $(shell command -v $(LLVMPREFIX)objdump || command -v gobjdump),objdump)
export SIZE = $(LLVMPREFIX)size
# LLVM lacks a binutils strip tool as well...
#export STRIP = $(LLVMPREFIX)strip