On 27 March 2007 17:55, DJ Delorie wrote: > 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?
Or how about using ':=' to force immediate evaluation? Does $gcc_tooldir change during the course of a build? If not, it seems pointlessly wasteful to repeatedly invoke shell/echo/sed every single time it's referred to... cheers, DaveK -- Can't think of a witty .sigline today....