This is the mail archive of the gcc@gcc.gnu.org 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 
has
several issues. It doesn't handle conflicts between my second and third 
concern.
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 $@
  %.P:

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" <dk@artimi.com>
Sent by: gcc-owner@gcc.gnu.org
17/05/2004 14:29
 
        To:     Michael Veksler/Haifa/IBM@IBMIL, "'Paolo Bonzini'" 
<bonzini@gnu.org>
        cc:     <gcc@gcc.gnu.org>
        Subject:        RE: Beginner GCC projects question



  There's a very fine document called "Advanced Auto-Dependency 
Generation"
at the gmake maintainer's website 
http://make.paulandlesley.org/autodep.html
which will probably help if you haven't seen it before.  Highly 
recommended.





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