When cross compiling with a sysroot, you sometimes end up with nested backticks.
The case we're seeing it with is m32r-elf, where gcc_tooldir is defined thusly: gcc_tooldir = $(libsubdir)/$(unlibsubdir)/`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'`$(target_noncanonical) and SYSTEM_HEADER_DIR is thusly: CROSS_SYSTEM_HEADER_DIR = $(gcc_tooldir)/sys-include SYSTEM_HEADER_DIR = `echo $(CROSS_SYSTEM_HEADER_DIR) | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` Note that we have gcc_tooldir inside backticks, resulting in `...`...`...`, which bash obviously is going to misinterpret. Given that we require GNU make, is the right solution to use $(shell echo ...) for one of those to disambiguate it?