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.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3