Mail Archives: djgpp/2000/03/09/11:20:54
On Wed, 8 Mar 2000, Jeff Williams wrote:
> How would I modify the following line for use inside a makefile (the ^M
> character is causing problems; I can't seem to escape it or quote it or
> otherwise get it to survive inside the makefile). If possible, I like
> to do this without the --file option of grep.
>
> grep --quiet --binary ^M foo.bar && dtou foo.bar
I don't think you can do that with the DJGPP port of Make: it reads the
Makefile in text mode, and the low-level library functions remove CR
characters even if not immediately followed by an LF character. (The
reason is that, when you read a file a buffer at a time, it is not easy
to peek at the next character to see if it's an LF or not.)
I suggest to run dtou unconditionally. The program is fast and leaves
the file's timestamp intact, so I don't see any good reason to try to
avoid it.
If you must avoid the call to dtou, use "od -c" instead, and grep the
result for a literal string "\r".
- Raw text -