help-make
[Top][All Lists]
Advanced

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

RE: Issue with automatic dependency generation in gmake


From: Varambally, Dheeraj B
Subject: RE: Issue with automatic dependency generation in gmake
Date: Thu, 10 Sep 2009 21:56:30 -0700

Chen,

Thanks for the reply. I'm trying to generate and include the dependencies as 
described in section 4.14 (automatic prerequisite generation) of the GNU users 
guide. The dependencies are generated by the compiler automatically while it 
compiles the source (dependency generation phase). When it encounters a compile 
error during this phase it continues to build and then during real make phase 
it attempts compile again and aborts. My question is can we fail and abort upon 
encountering the first error in the dependency generation phase itself since it 
includes compilation as well rather than going through all the remaining c 
files.

Thanks
Dheeraj

-----Original Message-----
From: CHEN Cheng [mailto:address@hidden 
Sent: Thursday, September 10, 2009 6:21 PM
To: Varambally, Dheeraj B
Cc: address@hidden
Subject: Re: Issue with automatic dependency generation in gmake

On Thu, Sep 10, 2009 at 11:06:22AM -0700, Varambally, Dheeraj B wrote:
> Hi,
> 
> I'm trying to automatically generate the dependency files from my C compiler 
> and including it using the -include directive But gmake does not seem to 
> abort upon encountering the first compile error in a C source file. It seems 
> to continue building the rest of the files . How can we make gmake abort upon 
> encountering the first error.  It works fine if I do not include the 
> dependency file.
> 

Which phase was the first compile error encountered in? The dependency
file generation phase, or the real make phase?

Does it continue with errors in the real make phase?

> Here is a snapshot of what I'm trying to do
> 
> Target : src
>               $(CC) -c  $(CFLAGS) -makedep $(DEPFILE)
> 
> 
> -include $(DEPFILE)
> 

Since gmake builds ahead all the included dependency files as goals,
in your case (assumed), it compiles your C files as the generation of
dependency files. And perhaps that why you don't see the errors stop.

Better to seperate the dependency generation from the real compilation.


HTH,
Cheng





reply via email to

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