On Fri, Nov 08, 2002 at 05:07:49PM +0100, Holger Waechtler wrote: > Florian Schirmer wrote: > >Hi, > > > > > >>Not if '$(wildcard *.d)' doesn't return any names. > >>'-include' only suppresses error messages if any of the _given_ files > > > >doesn't exist. > > > >Two things i would like to add: > > > >1. Doesn't adding -MD to the extra flags is enough to make the > >dependencys work? At least with gcc 3.1 (haven't tried any version > >below) it seems to work pretty well without any include changes to the > >Makefile. No. How do you expect make to _use_ these dependencies when you didn't inlcude them? > >2. Does including the *.d files work correctly without having a "make > >dep" run before? gcc generates the dep infos _while_ compiling the *.c > >files. So make can only include the deps if compiling is already done. > >You will end up with the deps from the last not the current run. Will > >work in most cases but... > > here you are right - but in any case the current rules are much safer No, he is not. Think about it: If you do not have a specific dependency file, the corresponding object file also does not exist, and so it is compiled anyway. If you had an outdated dependency file, you must have changed at least one of the files that are listed in the current dependency file and the object file and the dependency file are regenerated. I could even give you a formal proof, if you like. Robert -- Robert Schiele Tel.: +49-621-181-2517 Dipl.-Wirtsch.informatiker mailto:rschiele@uni-mannheim.de
Attachment:
pgp00007.pgp
Description: PGP signature