[Pyrex] Why were .pxd files invented?

Leif Strand leif at geodynamics.org
Mon Apr 2 23:53:26 UTC 2007


Greg Ewing wrote:

> Leif Strand wrote:
>
>> # dependencies such as this one could be output by Pyrex itself, using
>> # "pyrex -M" or "pyrex -MM"
>
>
> The problem with that is it requires processing the entire
> Pyrex file to discover the dependencies. If you have to do
> that every time you type "make", you might as well not
> bother with dependency tracking at all.
>
> If you're suggesting an extra "make depend" step, that's
> not satisfactory, as it's error-prone -- you have to
> remember to do it manually when you change something that
> affects an interface.
>

And forcing the programmer to manually maintain the depedencies in the 
Makefile isn't error-prone?

In any case, you do not need an extra "make depend" step. Take a look at 
any GNU-Autotools-based project to see how this works. The trick is to 
add the -M* flags to the regular compile line. In other words, any time 
"foo.c" changes, GCC outputs dependency info as a side-effect of the 
normal compile. So for Pyrex, you'd output the dependency info when you 
translate it to C... in which case, you're scanning the entire Pyrex 
file anyway.

--Leif




More information about the Pyrex mailing list