/[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.2 - (hide annotations) (download)
Thu May 8 19:45:38 2008 UTC (15 years, 11 months ago) by jahn
Branch: MAIN
Changes since 1.1: +4 -3 lines
look for 'use' statements also in .F and .h files

1 cnh 1.1 #!/bin/csh -f
2     #
3     # Generate some make file dependency entries for a Fortran 90 file that employs "use".
4     # Note: We assume that the name of a module and the same of source are the same.
5     #
6 jahn 1.2 set flist = ( `echo *.F90 *.F *.h` )
7 cnh 1.1 foreach filename ( $flist )
8     set dirlist = ( . )
9    
10     # Try and find some use statements
11     set modreflist = `cat $filename | grep '[ *] use ' | awk '{print $2}' | sed s'/,//'`
12    
13     set depfiles = ( )
14     foreach m ( $modreflist )
15     set depfile = ( )
16     foreach d ( $dirlist )
17 jahn 1.2 if ( -f $m.F90 || -f $m.F ) then
18 cnh 1.1 if ( $depfile == "" ) then
19     set depfile = ( $m.o )
20     endif
21     endif
22     end
23     set depfiles = ( $depfiles $depfile )
24     end
25 jahn 1.2 set ext=`echo ${filename:e} | sed -e 's/F/f/'`
26     echo ${filename:r}.${ext}: $depfiles
27 cnh 1.1 end

  ViewVC Help
Powered by ViewVC 1.1.22