/[MITgcm]/MITgcm/tools/f90mkdepend
ViewVC logotype

Diff of /MITgcm/tools/f90mkdepend

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by jahn, Sat May 1 17:48:17 2010 UTC revision 1.7 by jahn, Wed Dec 11 21:53:02 2013 UTC
# Line 4  Line 4 
4  #  #
5  # Generate some make file dependency entries for a Fortran 90 file that employs "use".  # Generate some make file dependency entries for a Fortran 90 file that employs "use".
6  #  #
7  # For every "use" statement, generate a dependency on tolower(modulename).o  # For every "use" statement, generate a dependency on lowercase(modulename).o
8  #  #
9  # Note: We assume that the name of a module and the same of source are the same.  # Note: We assume that the name of a module and the same of source are the same.
10  #       The name of the source file should be all lower case (except for the extension).  #       The name of the source file should be all lower case (except for the extension).
# Line 18  for filename in *.F90 *.F *.h; do Line 18  for filename in *.F90 *.F *.h; do
18    # quick check for "use" to speed up processing    # quick check for "use" to speed up processing
19    if grep -i '^ *use ' $filename > /dev/null; then    if grep -i '^ *use ' $filename > /dev/null; then
20      # extract module name in lower case      # extract module name in lower case
21      modreflist=$(grep -i '^ *use ' $filename | awk '{sub(/,.*/,"",$2); print tolower($2)}')      modreflist=$(grep -i '^ *use ' $filename | awk '{print tolower($2)}' | sed 's/,.*$//')
22    
23      echo "$filename => $modreflist" >> f90mkdepend.log      echo "$filename => $modreflist" >> f90mkdepend.log
24    
# Line 30  for filename in *.F90 *.F *.h; do Line 30  for filename in *.F90 *.F *.h; do
30        # ignore modules that don't have an appropriately named source file        # ignore modules that don't have an appropriately named source file
31        if [ -f $m.F90 ] || [ -f $m.F ]; then        if [ -f $m.F90 ] || [ -f $m.F ]; then
32          depline="$depline $m.o"          depline="$depline $m.o"
33          elif [ -f ${m%_mod}.F90 ] || [ -f ${m%_mod}.F ]; then
34            # source file name is module name without "_mod"
35            depline="$depline ${m%_mod}.o"
36          else
37            echo "WARNING: f90mkdepend: no source file found for module $m" 1>&2
38        fi        fi
39      done      done
40      echo $depline      echo $depline

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22