How to use Bash parameter substitution in a Makefile?
I've the following Makefile where I'd like to use Bash parameter substitution syntax as below: SHELL:=/bin/bash Foo=Bar all: @echo ${Foo} @echo ${Foo/Bar/OK} However it doesn't work as expected, as the output of the second echo command is empty: $ make Bar (empty) Although it works fine when invoking in shell directly: $ Foo=Bar; echo ${Foo/Bar/OK} OK How can I use the above syntax in Makefile? If you want the shell to expand the variable you have to use a shell variable, not a make variable. ${Foo/Bar/OK} is a make variable named literally Foo/Bar/OK . If you want to use shell variable