UNIX traditionally is not very forgiving with input to programs. That attitude hasn't changed much since its first inception. ^M
is carriage return which usually only gets into files when editing them in Windows environments. UNIX uses the line feed (\n, 0x0a) as line terminator and many tools complain about CR (\r, 0x0d) as they don't see a reason why that character should even exist.
$
are a different issue, as $
is part of makefile syntax. It's used to indicate variables/constants in makefiles. Those can be contextual ones, like $<
or $*
, or named ones like $(CC)
.
You can use the dos2unix
utility to get rid of ^M
and escape dollar signs with \$
.
There are more peculiarities to make, nonetheless. For example the requirement that command lines for targets need to be indented by a tab character. As far as I know only make
s not very widely used have lifted that restriction.