The problem
Compare the line in the makefile
:
find ./ -type f -regextype emacs -regex ".*tests$" | xargs rm -f
With the line in the error message:
find ./ -type f -regextype emacs -regex ".*tests | xargs rm -f
It appears that make
swallowed $"
.
The solution
To avoid this, the dollar sign needs to be escaped. Try:
find ./ -type f -regextype emacs -regex ".*tests$$" | xargs rm -f
Documentation
From the GNU Make Manual Section 4.2:
Because dollar signs are used to start make variable references, if you really want a dollar sign in a target or prerequisite you must write two of them, ‘$$’ (see How to Use Variables). If you have enabled secondary expansion (see Secondary Expansion) and you want a literal dollar sign in the prerequisites list, you must actually write four dollar signs (‘$$$$’).