>> Most (all?) modern Fortran compilers have some sort of flag that can be used in order to specify the output directory for the .mod files.
Could you explain what is the alternative MPICH strategy for compilers which do not support this kind of flag ? > If you don't need a fully robust strategy that works for parallel make and all sorts of different corner cases (particular files deleted/touched, etc.), then you can likely get by with a simpler set of > rules. Actually, even when I delete all the .mod file, this does not force a rebuild. Is this one of your corner case ? It looks a major issue to me, if you do not want to use make clean to recompile everything. So, if i understand correctly, the safer way would be to use only dependencies with .f90 and .mod ? >> [2] https://gist.github.com/4190680 One last thing, in this example, why do you use a temporary stamp file, instead of creating a rule directly between the library and module files and the header ? -- Alexis Praga