Ignore:
Timestamp:
Mar 2, 2007 6:32:25 AM (17 years ago)
Author:
raasch
Message:

documentation update for the new svn-based version and for 3.1c, update of .mrun.config.default, -u in mbuild only compiles scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mbuild

    r35 r40  
    11#!/bin/ksh
    2 # mbuild - Programmuebersetzungsscript   Version:  @(#)MBUILD 1.0    28/02/07
     2# mbuild - Programmuebersetzungsscript   Version:  @(#)MBUILD 1.0    02/03/07
    33
    44     # Prozedur zur Uebersetzung von Programmteilen mittels make-Mechanismus
     
    7979     # 07/02/07 - Siggi - adapted for RIAM (neck)
    8080     # 10/02/07 - Siggi - all hpmuk-related code removed
    81      # 28/02/07 - Siggi - compilation of utility programs and transfer of
     81     # 02/03/07 - Siggi - compilation of utility programs and transfer of
    8282     #                    scripts to remote hosts added (option -u)
    8383
     
    359359
    360360
    361  cd  $local_source_path
    362 
    363 
    364     # LISTE DER ZU PRUEFENDEN QUELLTEXTDATEIEN ERSTELLEN
    365  source_code_files=`ls -1  *.$suf`
    366 
    367 
    368 
    369     # VERZEICHNIS FUER DAS MAKE-DEPOSITORY ERZEUGEN,
    370     # FALLS NOCH NICHT VORHANDEN. ANSONSTEN ALLE DATEIEN
    371     # NEUEREN DATUMS IN DIESES VERZEICHNIS KOPIEREN
    372  if [[ ! -d $local_depository_path ]]
     361 if [[ $compile_utility_programs = false ]]
    373362 then
    374     if  mkdir $local_depository_path
    375     then
    376        printf "\n\n  *** directory for make depository:"
    377        printf "\n           $local_depository_path"
    378        printf "\n      was created\n"
    379 
    380           # MAKEFILE UND QUELLTEXTDATEIEN UNTER BEIBEHALTUNG
    381           # IHRES DATUMS INS VERZEICHNIS KOPIEREN
    382        printf "\n  *** makefile and source code files are copied to"
    383        printf "\n      $local_depository_path\n"
    384        printf "\n      copying makefile \"$makefile\" ..."
    385        cp -p  $makefile  $local_depository_path/Makefile
    386 
    387           # QUELLTEXTDATEIEN MUESSEN IM MAKEFILE AUFGEFUEHRT
    388           # SEIN
     363
     364    cd  $local_source_path
     365
     366
     367       # LISTE DER ZU PRUEFENDEN QUELLTEXTDATEIEN ERSTELLEN
     368    source_code_files=`ls -1  *.$suf`
     369
     370
     371
     372       # VERZEICHNIS FUER DAS MAKE-DEPOSITORY ERZEUGEN,
     373       # FALLS NOCH NICHT VORHANDEN. ANSONSTEN ALLE DATEIEN
     374       # NEUEREN DATUMS IN DIESES VERZEICHNIS KOPIEREN
     375    if [[ ! -d $local_depository_path ]]
     376    then
     377       if  mkdir $local_depository_path
     378       then
     379          printf "\n\n  *** directory for make depository:"
     380          printf "\n           $local_depository_path"
     381          printf "\n      was created\n"
     382
     383             # MAKEFILE UND QUELLTEXTDATEIEN UNTER BEIBEHALTUNG
     384             # IHRES DATUMS INS VERZEICHNIS KOPIEREN
     385          printf "\n  *** makefile and source code files are copied to"
     386          printf "\n      $local_depository_path\n"
     387          printf "\n      copying makefile \"$makefile\" ..."
     388          cp -p  $makefile  $local_depository_path/Makefile
     389
     390             # QUELLTEXTDATEIEN MUESSEN IM MAKEFILE AUFGEFUEHRT
     391             # SEIN
     392          for  filename  in  $source_code_files
     393          do
     394             if [[ $(grep -c $filename  $makefile) = 0 ]]
     395             then
     396                printf "\n  +++ source code file:"
     397                printf "\n         $filename"
     398                printf "\n      is not listed in makefile"
     399                locat=makefile; exit
     400             else
     401                printf "\n      copying source code file \"$filename\" ..."
     402                cp -p  $filename  $local_depository_path
     403             fi
     404          done
     405          printf "\n"
     406       else
     407          printf "\n  +++ directory for make depository:"
     408          printf "\n           $local_depository_path"
     409          printf "\n      cannot be created"
     410          locat=local_depository_path; exit
     411       fi
     412    else
     413 
     414       printf "\n  *** checking file status ..."
     415
     416          # MAKEFILE KOPIEREN, FALLS NEUEREN DATUMS
     417       if [[ $makefile -nt $local_depository_path/Makefile ]]
     418       then
     419          printf "\n  *** update of \"$makefile\" "
     420          cp -f -p  $makefile  $local_depository_path/Makefile
     421          update=true
     422
     423             # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY AUCH IM NEUEN MAKEFILE
     424             # VERZEICHNET SIND UND GEGEBENENFALLS DATEIEN LOESCHEN
     425          cd  $local_depository_path
     426          source_code_files_in_depository=`ls -1  *.$suf`
     427          for  filename  in  $source_code_files_in_depository
     428          do
     429             if [[ $(grep -c $filename  Makefile) = 0 ]]
     430             then
     431                printf "\n  *** source code file in \"$local_depository_path\":"
     432                printf "\n         $filename"
     433                printf "\n      is not listed in makefile"
     434                if [[ $silent = false ]]
     435                then
     436                   answer=dummy
     437                   printf "\n\n"
     438                   while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
     439                   do
     440                      printf " >>> delete \"$filename\" in \"$local_depository_path\" (y/n) ?  "
     441                      read  answer
     442                   done
     443                   if [[ $answer = y  ||  $answer = Y ]]
     444                   then
     445                      base=`echo $filename | cut -d. -f2`
     446                      rm -f  $filename
     447                      rm -f  ${base}.o  ${base}.mod
     448                      printf "\n  *** \"$filename\" deleted in \"$local_depository_path\" "
     449                   else
     450                      printf "\n  *** \"$filename\" not deleted in \"$local_depository_path\" "
     451                   fi
     452                fi
     453             fi
     454          done
     455          cd  -  > /dev/null  2>&1
     456
     457       elif [[ $local_depository_path/Makefile -nt $makefile ]]
     458       then
     459          printf "\n  *** makefile in depository is newer than"
     460          printf "\n      \"$makefile\" "
     461          if [[ $silent = false ]]
     462          then
     463             answer=dummy
     464             printf "\n\n"
     465             while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
     466             do
     467                printf " >>> update \"$makefile\" (y/n) ?  "
     468                read  answer
     469             done
     470             if [[ $answer = y  ||  $answer = Y ]]
     471             then
     472                cp -f -p  $local_depository_path/Makefile  $makefile
     473                printf "\n  *** \"$makefile\" updated"
     474             else
     475                printf "\n  *** \"$makefile\" not updated"
     476             fi
     477          fi
     478       fi
     479
     480          # QUELLTEXTDATEIEN KOPIEREN, FALLS NEUEREN DATUMS
     481          # SIE MUESSEN IM MAKEFILE AUFGEFUEHRT SEIN
    389482       for  filename  in  $source_code_files
    390483       do
     
    396489             locat=makefile; exit
    397490          else
    398              printf "\n      copying source code file \"$filename\" ..."
    399              cp -p  $filename  $local_depository_path
     491             if [[ ! -f $local_depository_path/$filename ]]
     492             then
     493                cp -p  $filename  $local_depository_path
     494                printf "\n  *** source code file \"$filename\" created in \"$local_depository_path\" "
     495             fi
     496             if [[ $filename -nt $local_depository_path/$filename ]]
     497             then
     498                printf "\n  *** update of source code file \"$filename\" "
     499                cp -f -p  $filename  $local_depository_path
     500                update=true
     501             fi
    400502          fi
    401503       done
    402        printf "\n"
    403     else
    404        printf "\n  +++ directory for make depository:"
    405        printf "\n           $local_depository_path"
    406        printf "\n      cannot be created"
    407        locat=local_depository_path; exit
    408     fi
    409  else
    410  
    411     printf "\n  *** checking file status ..."
    412 
    413        # MAKEFILE KOPIEREN, FALLS NEUEREN DATUMS
    414     if [[ $makefile -nt $local_depository_path/Makefile ]]
    415     then
    416        printf "\n  *** update of \"$makefile\" "
    417        cp -f -p  $makefile  $local_depository_path/Makefile
    418        update=true
    419 
    420           # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY AUCH IM NEUEN MAKEFILE
    421           # VERZEICHNET SIND UND GEGEBENENFALLS DATEIEN LOESCHEN
     504
     505
     506          # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY IM AKTUELLEN ARBEITSVERZEICHNIS VORHANDEN
     507          # ODER EVTL. NEUEREN DATUMS SIND
    422508       cd  $local_depository_path
    423509       source_code_files_in_depository=`ls -1  *.$suf`
     510       cd  -  > /dev/null  2>&1
    424511       for  filename  in  $source_code_files_in_depository
    425512       do
    426           if [[ $(grep -c $filename  Makefile) = 0 ]]
     513          if [[ ! -f $filename ]]
    427514          then
    428              printf "\n  *** source code file in \"$local_depository_path\":"
    429              printf "\n         $filename"
    430              printf "\n      is not listed in makefile"
     515             printf "\n  *** source code file \"$filename\" does not exist in current directory"
    431516             if [[ $silent = false ]]
    432517             then
     
    435520                while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
    436521                do
    437                    printf " >>> delete \"$filename\" in \"$local_depository_path\" (y/n) ?  "
     522                   printf " >>> create \"$filename\" in current directory (y/n) ?  "
    438523                   read  answer
    439524                done
    440525                if [[ $answer = y  ||  $answer = Y ]]
    441526                then
    442                    base=`echo $filename | cut -d. -f2`
    443                    rm -f  $filename
    444                    rm -f  ${base}.o  ${base}.mod
    445                    printf "\n  *** \"$filename\" deleted in \"$local_depository_path\" "
     527                   cp -p  $local_depository_path/$filename  $filename
     528                   printf "\n  *** source code file \"$filename\" created in current directory"
    446529                else
    447                    printf "\n  *** \"$filename\" not deleted in \"$local_depository_path\" "
     530                   printf "\n  *** source code file \"$filename\" not created in current directory"
     531                fi
     532             fi
     533          elif [[ $local_depository_path/$filename -nt $filename ]]
     534          then
     535             ls -al $local_depository_path/$filename
     536             ls -al $filename
     537             printf "\n  *** source code file \"$filename\" in depository is newer than in current directory"
     538             if [[ $silent = false ]]
     539             then
     540                answer=dummy
     541                printf "\n\n"
     542                while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
     543                do
     544                   printf " >>> update \"$filename\" in current directory (y/n) ?  "
     545                   read  answer
     546                done
     547                if [[ $answer = y  ||  $answer = Y ]]
     548                then
     549                   cp -f -p  $local_depository_path/$filename  $filename
     550                   printf "\n  *** source code file \"$filename\" updated in current directory"
     551                else
     552                   printf "\n  *** source code file \"$filename\" not updated in current directory"
    448553                fi
    449554             fi
    450555          fi
    451556       done
    452        cd  -  > /dev/null  2>&1
    453 
    454     elif [[ $local_depository_path/Makefile -nt $makefile ]]
    455     then
    456        printf "\n  *** makefile in depository is newer than"
    457        printf "\n      \"$makefile\" "
    458        if [[ $silent = false ]]
    459        then
    460           answer=dummy
    461           printf "\n\n"
    462           while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
    463           do
    464              printf " >>> update \"$makefile\" (y/n) ?  "
    465              read  answer
    466           done
    467           if [[ $answer = y  ||  $answer = Y ]]
    468           then
    469              cp -f -p  $local_depository_path/Makefile  $makefile
    470              printf "\n  *** \"$makefile\" updated"
    471           else
    472              printf "\n  *** \"$makefile\" not updated"
    473           fi
    474        fi
    475     fi
    476 
    477        # QUELLTEXTDATEIEN KOPIEREN, FALLS NEUEREN DATUMS
    478        # SIE MUESSEN IM MAKEFILE AUFGEFUEHRT SEIN
    479     for  filename  in  $source_code_files
    480     do
    481        if [[ $(grep -c $filename  $makefile) = 0 ]]
    482        then
    483           printf "\n  +++ source code file:"
    484           printf "\n         $filename"
    485           printf "\n      is not listed in makefile"
    486           locat=makefile; exit
    487        else
    488           if [[ ! -f $local_depository_path/$filename ]]
    489           then
    490              cp -p  $filename  $local_depository_path
    491              printf "\n  *** source code file \"$filename\" created in \"$local_depository_path\" "
    492           fi
    493           if [[ $filename -nt $local_depository_path/$filename ]]
    494           then
    495              printf "\n  *** update of source code file \"$filename\" "
    496              cp -f -p  $filename  $local_depository_path
    497              update=true
    498           fi
    499        fi
    500     done
    501 
    502 
    503        # PRUEFEN, OB ALLE DATEIEN IM DEPOSITORY IM AKTUELLEN ARBEITSVERZEICHNIS VORHANDEN
    504        # ODER EVTL. NEUEREN DATUMS SIND
    505     cd  $local_depository_path
    506     source_code_files_in_depository=`ls -1  *.$suf`
    507     cd  -  > /dev/null  2>&1
    508     for  filename  in  $source_code_files_in_depository
    509     do
    510        if [[ ! -f $filename ]]
    511        then
    512           printf "\n  *** source code file \"$filename\" does not exist in current directory"
     557
     558       if [[ $update = false ]]
     559       then
     560          printf "\n  *** no updates necessary in \"$local_depository_path\" "
    513561          if [[ $silent = false ]]
    514562          then
     
    517565             while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
    518566             do
    519                 printf " >>> create \"$filename\" in current directory (y/n) ?  "
     567                printf " >>> continue with updates on remote hosts (y/n) ?  "
    520568                read  answer
    521569             done
    522              if [[ $answer = y  ||  $answer = Y ]]
    523              then
    524                 cp -p  $local_depository_path/$filename  $filename
    525                 printf "\n  *** source code file \"$filename\" created in current directory"
    526              else
    527                 printf "\n  *** source code file \"$filename\" not created in current directory"
     570             if [[ $answer = n  ||  $answer = N ]]
     571             then
     572                locat=user_abort; exit
    528573             fi
    529574          fi
    530        elif [[ $local_depository_path/$filename -nt $filename ]]
    531        then
    532           ls -al $local_depository_path/$filename
    533           ls -al $filename
    534           printf "\n  *** source code file \"$filename\" in depository is newer than in current directory"
    535           if [[ $silent = false ]]
    536           then
    537              answer=dummy
    538              printf "\n\n"
    539              while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
    540              do
    541                 printf " >>> update \"$filename\" in current directory (y/n) ?  "
    542                 read  answer
    543              done
    544              if [[ $answer = y  ||  $answer = Y ]]
    545              then
    546                 cp -f -p  $local_depository_path/$filename  $filename
    547                 printf "\n  *** source code file \"$filename\" updated in current directory"
    548              else
    549                 printf "\n  *** source code file \"$filename\" not updated in current directory"
    550              fi
    551           fi
    552        fi
    553     done
    554 
    555     if [[ $update = false ]]
    556     then
    557        printf "\n  *** no updates necessary in \"$local_depository_path\" "
    558        if [[ $silent = false ]]
    559        then
    560           answer=dummy
    561           printf "\n\n"
    562           while [[ "$answer" != y  &&  "$answer" != Y  &&  "$answer" != n  &&  "$answer" != N ]]
    563           do
    564              printf " >>> continue with updates on remote hosts (y/n) ?  "
    565              read  answer
    566           done
    567           if [[ $answer = n  ||  $answer = N ]]
    568           then
    569              locat=user_abort; exit
    570           fi
    571        fi
    572     fi
     575       fi
     576    fi
     577 
     578
     579 
     580       # QUELLTEXTDATEIEN UND MAKEFILE MIT TAR ZUSAMMENBINDEN
     581       # IN JEDEM FALL ALLEN DATEIEN WRITE-PERMIT GEBEN, DAMIT ES AUF
     582       # DEN REMOTE-RECHNERN NICHT EVTL. ZU PROBLEMEN BEIM UEBERSCHREIBEN KOMMT
     583    printf "\n\n  *** tar of makefile and source files in depository ..." 
     584    cd  $local_depository_path
     585    chmod u+w  Makefile  *.$suf
     586    tar -cf  ${mainprog}_sources.tar  Makefile  *.$suf
     587    printf "\n"
     588
    573589 fi
    574  
    575 
    576  
    577     # QUELLTEXTDATEIEN UND MAKEFILE MIT TAR ZUSAMMENBINDEN
    578     # IN JEDEM FALL ALLEN DATEIEN WRITE-PERMIT GEBEN, DAMIT ES AUF
    579     # DEN REMOTE-RECHNERN NICHT EVTL. ZU PROBLEMEN BEIM UEBERSCHREIBEN KOMMT
    580  printf "\n\n  *** tar of makefile and source files in depository ..." 
    581  cd  $local_depository_path
    582  chmod u+w  Makefile  *.$suf
    583  tar -cf  ${mainprog}_sources.tar  Makefile  *.$suf
    584  printf "\n"
    585590
    586591
     
    11301135       then
    11311136
    1132              # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN
    1133              # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT
    1134           echo "  *** copying \"${mainprog}_sources.tar\" to \"${remote_addres}:${remote_md}/\" "
    1135           if [[ $remote_host != lctit ]]
     1137          if [[ $compile_utility_programs = false ]]
    11361138          then
    1137              ssh  ${remote_username}@${remote_addres} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
    1138           else
    1139                 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
    1140                 # MIT SSH, DESHALB AUFRUF PER PIPE
    1141              print "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"  |  ssh ${remote_username}@${remote_addres}  2>&1
    1142           fi
    1143           if [[ $local_host = decalpha ]]
    1144           then
    1145                 # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTÄNDIGEN PFADES
    1146                 # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM
    1147                 # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN
    1148              remote_md=`echo $remote_md | sed 's/\$HOME\///'`
    1149              /bin/scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
    1150           else
    1151              scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
    1152           fi
    1153 
    1154 
    1155 
    1156              # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN
    1157           echo "  *** untar previous update on remote host, if existing"
    1158           if [[ $remote_host != lctit ]]
    1159           then
    1160              ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
    1161           else
    1162                 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
    1163                 # MIT SSH, DESHALB AUFRUF PER PIPE
    1164              print  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
    1165           fi
    1166 
    1167 
    1168              # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN
    1169           echo "  *** untar actual sources on remote host"
    1170           if [[ $remote_host != lctit ]]
    1171           then
    1172              ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
    1173           else
    1174                 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
    1175                 # MIT SSH, DESHALB AUFRUF PER PIPE
    1176              print  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
    1177           fi
    1178 
    1179 
    1180              # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN
    1181              # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND
    1182              # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLEN MAKE
    1183              # Z.B. DIE PFADE ZUM COMPILER)
    1184           echo "  *** execute \"make\" on remote host"
    1185 
    1186           if [[ $remote_host = nech ]]
    1187           then
    1188              make_call_string="sxmake  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
    1189           else
    1190              make_call_string="make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
    1191           fi
    1192 
    1193           if [[ $remote_host = t3eh ]]
    1194           then
     1139
     1140                # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN
     1141                # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT
     1142             echo "  *** copying \"${mainprog}_sources.tar\" to \"${remote_addres}:${remote_md}/\" "
     1143             if [[ $remote_host != lctit ]]
     1144             then
     1145                ssh  ${remote_username}@${remote_addres} "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"
     1146             else
     1147                   # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
     1148                   # MIT SSH, DESHALB AUFRUF PER PIPE
     1149                print "[[ ! -d ${remote_md} ]]  &&  (echo \"  *** ${remote_md} will be created\"; mkdir -p  ${remote_md})"  |  ssh ${remote_username}@${remote_addres}  2>&1
     1150             fi
     1151             if [[ $local_host = decalpha ]]
     1152             then
     1153                   # DECALPHA BENUTZT BEI NICHTANGABE DES VOLLSTÄNDIGEN PFADES
     1154                   # IRGENDEIN ANDERES SCP (WAS NICHT FUNKTIONIERT). AUSSERDEM
     1155                   # KOENNEN DOLLAR-ZEICHEN NICHT BENUTZT WERDEN
     1156                remote_md=`echo $remote_md | sed 's/\$HOME\///'`
     1157                /bin/scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
     1158             else
     1159                scp  ${mainprog}_sources.tar  ${remote_username}@${remote_addres}:${remote_md}/${mainprog}_sources.tar
     1160             fi
     1161
     1162
     1163
     1164                # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN
     1165             echo "  *** untar previous update on remote host, if existing"
     1166             if [[ $remote_host != lctit ]]
     1167             then
     1168                ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"
     1169             else
     1170                   # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
     1171                   # MIT SSH, DESHALB AUFRUF PER PIPE
     1172                print  "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]]  &&  tar -xf  ${mainprog}_current_version.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
     1173             fi
     1174
     1175
     1176                # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN
     1177             echo "  *** untar actual sources on remote host"
     1178             if [[ $remote_host != lctit ]]
     1179             then
     1180                ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"
     1181             else
     1182                   # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
     1183                   # MIT SSH, DESHALB AUFRUF PER PIPE
     1184                print  "cd ${remote_md}; tar -xf  ${mainprog}_sources.tar"  |  ssh  ${remote_username}@${remote_addres}  2>&1
     1185             fi
     1186
     1187
     1188                # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN
     1189                # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND
     1190                # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLEN MAKE
     1191                # Z.B. DIE PFADE ZUM COMPILER)
     1192             echo "  *** execute \"make\" on remote host"
     1193
     1194             if [[ $remote_host = nech ]]
     1195             then
     1196                make_call_string="sxmake  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
     1197             else
     1198                make_call_string="make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" "
     1199             fi
     1200
     1201             if [[ $remote_host = t3eh ]]
     1202             then
    11951203       
    1196              print "xterm\nexit\n cd ${remote_md}; make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" " | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
    1197 
    1198           elif [[ $remote_host = t3ej2  ||  $remote_host = ibms  ||  $remote_host = ibmy ]]
    1199           then
    1200 
    1201              ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; echo '$make_call_string' > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll
    1202 
    1203           elif [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
    1204           then
    1205 
    1206              print "export OBJECT_MODE=64; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
    1207 
    1208           elif [[ $remote_host = lctit ]]
    1209           then
    1210 
    1211              echo  " "  >  ${remote_host}_last_make_protokoll
    1212              while [[ $(cat ${remote_host}_last_make_protokoll | grep -c "Forwarding to N1GE") = 0 ]]
    1213              do
     1204                print "xterm\nexit\n cd ${remote_md}; make  PROG=$mainprog  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$loader_options\" " | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
     1205
     1206             elif [[ $remote_host = t3ej2  ||  $remote_host = ibms  ||  $remote_host = ibmy ]]
     1207             then
     1208
     1209                ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; echo '$make_call_string' > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" 2>&1 | tee ${remote_host}_last_make_protokoll
     1210
     1211             elif [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
     1212             then
     1213
     1214                print "export OBJECT_MODE=64; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
     1215
     1216             elif [[ $remote_host = lctit ]]
     1217             then
     1218
     1219                echo  " "  >  ${remote_host}_last_make_protokoll
     1220                while [[ $(cat ${remote_host}_last_make_protokoll | grep -c "Forwarding to N1GE") = 0 ]]
     1221                do
     1222                   print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
     1223                done
     1224
     1225             else
     1226
    12141227                print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
    1215              done
    1216 
    1217           else
    1218 
    1219              print "cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll
    1220 
    1221           fi
    1222 
    1223           if [[ $(grep -c MAKE_ERROR ${remote_host}_last_make_protokoll) != 0 ]]
    1224           then
    1225              printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
    1226              if [[ $silent = false ]]
    1227              then
    1228                 answer=dummy
    1229                 printf "\n"
    1230                 while [[ "$answer" != c  &&  "$answer" != k ]]
    1231                 do
    1232                    printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
    1233                    read  answer
    1234                    if [[ "$answer" = l ]]
     1228
     1229             fi
     1230
     1231             if [[ $(grep -c MAKE_ERROR ${remote_host}_last_make_protokoll) != 0 ]]
     1232             then
     1233                printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
     1234                if [[ $silent = false ]]
     1235                then
     1236                   answer=dummy
     1237                   printf "\n"
     1238                   while [[ "$answer" != c  &&  "$answer" != k ]]
     1239                   do
     1240                      printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
     1241                      read  answer
     1242                      if [[ "$answer" = l ]]
     1243                      then
     1244                         more ${remote_host}_last_make_protokoll
     1245                      fi
     1246                   done
     1247                   if [[ $answer = k ]]
    12351248                   then
    1236                       more ${remote_host}_last_make_protokoll
     1249                      locat=user_abort; exit
    12371250                   fi
    1238                 done
    1239                 if [[ $answer = k ]]
    1240                 then
    1241                    locat=user_abort; exit
    12421251                fi
    12431252             fi
    1244           fi
    1245 
    1246 
    1247 
    1248              # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN
    1249           printf "\n  *** tar update on remote host ..."
    1250           if [[ $remote_host != lctit ]]
    1251           then
    1252              ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"
    1253           else
    1254                 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
    1255                 # MIT SSH, DESHALB AUFRUF PER PIPE
    1256              print  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"  |  ssh  ${remote_username}@${remote_addres}  2>&1
    1257           fi
    1258 
    1259 
    1260              # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN
    1261 #          printf "\n  *** \"make clean\" on remote host ..."
    1262 #          ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; make clean; rm ${mainprog}_sources.tar; rm *.f90 Makefile"
    1263 #          printf "\n"
     1253
     1254
     1255
     1256                # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN
     1257             printf "\n  *** tar update on remote host ..."
     1258             if [[ $remote_host != lctit ]]
     1259             then
     1260                ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"
     1261             else
     1262                   # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS
     1263                   # MIT SSH, DESHALB AUFRUF PER PIPE
     1264                print  "cd ${remote_md}; chmod u+w *; tar -cf  ${mainprog}_current_version.tar  *.f90 *.o *.mod"  |  ssh  ${remote_username}@${remote_addres}  2>&1
     1265             fi
     1266
     1267
     1268                # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN
     1269#             printf "\n  *** \"make clean\" on remote host ..."
     1270#             ssh  ${remote_username}@${remote_addres}  "cd ${remote_md}; make clean; rm ${mainprog}_sources.tar; rm *.f90 Makefile"
     1271#             printf "\n"
    12641272
    12651273
     
    12691277             # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN
    12701278             # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT
    1271           if [[ $compile_utility_programs = true ]]
     1279          elif [[ $compile_utility_programs = true ]]
    12721280          then
    12731281
     
    13611369       else
    13621370
    1363              # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF LOKALEM RECHNER AUSFUEHREN
    1364           echo " "
    1365           echo "  *** execute \"make\" on local host"
    1366 
    1367           make  PROG=$mainprog  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$loader_options"  2>&1 | tee ${remote_host}_last_make_protokoll
    1368 
    1369           if [[ $? != 0 ]]
     1371          if [[ $compile_utility_programs = false ]]
    13701372          then
    1371              printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
    1372              if [[ $silent = false ]]
    1373              then
    1374                 answer=dummy
    1375                 printf "\n"
    1376                 while [[ "$answer" != c  &&  "$answer" != k ]]
    1377                 do
    1378                    printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
    1379                    read  answer
    1380                    if [[ "$answer" = l ]]
     1373
     1374                # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF LOKALEM RECHNER AUSFUEHREN
     1375             echo " "
     1376             echo "  *** execute \"make\" on local host"
     1377
     1378             make  PROG=$mainprog  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$loader_options"  2>&1 | tee ${remote_host}_last_make_protokoll
     1379
     1380             if [[ $? != 0 ]]
     1381             then
     1382                printf "\a\n  +++ error(s) occurred during compiling or linking on host \"$remote_host\" "
     1383                if [[ $silent = false ]]
     1384                then
     1385                   answer=dummy
     1386                   printf "\n"
     1387                   while [[ "$answer" != c  &&  "$answer" != k ]]
     1388                   do
     1389                      printf "  >>> continue / list errors / kill mbuild (c/l/k) ? "
     1390                      read  answer
     1391                      if [[ "$answer" = l ]]
     1392                      then
     1393                         more ${remote_host}_last_make_protokoll
     1394                      fi
     1395                   done
     1396                   if [[ $answer = k ]]
    13811397                   then
    1382                       more ${remote_host}_last_make_protokoll
     1398                      locat=user_abort; exit
    13831399                   fi
    1384                 done
    1385                 if [[ $answer = k ]]
    1386                 then
    1387                    locat=user_abort; exit
    13881400                fi
    13891401             fi
    1390           fi
    1391 
    1392 
    1393              # NEUE VERSION AUF LOKALEM RECHNER ZUSAMMENPACKEN
    1394           printf "\n  *** tar update on local host ..."
    1395           tar -cf  ${mainprog}_current_version.tar  *.$suf *.o *.mod
     1402
     1403
     1404                # NEUE VERSION AUF LOKALEM RECHNER ZUSAMMENPACKEN
     1405             printf "\n  *** tar update on local host ..."
     1406             tar -cf  ${mainprog}_current_version.tar  *.$suf *.o *.mod
    13961407
    13971408
    13981409             # COMPILE THE UTILITY PROGRAMS
    1399           if [[ $compile_utility_programs = true ]]
     1410          elif [[ $compile_utility_programs = true ]]
    14001411          then
    14011412             printf "\n\n"
Note: See TracChangeset for help on using the changeset viewer.