Changeset 2238 for LMDZ5/trunk/create_make_gcm
- Timestamp:
- Mar 20, 2015, 11:54:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/create_make_gcm
r2085 r2238 5 5 #set -xv 6 6 7 # arguments given to create_make_gcm are the directories to scan 8 src_dirs=$* 7 9 8 10 machine=`hostname` … … 121 123 cd $libf >/dev/null 2>&1 122 124 123 for diri in ` ls `; do125 for diri in $src_dirs ; do 124 126 125 127 if [ -d $diri ] ; then 126 if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ] ; then128 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 127 129 # cd $diri >/dev/null 2>&1 128 130 echo 129 131 listlib="" 130 132 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 131 for fili in `ls $diri/*.[fF] $diri/*/*.[fF]` ; do 132 test=` ( head $fili | grep ' PROGRAM' ) ` 133 for fili in `ls $diri/*.[fF]` ; do 134 # Check if file is a routine or main program 135 # i.e: look for the "program" keword preceeded by leading spaces 136 test=` ( head $fili | grep -i '^ *program' ) ` 137 # if it is not a main program, add it to the list 133 138 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 134 139 done 135 for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do 136 test=` ( head $fili | grep 'PROGRAM' ) ` 140 for fili in `ls $diri/*.[fF]90` ; do 141 # Check if file is a routine or main program 142 # i.e. look for "program" keyword (with possibly some leading spaces) 143 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 144 # if it is not a main program, add it to the list 137 145 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 138 146 done … … 140 148 echo $listlib >> $logfile 141 149 echo 150 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 151 topdiri=${diri%/*} 142 152 echo "#==================================================================" 143 153 echo "# Contenu de la bibliotheque correspondant au Directory "$diri … … 146 156 for trufile in $listlib ; do 147 157 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 148 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"158 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 149 159 echo 150 160 done 151 echo '.PRECIOUS : $(LIBO)/lib'$ diri'.a'152 echo 153 echo 154 echo "# Compilation des membres de la bibliotheque lib"$diri".a"161 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 162 echo 163 echo 164 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 155 165 echo 156 166 for trufile in $listlib ; do … … 159 169 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 160 170 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 161 str1='$(LIBO)/lib'$ diri'.a('$fili'.o) : $(LIBF)/'$trufile171 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 162 172 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 163 173 … … 175 185 strj=`echo $stri | tr [A-Z] [a-z]` 176 186 str2="" 177 for dirinc in filtrez bibio dyn3d_common grid dyn3d phydev $diri $diri/*/; do187 for dirinc in $src_dirs ; do 178 188 # Recherche dans l'ordre hierarchique inverse car seule la derniere 179 189 # ligne est conservee 180 if [ $dirinc = phydev ] ; then181 dirstr='$(PHYS)'182 libstr='phy$(PHYS)'183 else190 # if [ $dirinc = phydev ] ; then 191 # dirstr='$(PHYS)' 192 # libstr='phy$(PHYS)' 193 # else 184 194 dirstr=$dirinc 185 195 libstr=$dirinc 186 fi196 # fi 187 197 echo dirinc $dirinc >> $logfile 188 198 if [ -f $dirinc/$stri ] ; then … … 214 224 # object from library 215 225 echo ' cd $(LIBO); \' 216 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'226 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 217 227 if [ "$F90" -eq '0' ] ; then 218 228 ## Fixed Form Fortran 77 … … 228 238 fi 229 239 # Put generated object in library 230 echo ' $(AR) r $(LIBO)/lib'$ diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'240 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 231 241 echo 232 242 done
Note: See TracChangeset
for help on using the changeset viewer.