bug-make
[Top][All Lists]
Advanced

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

RE: A possible bug (or a feature) : dependencies shown in dry-run but no


From: Paul D. Smith
Subject: RE: A possible bug (or a feature) : dependencies shown in dry-run but not rebuilt
Date: Wed, 13 Nov 2002 11:33:46 -0500

%% David Mentre <address@hidden> writes:

  dm>    Prerequisite `x.h' is newer than target `x.c'.    <<<<---- ok

No, not OK!

You don't want to specify that the .c file depends on the .h file.  You
don't update the .c file when the .h file changes: you have no rule for
that.

It's the .o file that depends on the .h file: the .o file is the file
that needs to be updated when either the .c _or_ the .h file changes.

Change your rule definition from:

  x.c: x.h \
          perf.h \
            ...
          autotest.h ;

to:

  x.o: x.h \
          perf.h \
            ...
          autotest.h

(note you must remove the trailing semicolon as well!)

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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