%% "Marcel Loose" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>          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

_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to