I have a bug to report that is apparently restricted to the win32
platform.  This bug did not occur on rh6-linux with make3.79 when I
tested there.

In the makefile are two sets of object files, OBJS1, OBJS2, and
correspondingly two sets of source files, CSRC1, CSRC2.  There are also
two timestamp files which control the generation of CSRC1 and CSRC2.
Further, one timestamp file controls the generation of the other
timestamp file.

TimestampCsrcFile's timestamp is used to control the generation of
TimestampFile, and also of CSRC2.  
TimestampFile's timestamp is used to control the generation of CSRC2.

So: 
      TimestampFile   <-   TimestampCsrcFile 
               |                                |          
            CSRC1                       CSRC2

The problem is that a change in the timestamp of TimestampCsrcFile does
not trigger the rule to rebuild TimestampFile.

After using 'make -rp' to dump make's database, it became clear that
while make was properly setting up file dependencies, it was not
properly setting file timestamps.

The following are excerpts from 'make -rp':
        TimestampFile: TimestampCsrcFile
        #  Implicit rule search has not been done.
        #  Last modified 2000-05-30 19:33:36
        #  File has been updated.
        #  Successfully updated.
        #  commands to execute (from `makefile', line 28):
                touch TimestampFile
         .........
        # Not a target:
        TimestampCsrcFile:
        #  Implicit rule search has been done.
        #  Last modified 2000-05-30 19:33:35
        #  File has been updated.
        #  Successfully updated.

The following is a file listing from Cygwin's ls:
        -rw-r--r--   1 544      everyone        0 May 30 19:29 1.c
        -rw-r--r--   1 544      everyone        0 May 30 19:29 2.c
        -rw-r--r--   1 544      everyone        0 May 30 19:42 7.c
        -rw-r--r--   1 544      everyone        0 May 30 19:42 8.c
        -rw-r--r--   1 544      everyone        0 May 30 19:42 9.c
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 1.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 2.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 3.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 4.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 5.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:28 6.o
        -rw-r--r--   1 544      everyone        0 Jun  1 12:28 5.c
        -rw-r--r--   1 544      everyone        0 Jun  1 12:28 6.c
        -rw-r--r--   1 544      everyone        0 Jun  1 12:30 3.c
        -rw-r--r--   1 544      everyone        0 Jun  1 12:30 4.c
        -rw-r--r--   1 544      everyone      357 Jun  1 12:30 7.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:30 8.o
        -rw-r--r--   1 544      everyone      357 Jun  1 12:30 9.o
        -rw-r--r--   1 544      everyone        0 Jun  1 12:31
TimestampFile
        -rw-r--r--   1 544      everyone        0 Jun  1 12:50
TimestampCsrcFile
        -rw-r--r--   1 544      everyone      360 Jun  1 16:34 makefile

Clearly, TimestampFile is dependent on TimestampCsrcFile, yet when I
type make, TimestampFile is not being updated.  The problem seems to lie
in how timestamps are read on win32 -- note that 'make' and 'ls' each
have a different notion of when TimestampFile and TimestampCsrcFile have
last been updated.  Make believes that TimestampFile has been last
changed on 2000-05-30 19:33:36, but ls believes that TimestampFile has
been last changed on Jun  1 12:31.  Similarly, make believes that
TimestampCsrcFile has been last changed on 2000-05-30 19:33:35 while ls
believes that TimestampCsrcFile has been last changed on Jun  1 12:50.  

When I tried to reproduce the problem on rh6.0-linux, I did not observe
this problem.

Here is a tarball with which to try out the problem.  Please try doing
"touch" on TimestampFile or TimestampCsrcFile to reproduce the problem.
Also enclosed is the "config.h" from the root build directory of
make-3.79.
 
The enclosed makefile is a simplified version of the real-world makefile
we are using.  Hopefully, it will help.

Thanks, 
Dean Fitzgerald

------------------------------------------- Enclosed Makefile
------------------------------
        OBJS1 = 4.o 5.o 6.o
        OBJS2 = 7.o 8.o 9.o 

        CSRC1 = $(OBJS1:.o=.c)
        CSRC2 = $(OBJS2:.o=.c)

        all: $(OBJS1) $(OBJS2)

        CC = gcc
        CFLAGS = -c
        %.o: %.c
                $(CC) $(CFLAGS)  $<   

        # CSRC1 are dependent on TimestampFile
        $(CSRC1): TimestampFile
                touch $(CSRC1)
        # CSRC2 are dependent on TimestampCsrcFile
        $(CSRC2): TimestampCsrcFile
                touch $(CSRC2)
        # TimeStampFile is dependent on TimestampCsrcFile
        TimestampFile: TimestampCsrcFile
                touch TimestampFile

win32maketest.tar

Reply via email to