automatic generation of .mod files?

Tobias Burnus wrote:
(Another thing I was thinking about was on-the-fly generation of .mod
files: If the .mod file couldn't be found for "USE module", the
compiler searches for the "module.f90" files (e.g. in only some
directories like /usr/{local/,}include/finclude/) and automatically
compiles it to generate a .mod file (and no assembler/object file).

What about putting the following into your "makefile" (it doesn't
work for "system" sourcefiles, but does work for your own)

..SUFFIXES: .m4 .c .F .f
SRCDIR = <your source directory>
OBJDIR = <HW/OS/compiler/flag-dependent "build" directory>
%.o : %.mod # Disable "gmake"s obnoxious implicit Modula-2 rule

cd ${OBJDIR}; ${FC} ${FFLAGS} -c ${SRCDIR}/$<


Relevant Pages