Home >Backend Development >Golang >Why Doesn't My Makefile Interpolate Expressions in $(())?
Makefile Interpolation Issue
When attempting to interpolate an expression within a Makefile command, it remains unevaluated. This occurs when the expression is enclosed in double curly brackets $(()).
To resolve this issue, double the dollar sign ($) within the recipe section of the Makefile. This effectively escapes the first dollar sign, allowing for proper interpolation.
Here's an example of a corrected Makefile:
test: go test $$(go list ./... | grep -v /vendor/) .PHONY: test
With this modification, the expression $$(go list ./... | grep -v /vendor/) will be evaluated properly when running the make test command.
The above is the detailed content of Why Doesn't My Makefile Interpolate Expressions in $(())?. For more information, please follow other related articles on the PHP Chinese website!