Date: Thu, 9 Mar 2000 14:11:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jeff Williams cc: djgpp AT delorie DOT com Subject: Re: using control characters inside makefiles In-Reply-To: <200003081618.KAA29074@darwin.sfbr.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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".