Changeset 2298 for LMDZ5/branches/testing/create_make_gcm
- Timestamp:
- Jun 14, 2015, 9:13:32 PM (10 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2238-2257,2259-2271,2273,2277-2282,2284-2288,2290-2291
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/create_make_gcm
r2160 r2298 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` … … 48 50 fi 49 51 echo "LOCAL_DIR=`echo $localdir`" 50 echo ' BIBIO = $(LIBF)/bibio'52 echo 'MISC = $(LIBF)/misc' 51 53 echo "FILTRE = filtre" 52 54 echo "PHYS = " 53 55 echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a' 56 echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a' 54 57 echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)' 55 58 echo 'RM=rm' … … 60 63 echo 'L_DYN = -ldyn$(DIM)d$(FLAG_PARA) -ldyn3d_common' 61 64 echo 'L_FILTRE = -l$(FILTRE)' 65 echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) ' 62 66 echo 'L_PHY = -lphy$(PHYS) ' 63 echo 'L_ BIBIO = -lbibio'67 echo 'L_MISC = -lmisc' 64 68 echo 'L_ADJNT =' 65 69 echo 'L_COSP = -lcosp' … … 87 91 echo 'DYN = dyn$(DIM)d' 88 92 echo 89 #echo 'main : chimie $(DYN) bibiophys $(OPTION_DEP) '90 echo 'main : $(DYN) bibio phys$(OPTION_DEP) '93 #echo 'main : chimie $(DYN) misc phys $(OPTION_DEP) ' 94 echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) ' 91 95 echo ' cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\' 92 96 echo ' cd $(LOCAL_DIR); \' 93 97 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 94 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_BIBIO) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '98 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_MISC) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 95 99 echo 96 100 echo 'phys : $(LIBPHY)' … … 99 103 echo 'dyn1d :' 100 104 echo 105 echo 'dyn_phy: $(LIBDYN_PHYS)' 101 106 echo 102 107 #echo 'chimie : $(LIBO)/libchimie.a' 103 108 echo 104 echo ' bibio : $(LIBO)/libbibio.a'109 echo 'misc : $(LIBO)/libmisc.a' 105 110 echo 106 111 echo 'adjnt : $(LIBO)/libadjnt.a' … … 121 126 cd $libf >/dev/null 2>&1 122 127 123 for diri in ` ls `; do128 for diri in $src_dirs ; do 124 129 125 130 if [ -d $diri ] ; then 126 if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ] ; then131 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 127 132 # cd $diri >/dev/null 2>&1 128 133 echo 129 134 listlib="" 130 135 # 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' ) ` 136 for fili in `ls $diri/*.[fF]` ; do 137 # Check if file is a routine or main program 138 # i.e: look for the "program" keword preceeded by leading spaces 139 test=` ( head $fili | grep -i '^ *program' ) ` 140 # if it is not a main program, add it to the list 133 141 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 134 142 done 135 for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do 136 test=` ( head $fili | grep 'PROGRAM' ) ` 143 for fili in `ls $diri/*.[fF]90` ; do 144 # Check if file is a routine or main program 145 # i.e. look for "program" keyword (with possibly some leading spaces) 146 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 147 # if it is not a main program, add it to the list 137 148 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 138 149 done … … 140 151 echo $listlib >> $logfile 141 152 echo 153 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 154 topdiri=${diri%/*} 142 155 echo "#==================================================================" 143 156 echo "# Contenu de la bibliotheque correspondant au Directory "$diri … … 146 159 for trufile in $listlib ; do 147 160 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 148 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"161 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 149 162 echo 150 163 done 151 echo '.PRECIOUS : $(LIBO)/lib'$ diri'.a'152 echo 153 echo 154 echo "# Compilation des membres de la bibliotheque lib"$diri".a"164 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 165 echo 166 echo 167 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 155 168 echo 156 169 for trufile in $listlib ; do … … 159 172 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 160 173 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 161 str1='$(LIBO)/lib'$ diri'.a('$fili'.o) : $(LIBF)/'$trufile174 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 162 175 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 163 176 … … 175 188 strj=`echo $stri | tr [A-Z] [a-z]` 176 189 str2="" 177 for dirinc in filtrez bibio dyn3d_common grid dyn3d phydev $diri $diri/*/; do190 for dirinc in $src_dirs ; do 178 191 # Recherche dans l'ordre hierarchique inverse car seule la derniere 179 192 # ligne est conservee 180 if [ $dirinc = phydev ] ; then181 dirstr='$(PHYS)'182 libstr='phy$(PHYS)'183 else193 # if [ $dirinc = phydev ] ; then 194 # dirstr='$(PHYS)' 195 # libstr='phy$(PHYS)' 196 # else 184 197 dirstr=$dirinc 185 198 libstr=$dirinc 186 fi199 # fi 187 200 echo dirinc $dirinc >> $logfile 188 201 if [ -f $dirinc/$stri ] ; then … … 214 227 # object from library 215 228 echo ' cd $(LIBO); \' 216 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'229 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 217 230 if [ "$F90" -eq '0' ] ; then 218 231 ## Fixed Form Fortran 77 … … 228 241 fi 229 242 # Put generated object in library 230 echo ' $(AR) r $(LIBO)/lib'$ diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'243 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 231 244 echo 232 245 done
Note: See TracChangeset
for help on using the changeset viewer.