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

Annotation of /MITgcm/tools/f90mkdepend

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


Revision 1.6 - (hide annotations) (download)
Mon May 3 14:35:01 2010 UTC (13 years, 10 months ago) by jahn
Branch: MAIN
CVS Tags: checkpoint64q, checkpoint64p, checkpoint64r, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint63, checkpoint62g, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.5: +2 -2 lines
make oawk compatible

1 jahn 1.4 #!/bin/bash
2 jahn 1.3 # $Header$
3     # $Name$
4 cnh 1.1 #
5     # Generate some make file dependency entries for a Fortran 90 file that employs "use".
6 jahn 1.4 #
7 jahn 1.6 # For every "use" statement, generate a dependency on lowercase(modulename).o
8 jahn 1.4 #
9 cnh 1.1 # Note: We assume that the name of a module and the same of source are the same.
10 jahn 1.3 # The name of the source file should be all lower case (except for the extension).
11 jahn 1.4
12     # don't complain if *.F90 doesn't match any files
13     shopt -s nullglob
14    
15 jahn 1.3 cat /dev/null > f90mkdepend.log
16    
17 jahn 1.4 for filename in *.F90 *.F *.h; do
18     # quick check for "use" to speed up processing
19 jahn 1.5 if grep -i '^ *use ' $filename > /dev/null; then
20 jahn 1.4 # extract module name in lower case
21 jahn 1.6 modreflist=$(grep -i '^ *use ' $filename | awk '{print tolower($2)}' | sed 's/,.*$//')
22 cnh 1.1
23 jahn 1.3 echo "$filename => $modreflist" >> f90mkdepend.log
24 cnh 1.1
25 jahn 1.4 # change .F90 into .f90, .F into .f for target
26     preprocessed=$(echo $filename | sed -e 's/\.F$/.f/' -e 's/\.F90$/.f90/')
27    
28     depline="$preprocessed:"
29     for m in $modreflist; do
30     # ignore modules that don't have an appropriately named source file
31     if [ -f $m.F90 ] || [ -f $m.F ]; then
32     depline="$depline $m.o"
33     fi
34     done
35     echo $depline
36     fi
37     done
38    

  ViewVC Help
Powered by ViewVC 1.1.22