help-make
[Top][All Lists]
Advanced

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

Re: make always rebuilds...


From: Paul D. Smith
Subject: Re: make always rebuilds...
Date: Sun, 19 Mar 2006 09:58:12 -0500

%% ody13 <address@hidden> writes:

  o> I got a trivial Makefile looking like this, can someone tell me why
  o> all the objects are rebuild everytime make is called? Any help is
  o> appreciated.

  o> THISBINDIR = $(BRANCH)$(BINDIR)

  o> .cpp.o:
  o>    $(ccc) $(INCLUDES) $(CCFLAGS) -c $< -o $(THISBINDIR)$@
  o> .c.o:
  o>    $(ccc) $(INCLUDES) $(CCFLAGS) -c $< -o $(THISBINDIR)$@

You're violating a basic principle of make: your rules say that they
will build "foo.o" but they really build "$(THISBINDIR)/foo.o".  Because
of this, the targets make is looking for never get updated and so make
will keep trying to build them.


See the Rules for Makefiles and the info on VPATH on my website below
for more details about this issue.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]