[Python-Dev] addressing distutils inability to track file dependencies

Skip Montanaro skip@pobox.com
Fri, 14 Jun 2002 15:12:20 -0500


    >> Gcc has had good dependency checking for probably ten years.

    Guido> How do you invoke this?  Maybe we can use this to our advantage.

"gcc -M" gives you all dependencies.  "gcc -MM" gives you just the stuff
included via '#include "file"' and omits the headers included via '#include
<file>'.  Programmers use <file> and "file" inconsistently enough that it's
probably better to just use -M and eliminate the files you don't care about
(or leave them in and have Python rebuild automatically after OS upgrades).
There are several other variants as well.  Search the GCC man page for "-M".

It seems to me that distutils' base compiler class could provide a generic
makedepend-like method which could be overridden in subclasses where
specific compilers have better builtin schemes for dependency generation.

Skip