www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/09/11:20:54

Date: Thu, 9 Mar 2000 14:11:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
cc: djgpp AT delorie DOT com
Subject: Re: using control characters inside makefiles
In-Reply-To: <200003081618.KAA29074@darwin.sfbr.org>
Message-ID: <Pine.SUN.3.91.1000309141026.1851C-100000@is>
MIME-Version: 1.0
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019