bug-make
[Top][All Lists]
Advanced

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

Re: Make 3.79.1: Re-executing omits outdating


From: Paul D. Smith
Subject: Re: Make 3.79.1: Re-executing omits outdating
Date: Thu, 7 Dec 2000 09:40:07 -0500

%% "Marcel Loose" <address@hidden> writes:

  ml> Recently, we upgraded from Make version 3.76.1 to version 3.79.1,
  ml> and now I'm having a problem doing a "make depend" with my
  ml> Makefile. The problem is that Make 3.79.1 loops indefinitely. In
  ml> my opinion this is a bug, because Make 3.79.1 "forgets" to
  ml> out-date the .depend file it just created.

This feature was intentionally removed after 3.76.1 as it caused too
many problems.

You'll have to either stick with 3.76.1, or fix your makefile.

  ml> .PHONY    : default all depend
  ml> depend    :

  ml> $(DEPEND): depend
  ml>   @echo "Updating dependencies ..."
  ml>   @$(CXX) -MM $(CXXFLAGS) $(SRCS) | sed 's|\w*\.o|$(LIB)(&)|' > $(DEPEND)
  ml>   @$(CXX) -MM $(CXXFLAGS) $(PRGS) >> $(DEPEND)

  ml> -include $(DEPEND)

This sequence is your problem: you define "depend" to be .PHONY, so it's
always out of date, then you define $(DEPEND) to depend on it, so
$(DEPEND) is always considered out of date.

You should have $(DEPEND) depend on the source files, etc., directly
rather than on a .PHONY target.  That way it's only rebuilt if one of
the source files changes.

You might also want to take a look on my web site below for a more
advanced way of doing automated dependency maintenance.

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