help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple prerequisites in pattern rules


From: Martin Sebor
Subject: Re: multiple prerequisites in pattern rules
Date: Fri, 30 Jan 2004 11:24:11 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

Paul D. Smith wrote:

...
  >> My occasional problem is that make passes
  >> $(CPP) $(CPPFLAGS) -M $< | $(SED) -e 'expression' > $*.d
  >> to the shell and $(CPP) does not terminate normally. More often,
  >> it's gcc that segfaults, and it prints an internal compiler error
  >> and terminates in an orderly fashion, returning an error code to
  >> make. But cpp doesn't seem to have that sort of error handling:
  >> when it fails...
>> >> - the build might just hang--probably with sed waiting for input
  >> that never comes

That can only happen if cpp hangs.  If cpp exits or dies in any way,
then the write side of the pipe will be closed and then sed will exit,
probably with some kind of read error.

Why read error? The reading end can't tell why the writer closed
the pipe. All it sees is that the pipe has been closed. That's not
an error; sed will exit successfully, and the exit status of the
two commands will be 0, just as it is below:

    false | sed ""; echo $?

Regards
Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]