A build system (yet another dependency generator) for Fortran codes that requires GNU make and Python (v2.3 or later).
It can be downloaded from here
The system has been used to sucessfully build codes like BOM, HYCOM, MICOM, ARPEGE Climat, Giss.
The main design idea is to enable a single, simple makefile to build your (large) code with GNU make taking care of dependencies via include files in the Makefile. It should be possible to override the default compilation flags for groups of files, and use the parallel make feature of GNU make.
The main motivation for writing this tool was that none of the available dependency generators on the internet were able to parse and track the dependencies of the ~500000 LOC "ARPEGE Climat" code. SCons came close but I found I could write a tool that worked for me faster than learning how to use it properly... so here we go.
In the directory where you want to locate your Makefile, unpack the mkdep.tgz file above
tar xvzf mkdep.tgzPut the path to mkdep first in the path, e.g. for "bash" like shells:
export PATH=$PWD/mkdep:$PATHA minimal Makefile in this directory for two source files would look like this
SOURCEFILES= file1.f90 file2.f90 include mkdep/rulesIf a file resides in a subdirectory give the full path, e.g.
SOURCEFILES= ./directory1/file1.f90 ./directory2/file2.f90then, from the command line
mkdep reset make dep maketo build the project. By default the fortran compiler is assumed to be "gfortran", this, and other things can be overridden. The name of the fortran compiler can be specified via FORTRANCOMPILER makefile variable. see the "rules" file for more. If you change the list of source files or modify code in such a way that dependencies between files are changed you will need to rerun
make depotherwise, rebuilding the code can be done with a single "make". "mkdep reset" is only used the first time to initialize some hidden files mkdep assumes to be located in the current directory. "make dep" invokes mkdep to create a list of dependencies for the files listed in the SOURCEFILES variable. The list of object files and their dependencies are included via the "include .../rules" line.
the system has been tested with Linux, AIX and Windows XP.
"#include"and the Fortran USE and INCLUDE statements.
USE & MODULE1and
USE MODULE1; USE MOdulE2