This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
nested backticks in Makefile
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 27 Mar 2007 12:54:57 -0400
- Subject: nested backticks in Makefile
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?