14 Nov 2000 pphaneuf   » (Journeyer)

Argh, gcc is so braindead at times... According to the man page:

-MD    Like `-M' but the dependency information is written
       to files with names made  by  replacing  `.o'  with
       `.d'  at the end of the output file names.  This is
       in   addition   to   compiling    the    file    as
       specified--`-MD' does not inhibit ordinary compila­
       tion the way `-M' does.

Except one detail: it doesn't do that. I use "-o foo/bar.o", so my output file is foo/bar.o. Replacing '.o' with '.d' should yield foo/bar.d, but no, bar.d comes out, putting all of the dependency files in the top level directory.

Nice.

The DEPENDENCIES_OUTPUT environment variable seems promising, but it can only take a single file as the target of the rule (I would like to make the dependency file itself a dependent, so that it is automatically updated).

Other than that, the nearly perfect dependency checking and amazing speed of non-recursive makefiles is incredible. If more people would try that, they'd ditch automake pretty quickly (or automake would be updated to create non-recursive makefiles, which would be even better!).

I say "nearly", because I still use a single dependency file, which I obviously don't rebuild every time, so it could get wrong. But it is very easy to get a perfect dependency build by simply removing the file to force the recomputation of dependencies.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!