[Top][All Lists]

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

Re: Make dependency check

From: Paul D. Smith
Subject: Re: Make dependency check
Date: Tue, 21 Nov 2006 09:13:54 -0500

On Tuesday, 21 November, Geraldin Arthy (address@hidden) wrote:

> I can use the gcc dependency option but the problem is we will be using the
> same makefile for both linux as well as Solaris.And in Solaris for our code
> we use the CC compiler and not gcc.That is the reason why I have to
> definitely use the makedepend option.

OK but... as you've discovered, makedepend is an old, out-of-date
application.  It doesn't grok C++ headers, for example, and its ideas of what
is legal and not legal are old-fashioned.

> For example when I see the COvBucket.P, I find the lines below.
> COvBucket.o: COvBucket.h ../pdfcommon/src/PdfType.h
> COvBucket.o: ../pdfcommon/src/CPdfObject.h ../pdfcommon/src/CPdfTrace.h
> But when I modify the ../pdfcommon/src/CPdfTrace.h header file and give a
> make again it does not rebuild the dependencies.

That's because your .P files are wrong.  Your rule to build .o's is:

  $(OBJS):$(OUTPUT_DIR)/%.o: %.cxx

which means your target .o's are things like $(OUTPUT_DIR)/COvBucket.o.

But, your .P files list targets like this:


with no $(OUTPUT_DIR).  There's absolutely no way make can know that you
intend these targets to refer to the same file; in fact make knows that they
are NOT the same file.  So, prerequisites listed for COvBucket.o will have no
relevance to make when it wants to build $(OUTPUT_DIR)/COvBucket.o.

You need to fix up your script that generates the .P files to add in the
$(OUTPUT_DIR)/ prefix to the target .o's.

Then it will work.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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