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 lowercase(modulename).o |
# For every "use" statement, generate a dependency on tolower(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). |
16 |
|
|
17 |
for filename in *.F90 *.F *.h; do |
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 -q -i '^ *use ' $filename; 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 '{sub(/,.*/,"",$2); print tolower($2)}') |
22 |
|
|