Hi everybody, please forgive me for sending such a semi-finished work to you, especially documentation is lacking. Since I'm new to automake contributing, I expect many changes to be made.
This is what it's all about: Say you've got two Fortran files, one defining and one using a module, then the one defining has always to be compiled first to create a *.mod file or whatever (compiler dependent). This is different from C-headers where it suffices to generate the dependencies (->*.Po files) as side effects of compilation. But with Fortran modules, these dependencies have to be computed before the first compilation. Things get worse with preprocessed Fortran where other files can be included that in turn can define/use modules. However, I think I've got a solution that works and open the discussion. One thing to note: The solution depends heavily on this: http://austingroupbugs.net/view.php?id=332 Currently, this effectively introduces a dependency on GNU make, but I personally think that people working with sth. 'exotic' like Fortran can be demanded to install sth. like GNU make. Here is how it works: People call AM_FORTRAN_OBEY_INTERDEPS([ext]) for each fortran extension they want to be included into the dependency tracking mechanism. The Makefile's in turn keep track of the interdependencies with the help of files in .fdeps (very similiar like the ones in .deps) which get dynamically updated on relevant changes. I attached a simple test project (nasty_f90) to this mail, unfortunately the 'make dist'-created tarball is about 300K big. So, if you want to just have a look on it without patching your automake, just send me a notice, I'll send it to you, bypassing this list. Best, Nicolai
nasty_f90.tar.bz2
Description: application/bzip-compressed-tar
am_fortran_module_interdeps.diff.gz
Description: GNU Zip compressed data