bug-make
[Top][All Lists]
Advanced

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

Problem making target when prerequisite is newer than target


From: Geoff Alexander
Subject: Problem making target when prerequisite is newer than target
Date: Mon, 5 Feb 2001 15:49:45 -0500

Here's more information on the problem.  Before making the target
/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a,
/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a exists with modification time
x.  The prerequisite confRoutine.o does not exist, so it is made.   Make
prints the line "Prerequisite `confRoutine.o' is newer than target
`/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a'." after it makes
confRoutine.o.   Note that the make of confRoutine.o takes less than a
second, thus giving confRoutine.o the same modification time x.  This
causes make to determine that it doesn't need to remake
/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a since
/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a and confRoutine.o have the same
modification time.  I was able to work around the problem adding the
following rule to my makefile

   confRoutine.o: confRoutine.c
      sleep 1
      $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@

so that /home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a and confRoutine.o do
not have the same modification time.

I would think that when a prerequisite is made, make should not compare
modification times of the prerequisite and target when determining whether
the target needs to remade, since make already knows that the prerequisite
is newer than the target.  By not checking modification times, make would
avoid granularity problems with modification times for this case.

Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
CMVC95 WebDAV Development
IBM Corporation
RTP, NC
---------------------- Forwarded by Geoff Alexander/Raleigh/IBM on
02/02/2001 04:44 PM ---------------------------



Geoff Alexander
01/31/2001 06:28 PM

To:   address@hidden
cc:   Steve K Speicher/Raleigh/address@hidden

From: Geoff Alexander/Raleigh/address@hidden
Subject:  Problem making target when prerequisite is newer than target



I'm having a problem where a target is not remade even though its
prerequisite is newer:

         Successfully remade target file `confRoutine.o'.
        Finished prerequisites of target file
   `/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a'.
        Prerequisite `confRoutine.o' is newer than target
   `/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a'.
       No need to remake target
   `/home/cmvcbld/cmvcCS1.8-006/src/lib/tools.a'.

The rule used to build the target is

   $(LIB) dummy.a: $(MEMBERS)
      ar rv $@ $?
      $(RANLIB) $@

where

   LIB = $(TOP)/src/lib/tools.a
   TOP = /home/cmvcbld/cmvcCS1.8-006
   MEMBERS = confRoutine.o
   RANLIB = ranlib

I'm running GNU make 3.79.1 under SuSE Linux 7.0 on a Pentium PC.  I also
have the same problem with GNU make 3.77.  I'd appreciate any help on
figuring out why the target is not being remade.  Could this possibly be a
bug in GNU make?

Thanks,
Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
CMVC95 WebDAV Development
IBM Corporation
RTP, NC







reply via email to

[Prev in Thread] Current Thread [Next in Thread]