help-make
[Top][All Lists]
Advanced

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

Re: Make rebuilds when it is not necessary


From: Dave Hylands
Subject: Re: Make rebuilds when it is not necessary
Date: Mon, 6 Mar 2006 13:45:04 -0800

Hi,

On 3/6/06, Rupal Desai <address@hidden> wrote:
>
> I am writing a rules.mk file which will have rules for compile for the whole
> code base.  The problem I am having is that whenever I give the make command
> it recompiles everything without checking the timestamp.  How can I only
> build things that are out of date and not everything all the time.  I am
> attaching my rules.mk file.

Probably because of this:

> $(OBJS):$(OBJDIR)/%.o: %.cpp $(OBJDIR)

You've made the object files depend on the object directory. Everytime
you compile something and place a new object file into the object
directory, the object directory gets updated, thus making the object
file out of date.

You've already got all depending on $(OBJDIR), you don't need it for
the %.o line.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

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