I have this code in a Makefile:
$(TCLNAME).batch.tcl: $(TCLNAME).tcl echo source $::env(TOOLS_DIR)/my.tcl > $@
What I want to be printed in $(TCLNAME) is: source $::env(TOOLS_DIR)/my.tcl
$(TCLNAME)
source $::env(TOOLS_DIR)/my.tcl
But I get an error because $::env(TOOLS_DIR) is being interpreted as a Make variable and it is expecting ( after the $.
$::env(TOOLS_DIR)
(
$
How do I make it to print that line as is and not interpret it as Make variable ? I tried to use escape character such as $::env(TOOLS_DIR) but that also did not work.
Escape the $ with another $, and the parentheses with backslashes:
$(TCLNAME).batch.tcl: $(TCLNAME).tcl echo source $$::env(TOOLS_DIR)/my.tcl > $@
2.1m questions
2.1m answers
60 comments
57.0k users