diff --git a/cpu/Makefile.include.gnu b/cpu/Makefile.include.gnu index d3418ea049..ea61b4cc76 100644 --- a/cpu/Makefile.include.gnu +++ b/cpu/Makefile.include.gnu @@ -9,6 +9,10 @@ endif export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size -export OBJCOPY = $(PREFIX)objcopy +export OBJCOPY = $(shell command -v $(PREFIX)objcopy gobjcopy objcopy | head -n 1) +ifeq ($(OBJCOPY),) +$(warning objcopy not found. Hex file will not be created.) +export OBJCOPY = true +endif export OBJDUMP = $(PREFIX)objdump export DBG = $(GDBPREFIX)gdb