The trick is to drag special characters past Make and grep.
GrepResult: = $ {shell grep 'ifeq (\ $$ (Param1)' TextFile}
Make $$ queues in $, then grep turns \ $ into $. Also note that this assignment uses curly braces "{}" rather than parentheses "()" so as not to confuse match results. (There may be a more reliable way to handle the string, but it doesn't matter.)
When you use the result, use single quotes:
all:
@echo '$ (GrepResult)'
This has also been tested with GNUMake 3.81.
EDIT: This also works with $ (error ...):
$ (error '$ (GrepResult)')
Beta
source share