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

Martin v. Loewis martin@v.loewis.de
14 Jun 2002 09:10:04 +0200


Jeremy Hylton <jeremy@zope.com> writes:

> Only if distutils grows a way to specify all those dependencies.  Once
> you've specified them, I'm not sure why it is difficult to check them
> in Python code instead of relying on make.

I believe people normally want their build process to know
dependencies without any specification of dependencies. Instead, the
build process should know what the dependencies are by looking at the
source files.

For C, there are two ways to do that: you can either scan the sources
yourself for include statements, or you can let the compiler dump
dependency lists into files. 

The latter is only supported for some compilers, but it would help
enourmously: when compiling the first time, you know for sure that you
will need to compile. When compiling the second time, you read the
dependency information generated the first time, to determine whether
any of the included headers has changed. If that is not the case, you
can skip rebuilding. If you do rebuild, the dependency information
will be updated automatically (since the change might have been to add
an include).

Regards,
Martin