Hi,

Recently, we upgraded from Make version 3.76.1 to version 3.79.1, and now I'm having a 
problem doing a "make depend" with my Makefile. The problem is that Make 3.79.1 loops 
indefinitely. In my opinion this is a bug, because Make 3.79.1 "forgets" to out-date 
the .depend file it just created. Thus it is recreated over and over again (well, not 
in this demo, because make is doing its job so fast that .depend turns out to be 
up-to-date, but when you have a larger number of source and header files it *will* 
loop indefinitely). 
Comparing the line "Re-executing:" in the log files for Make 3.76.1 and 3.79.1 shows 
this:

make_3-76-1.log:Re-executing: make -d depend -o.depend -oMakefile
make_3-79-1.log:Re-executing: /usr/bin/make_3_79 -d depend

Hardware: PC Pentium-III (800 MHz)
OS: SuSE Linux 7.0 (i386) - Kernel 2.2.16 (7)

Kind regards,

        Marcel Loose
        Netherlands Foundation for Research in Astronomy
        [EMAIL PROTECTED] 

P.S.: For your convenience, I added the Makefile below (it is also present in the 
attached compressed tar file)

>>>>>>>>>>>>>>>>
EXES    = main

.PHONY  : default all depend
default : $(firstword $(EXES))
all     : $(EXES)
depend  :

CXX     = g++
CXXFLAGS= -g -Wall

DEPEND  = .depend
PRGS    = $(addsuffix .cc, $(EXES))
SRCS    = $(filter-out $(PRGS), $(wildcard *.cc))
LIB     = libmylib.a

$(EXES): $(LIB)

$(LIB): $(SRCS:%.cc=$(LIB)(%.o))

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

-include $(DEPEND)
<<<<<<<<<<<<<<<<

bug-make.tar.gz

Reply via email to