Is it possible to "disable" variable expansion in my Makefile
for a certain section?
Here's an example of the issue I'm having:
print_command:
@echo '$(COMMAND)'
And here's the output I'm getting:
$ export COMMAND='My favourite shell is $SHELL'
$ make print_command
My favourite shell is HELL
$ make print_command COMMAND='Welcome to $SHELL'
Welcome to HELL
And what I would like to get:
$ export COMMAND='My favourite shell is $SHELL'
$ make print_command
My favourite shell is $SHELL
$ make print_command COMMAND='Welcome to $SHELL'
Welcome to $SHELL
Is it possible to do this without using a double dollar like so:
$ export COMMAND='My favourite shell is $$SHELL'
$ make print_command
My favourite shell is $SHELL
$ make print_command COMMAND='Welcome to $$SHELL'
Welcome to $SHELL
In it's simplest form I'm looking to forward the exact contents of the variable COMMAND
without make
mangling it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…