This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Beginner GCC projects question

Nice document. It contains almost all you need to make this work. Still it 
several issues. It doesn't handle conflicts between my second and third 
The examples solve either:

(Advanced Auto-Dependencies)
> 2. You don't want "make clean" to compile foo.m and foo.o,
>    all you want is to clean-up.

or (Basic Auto-Dependencies):
> 3. You want to re-create foo.m when it is explicitly removed.

but not both at the same time.

So if you take the better (Advanced) solution, you make it
almost perfect - except the case when someone removes .deps
(or any .P file in it).

To fix that you'd need something ugly like:
  %.o: %.c %.P  <--- make sure that %.P is not removed.
     (do all the stuff mentioned in the document)
     touch $@

Otherwise when %.P is removed, %.o will not be compiled
even when its include files change (unless %.c changes as well).
This is a great source of crashes, and worse - a great source
of bugs that escape local testing.

"Dave Korn" <>
Sent by:
17/05/2004 14:29
        To:     Michael Veksler/Haifa/IBM@IBMIL, "'Paolo Bonzini'" 
        cc:     <>
        Subject:        RE: Beginner GCC projects question

  There's a very fine document called "Advanced Auto-Dependency 
at the gmake maintainer's website
which will probably help if you haven't seen it before.  Highly 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]