/[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.3 - (hide annotations) (download)
Tue May 13 19:02:00 2008 UTC (15 years, 10 months ago) by jahn
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint62, checkpoint59r, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +27 -17 lines
fix grep pattern and add diagnostic output (written to f90mkdepend.log)

1 cnh 1.1 #!/bin/csh -f
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     # Note: We assume that the name of a module and the same of source are the same.
7 jahn 1.3 # The name of the source file should be all lower case (except for the extension).
8 cnh 1.1 #
9 jahn 1.3 cat /dev/null > f90mkdepend.log
10    
11 jahn 1.2 set flist = ( `echo *.F90 *.F *.h` )
12 cnh 1.1 foreach filename ( $flist )
13 jahn 1.3 set dirlist = ( . )
14    
15     # Try and find some use statements
16     cat $filename | grep -i '^ *use ' >> f90mkdepend.log
17     set modreflist = `cat $filename | grep -i '^ *use ' | awk '{print tolower($2)}' | sed s'/,.*$//'`
18 cnh 1.1
19 jahn 1.3 if ("x$modreflist" != x) then
20     echo "$filename => $modreflist" >> f90mkdepend.log
21     endif
22 cnh 1.1
23 jahn 1.3 set depfiles = ( )
24     foreach m ( $modreflist )
25     set depfile = ( )
26     foreach d ( $dirlist )
27     if ( -f $m.F90 || -f $m.F ) then
28     if ( $depfile == "" ) then
29     set depfile = ( $m.o )
30     endif
31     endif
32     end
33     set depfiles = ( $depfiles $depfile )
34     end
35     set ext=`echo ${filename:e} | sed -e 's/F/f/'`
36     echo ${filename:r}.${ext}: $depfiles
37 cnh 1.1 end

  ViewVC Help
Powered by ViewVC 1.1.22