Hi,

I tried make 3.81beta2, and its behavior differed from make 3.80 for 
some of my Makefiles I used. I tracked the problem to the following 
testcase:

======= Makefile ========
OBJS            = main.o version.o
all: main
clean:
        rm -f main $(OBJS) version.c

date_stamp      := $(shell LANG=C date)

.SECONDARY:
.PHONY: version.c
version.c:
        @echo "Creating [EMAIL PROTECTED]"
        @echo "const char *version=\"$(date_stamp)\";" > $@

%.o: %.c
        gcc -c -o $@ $<

main: $(OBJS)
        gcc -o $@ $^
=========================

The 1st "make all" does what's expected with both make 3.80 and make 
3.81: rebuilds the 'main' binary. However, if "make all" is issued 
again, make 3.80 rebuilds version.c and all files that depend on it 
(version.o, main). Make 3.81beta2, however, considers it up-to-date 
and doesn't rebuild anything.

I didn't find anything in the description of the .SECONDARY that 
states such behavior.

This behavior was introduced by the revision 1.69 of the 'file.c' 
file. The description says that it fixes bug #2515, but that bug ends 
with a sentence "I'll look at this more carefully." by Paul Smith.
I am not sure which .SECONDARY behavior is right.

PS. I know that .SECONDARY is pointless in this makefile, this 
testcase was snipped from a much larger project.

Regards,
Alexey.

-- 
We seek not to invade, but to pervade.  There is a difference.
                        -- Arilou, SC2


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to