/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.69 by edhill, Wed Feb 25 19:12:10 2004 UTC revision 1.84 by edhill, Mon Jul 12 15:49:08 2004 UTC
# Line 1  Line 1 
1  #! /usr/bin/env bash  #! /usr/bin/env sh
2  #  #
3  # $Header$  # $Header$
4  #  #
# Line 37  test_for_string_in_file() { Line 37  test_for_string_in_file() {
37      grep -i "$strng" $file > /dev/null 2>&1      grep -i "$strng" $file > /dev/null 2>&1
38      RETVAL=$?      RETVAL=$?
39      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
40          echo -n "Error: In $file there is an illegal line: "          printf "Error: In $file there is an illegal line: "
41          grep -i "$strng" $file          grep -i "$strng" $file
42          return 1          return 1
43      fi      fi
# Line 67  expand_pkg_groups() { Line 67  expand_pkg_groups() {
67          done          done
68          PACKAGES=$new_packages          PACKAGES=$new_packages
69          rm -f ./p[1,2].tmp          rm -f ./p[1,2].tmp
70            return $matched
71      else      else
72          echo "Warning: can't read package groups definition file: $PKG_GROUPS"          echo "Warning: can't read package groups definition file: $PKG_GROUPS"
73      fi      fi
74  }  }
75    
76  # Guess possible config options for this host  #  Check for broken environments (eg. cygwin, MacOSX w/HFS+) that
77  find_possible_configs()  {  #  cannot distinguish [*.F/*.F90] from [*.f/*.f90] files.
78    check_for_broken_Ff()  {
79        #  Do we have defaults for $FS and/or $FS90 ?
80        tfs=f
81        tfs9=f90
82        if test "x$FS" != x ; then
83            tfs="$FS"
84        fi
85        if test "x$FS90" != x ; then
86            tfs9="$FS90"
87        fi
88    
89      tmp1=`uname`"_"`uname -m`      #  First check the ability to create a *.F/.f pair.
90      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`      cat <<EOF >> genmake_hello.F
91      tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`        program hello
92      tmp1=`echo $tmp3 | sed -e 's|x86_64|amd64|'`        write(*,*) 'hi'
93      tmp2=`echo $tmp1 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`        stop
94      PLATFORM=$tmp2        end
95      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`  EOF
96      echo "  The platform appears to be:  $PLATFORM"      cp genmake_hello.F "genmake_hello."$tfs > /dev/null 2>&1
       
     echo "test" > test  
     ln -s ./test link  
97      RETVAL=$?      RETVAL=$?
98      if test "x${RETVAL}" = x0 ; then      if test "x$RETVAL" != x0 ; then
99          LN="ln -s"          if test "x$FS" = x ; then
100      else              FS='for'
101          echo "Error: \"ln -s\" does not appear to work on this system!"              FS90='fr9'
102          echo "  For help, please contact <MITgcm-support@mitgcm.org>."              check_for_broken_Ff
103          exit 1          else
104                cat <<EOF 2>&1
105    ERROR: Your file system cannot distinguish between *.F and *.f files
106      (fails the "cp" test) and this program cannot find a suitable
107      replacement extension.  Please try a different build environment or
108      contact the <MITgcm-support@mitgcm.org> list for help.
109    
110    EOF
111                exit -1
112            fi
113            return
114      fi      fi
115      rm -f test link      rm -f genmake_hello.*
116    
117      if test "x$CPP" = x ; then      #  Check the ability of ${MAKE} and ${LN} to use the current set
118          CPP="cpp -traditional -P"      #  of extensions.
119        cat <<EOF >> genmake_hello.F
120          program hello
121          write(*,*) 'hi'
122          stop
123          end
124    EOF
125        test -e Makefile  &&  mv -f Makefile Makefile.bak
126        cat <<EOF >> Makefile
127    %.$tfs : %.F
128    .SUFFIXES:
129    genmake_hello.$tfs: genmake_hello.F
130            $LN genmake_hello.F genmake_hello.$tfs
131    EOF
132        $MAKE "genmake_hello."$tfs > /dev/null 2>&1
133        RETVAL=$?
134        if test "x$RETVAL" != x0 -o ! -e "genmake_hello."$tfs ; then
135            if test "x$FS" = x ; then
136                FS='for'
137                FS90='fr9'
138                check_for_broken_Ff
139            else
140                cat <<EOF 2>&1
141    ERROR: Your file system cannot distinguish between *.F and *.f files
142      (fails the "make/ln" test) and this program cannot find a suitable
143      replacement extension.  Please try a different build environment or
144      contact the <MITgcm-support@mitgcm.org> list for help.
145    
146    EOF
147                exit -1
148                return
149            fi
150      fi      fi
151        rm -f genmake_hello.* Makefile
152        test -e Makefile  &&  mv -f Makefile.bak Makefile
153    
154        #  If we make it here, use the extensions
155        FS=$tfs
156        FS90=$tfs9
157        return
158    }
159    
160    
161    look_for_makedepend()  {
162    
163      #  The "original" makedepend is part of the Imake system that is      #  The "original" makedepend is part of the Imake system that is
164      #  most often distributed with XFree86 or with an XFree86 source      #  most often distributed with XFree86 or with an XFree86 source
# Line 119  find_possible_configs()  { Line 179  find_possible_configs()  {
179      #    4) fall back to the buggy local xmakedpend script      #    4) fall back to the buggy local xmakedpend script
180      #      #
181      if test "x${MAKEDEPEND}" = x ; then      if test "x${MAKEDEPEND}" = x ; then
182        which makedepend >& /dev/null        which makedepend > /dev/null 2>&1
183        RETVAL=$?        RV0=$?
184        if test ! "x${RETVAL}" = x0 ; then        cat <<EOF >> genmake_tc.f
185          program test
186          write(*,*) 'test'
187          stop
188          end
189    EOF
190          makedepend genmake_tc.f > /dev/null 2>&1
191          RV1=$?
192          if test ! "x${RV0}${RV1}" = x00 ; then
193           echo "    a system-default makedepend was not found."           echo "    a system-default makedepend was not found."
194    
195           #  Try to build the cyrus impl           #  Try to build the cyrus impl
# Line 129  find_possible_configs()  { Line 197  find_possible_configs()  {
197           (           (
198               cd $ROOTDIR/tools/cyrus-imapd-makedepend  \               cd $ROOTDIR/tools/cyrus-imapd-makedepend  \
199                   &&  ./configure > /dev/null 2>&1  \                   &&  ./configure > /dev/null 2>&1  \
200                   &&  make > /dev/null 2>&1  \                   &&  make > /dev/null 2>&1
201                   &&  ./makedepend ifparser.c > /dev/null 2>&1  \               if test -x ./makedepend.exe ; then
202                     $LN ./makedepend.exe ./makedepend
203                 fi
204                 ./makedepend ifparser.c > /dev/null 2>&1  \
205                   &&  echo "true"                   &&  echo "true"
206           ) > ./genmake_cy_md           ) > ./genmake_cy_md
207           grep true ./genmake_cy_md > /dev/null 2>&1           grep true ./genmake_cy_md > /dev/null 2>&1
# Line 143  find_possible_configs()  { Line 214  find_possible_configs()  {
214           rm -f ./genmake_cy_md           rm -f ./genmake_cy_md
215        fi        fi
216      fi      fi
217    }
218    
219    
220    # Guess possible config options for this host
221    find_possible_configs()  {
222    
223        tmp1=`uname`"_"`uname -m`
224        tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
225        tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`
226        tmp1=`echo $tmp3 | sed -e 's|x86_64|amd64|'`
227        tmp2=`echo $tmp1 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
228        tmp3=`echo $tmp2 | sed -e 's/cray sv1/craysv1/'`
229        PLATFORM=$tmp3
230        echo $PLATFORM | grep cygwin > /dev/null 2>&1  &&  PLATFORM=cygwin_ia32
231        OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
232        echo "  The platform appears to be:  $PLATFORM"
233        
234        echo "test" > test
235        ln -s ./test link
236        RETVAL=$?
237        if test "x${RETVAL}" = x0 ; then
238            LN="ln -s"
239        else
240            echo "Error: \"ln -s\" does not appear to work on this system!"
241            echo "  For help, please contact <MITgcm-support@mitgcm.org>."
242            exit 1
243        fi
244        rm -f test link
245    
246        if test "x$CPP" = x ; then
247            CPP="cpp -traditional -P"
248        fi
249    
250        look_for_makedepend
251    
252      # look for possible fortran compilers      # look for possible fortran compilers
253      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"
# Line 258  get_pdepend_list()  { Line 363  get_pdepend_list()  {
363      . ./.pd_tmp      . ./.pd_tmp
364      rm -f ./.pd_tmp      rm -f ./.pd_tmp
365    
366      echo -n "PNAME = "${}      printf "PNAME = "${}
367  }  }
368    
369    
# Line 272  Usage: "$0" [OPTIONS] Line 377  Usage: "$0" [OPTIONS]
377      -help | --help | -h | --h      -help | --help | -h | --h
378            Print this help message and exit.            Print this help message and exit.
379    
380        -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME
381          -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME
382              Use "NAME" as the adoptfile.  By default, the file at
383              "tools/adjoint_options/adjoint_default" will be used.
384    
385      -nooptfile | --nooptfile      -nooptfile | --nooptfile
386        -optfile NAME | --optfile NAME | -of NAME | --of NAME        -optfile NAME | --optfile NAME | -of NAME | --of NAME
387        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
# Line 348  Usage: "$0" [OPTIONS] Line 458  Usage: "$0" [OPTIONS]
458            set to PATH. i.e. Include files from $PATH/include, link to libraries            set to PATH. i.e. Include files from $PATH/include, link to libraries
459            from $PATH/lib and use binaries from $PATH/bin.            from $PATH/lib and use binaries from $PATH/bin.
460    
461        -bash NAME
462              Explicitly specify the Bourne or BASH shell to use
463    
464    While it is most often a single word, the "NAME" variables specified    While it is most often a single word, the "NAME" variables specified
465    above can in many cases be a space-delimited string such as:    above can in many cases be a space-delimited string such as:
466    
# Line 492  EOF Line 605  EOF
605    
606    
607  check_netcdf_libs()  {  check_netcdf_libs()  {
608      cat <<EOF > genmake_tnc.F      cat <<EOF > genmake_tnc.for
609        program fgennc        program fgennc
610  #include "netcdf.inc"  #include "netcdf.inc"
611        integer iret, ncid, xid        integer iret, ncid, xid
# Line 504  check_netcdf_libs()  { Line 617  check_netcdf_libs()  {
617        IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret)        IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret)
618        end        end
619  EOF  EOF
620      $CPP genmake_tnc.F > genmake_tnc.f  \      $CPP genmake_tnc.for > genmake_tnc.f  \
621          &&  $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f $LIBS >> genmake_tnc.log 2>&1          &&  $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f $LIBS >> genmake_tnc.log 2>&1
622      RET_COMPILE=$?      RET_COMPILE=$?
623      test -x ./genmake_tnc  &&  ./genmake_tnc >> genmake_tnc.log 2>&1      test -x ./genmake_tnc  &&  ./genmake_tnc >> genmake_tnc.log 2>&1
# Line 513  EOF Line 626  EOF
626          HAVE_NETCDF=t          HAVE_NETCDF=t
627      else      else
628          # try again with "-lnetcdf" added to the libs          # try again with "-lnetcdf" added to the libs
629          $CPP genmake_tnc.F > genmake_tnc.f  \          $CPP genmake_tnc.for > genmake_tnc.f  \
630              &&  $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \              &&  $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \
631              $LIBS -lnetcdf >> genmake_tnc_2.log 2>&1              $LIBS -lnetcdf >> genmake_tnc_2.log 2>&1
632          RET_COMPILE=$?          RET_COMPILE=$?
# Line 561  FOPTIM= Line 674  FOPTIM=
674  CFLAGS=  CFLAGS=
675  KFLAGS1=  KFLAGS1=
676  KFLAGS2=  KFLAGS2=
677    #LDADD=
678  LIBS=  LIBS=
679  KPPFILES=  KPPFILES=
680  NOOPTFILES=  NOOPTFILES=
# Line 574  HAVE_FDATE= Line 688  HAVE_FDATE=
688  FC_NAMEMANGLE=  FC_NAMEMANGLE=
689  HAVE_CLOC=  HAVE_CLOC=
690  HAVE_NETCDF=  HAVE_NETCDF=
691    HAVE_ETIME=
692    
693  MODS=  MODS=
694  TOOLSDIR=  TOOLSDIR=
# Line 581  SOURCEDIRS= Line 696  SOURCEDIRS=
696  INCLUDEDIRS=  INCLUDEDIRS=
697  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
698    
699    G2ARGS=
700    BASH=
701  PWD=`pwd`  PWD=`pwd`
702  MAKE=make  MAKE=make
703  AWK=awk  AWK=awk
# Line 596  IEEE= Line 713  IEEE=
713  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
714      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
715  fi  fi
716    FS=
717    FS90=
718    
719  AUTODIFF_PKG_USED=f  AUTODIFF_PKG_USED=f
720  AD_OPTFILE=  AD_OPTFILE=
# Line 620  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPE Line 739  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPE
739  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"
740  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"
741  gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF"  gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF"
742  gm_s7="HAVE_SYSTEM HAVE_FDATE FC_NAMEMANGLE"  gm_s7="HAVE_SYSTEM HAVE_FDATE FC_NAMEMANGLE HAVE_ETIME"
743    
744  #  The following are all related to adjoint/tangent-linear stuff  #  The following are all related to adjoint/tangent-linear stuff
745  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"
# Line 649  for i in . $MODS ; do Line 768  for i in . $MODS ; do
768          break          break
769      fi      fi
770  done  done
771  echo -n "  getting local config information:  "  printf "  getting local config information:  "
772  if test -e $gm_local ; then  if test -e $gm_local ; then
773      echo "using $gm_local"      echo "using $gm_local"
774      . $gm_local      . $gm_local
# Line 673  fi Line 792  fi
792  ac_prev=  ac_prev=
793  for ac_option ; do  for ac_option ; do
794    
795        G2ARGS="$G2ARGS \"$ac_option\""
796    
797      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
798      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
799          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
# Line 714  for ac_option ; do Line 835  for ac_option ; do
835          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
836              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
837                    
838            -bash | --bash)
839                ac_prev=BASH ;;
840            -bash=* | --bash=*)
841                BASH=$ac_optarg ;;
842            
843          -makedepend | --makedepend | -md | --md)          -makedepend | --makedepend | -md | --md)
844              ac_prev=MAKEDEPEND ;;              ac_prev=MAKEDEPEND ;;
845          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
# Line 766  for ac_option ; do Line 892  for ac_option ; do
892          -fc=* | --fc=*)          -fc=* | --fc=*)
893              FC=$ac_optarg ;;              FC=$ac_optarg ;;
894                    
895            -fs | --fs)
896                ac_prev=FS ;;
897            -fs=* | --fs=*)
898                FS=$ac_optarg ;;
899            
900            -fs90 | --fs90)
901                ac_prev=FS90 ;;
902            -fs90=* | --fs90=*)
903                FS90=$ac_optarg ;;
904            
905          -ieee | --ieee)          -ieee | --ieee)
906              IEEE=true ;;              IEEE=true ;;
907          -noieee | --noieee)          -noieee | --noieee)
# Line 828  if test "x${ROOTDIR}" = x ; then Line 964  if test "x${ROOTDIR}" = x ; then
964          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do
965              if [ -d "$d/model" -a -d "$d/eesupp" -a -d "$d/pkg" ]; then              if [ -d "$d/model" -a -d "$d/eesupp" -a -d "$d/pkg" ]; then
966                  ROOTDIR=$d                  ROOTDIR=$d
967                  echo -n "Warning:  ROOTDIR was not specified but there appears to be"                  printf "Warning:  ROOTDIR was not specified but there appears to be"
968                  echo " a copy of MITgcm at \"$ROOTDIR\" so we'll try it."                  echo " a copy of MITgcm at \"$ROOTDIR\" so we'll try it."
969                  break                  break
970              fi              fi
# Line 862  if test "x$OPTFILE" != xNONE ; then Line 998  if test "x$OPTFILE" != xNONE ; then
998          . "$OPTFILE"          . "$OPTFILE"
999          RETVAL=$?          RETVAL=$?
1000          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1001              echo -n "Error: failed to source OPTFILE \"$OPTFILE\""              printf "Error: failed to source OPTFILE \"$OPTFILE\""
1002              echo "--please check that variable syntax is bash-compatible"              echo "--please check that variable syntax is bash-compatible"
1003              exit 1              exit 1
1004          fi          fi
# Line 875  if test "x$OPTFILE" != xNONE ; then Line 1011  if test "x$OPTFILE" != xNONE ; then
1011      fi      fi
1012  fi  fi
1013    
1014    #  Check for broken systems that cannot correctly distinguish *.F and *.f files
1015    # check_for_broken_Ff
1016    
1017  echo "  getting AD_OPTFILE information:  "  echo "  getting AD_OPTFILE information:  "
1018  if test "x${AD_OPTFILE}" = x ; then  if test "x${AD_OPTFILE}" = x ; then
1019      if test "x$MITGCM_AD_OF" = x ; then      if test "x$MITGCM_AD_OF" = x ; then
# Line 889  if test "x${AD_OPTFILE}" != xNONE ; then Line 1028  if test "x${AD_OPTFILE}" != xNONE ; then
1028          . "$AD_OPTFILE"          . "$AD_OPTFILE"
1029          RETVAL=$?          RETVAL=$?
1030          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1031              echo -n "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""              printf "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""
1032              echo "--please check that variable syntax is bash-compatible"              echo "--please check that variable syntax is bash-compatible"
1033              exit 1              exit 1
1034          fi          fi
# Line 904  fi Line 1043  fi
1043    
1044  #  Check that FC, LINK, CPP, S64, LN, and MAKE are defined.  If not,  #  Check that FC, LINK, CPP, S64, LN, and MAKE are defined.  If not,
1045  #  either set defaults or complain and abort!  #  either set defaults or complain and abort!
1046    if test ! "x$BASH" = x ; then
1047        # add a trailing space so that it works within the Makefile syntax (see below)
1048        BASH="$BASH "
1049    fi
1050  if test "x$FC" = x ; then  if test "x$FC" = x ; then
1051      cat <<EOF 1>&2      cat <<EOF 1>&2
1052    
# Line 924  if test "x$CPP" = x ; then Line 1067  if test "x$CPP" = x ; then
1067      CPP=cpp      CPP=cpp
1068  fi  fi
1069  #EH3 === UGLY ===  #EH3 === UGLY ===
1070  #  The following an ugly little hack to check for $CPP in /lib/ and it  #  The following is an ugly little hack to check for $CPP in /lib/ and
1071  #  should eventually be replaced with a more general function that  #  it should eventually be replaced with a more general function that
1072  #  searches a combo of the user's path and a list of "usual suspects"  #  searches a combo of the user's path and a list of "usual suspects"
1073  #  to find the correct location for binaries such as $CPP.  #  to find the correct location for binaries such as $CPP.
1074  for i in " " "/lib/" ; do  for i in " " "/lib/" ; do
# Line 948  EOF Line 1091  EOF
1091  else  else
1092      rm -f test_cpp      rm -f test_cpp
1093  fi  fi
1094  if test "x$MAKEDEPEND" = x ; then  look_for_makedepend
     MAKEDEPEND=makedepend  
 fi  
1095  if test "x$LN" = x ; then  if test "x$LN" = x ; then
1096      LN="ln -s"      LN="ln -s"
1097  fi  fi
# Line 968  EOF Line 1109  EOF
1109  fi  fi
1110  rm -f genmake_test_ln genmake_tlink  rm -f genmake_test_ln genmake_tlink
1111    
1112    #  Check for broken *.F/*.f handling and fix if possible
1113    check_for_broken_Ff
1114    
1115  if test ! "x$MPI" = x ; then  if test ! "x$MPI" = x ; then
1116        echo "  Turning on MPI cpp macros"        echo "  Turning on MPI cpp macros"
1117        DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI"        DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI"
1118  fi  fi
1119    
1120  printf "\n===  Checking system libraries  ===\n"  printf "\n===  Checking system libraries  ===\n"
1121  echo -n "  Do we have the system() command using $FC...  "  printf "  Do we have the system() command using $FC...  "
1122  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.f <<EOF
1123        program hello        program hello
1124        call system('echo hi')        call system('echo hi')
# Line 992  else Line 1136  else
1136  fi  fi
1137  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1138    
1139  echo -n "  Do we have the fdate() command using $FC...  "  printf "  Do we have the fdate() command using $FC...  "
1140  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.f <<EOF
1141        program hello        program hello
1142        CHARACTER(128) string        CHARACTER(128) string
# Line 1013  else Line 1157  else
1157  fi  fi
1158  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1159    
1160  echo -n "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Do we have the etime() command using $FC...  "
1161    cat > genmake_tcomp.f <<EOF
1162          program hello
1163          REAL*4 ACTUAL, TARRAY(2)
1164          EXTERNAL ETIME
1165          REAL*4 ETIME
1166          actual = etime( tarray )
1167          print *, tarray
1168          end
1169    EOF
1170    $FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.f > genmake_tcomp.log 2>&1
1171    RETVAL=$?
1172    if test "x$RETVAL" = x0 ; then
1173        HAVE_ETIME=t
1174        DEFINES="$DEFINES -DHAVE_ETIME"
1175        echo "yes"
1176    else
1177        HAVE_ETIME=
1178        echo "no"
1179    fi
1180    rm -f genmake_tcomp*
1181    
1182    printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
1183  check_HAVE_CLOC  check_HAVE_CLOC
1184  if test "x$HAVE_CLOC" != x ; then  if test "x$HAVE_CLOC" != x ; then
1185      echo "yes"      echo "yes"
# Line 1022  else Line 1188  else
1188  fi  fi
1189  rm -f genmake_t*  rm -f genmake_t*
1190    
1191  echo -n "  Can we create NetCDF-enabled binaries...  "  printf "  Can we create NetCDF-enabled binaries...  "
1192  check_netcdf_libs  check_netcdf_libs
1193  if test "x$HAVE_NETCDF" != x ; then  if test "x$HAVE_NETCDF" != x ; then
1194      echo "yes"      echo "yes"
# Line 1032  fi Line 1198  fi
1198    
1199    
1200  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1201  echo -n "  Adding MODS directories:  "  printf "  Adding MODS directories:  "
1202  for d in $MODS ; do  for d in $MODS ; do
1203      if test ! -d $d ; then      if test ! -d $d ; then
1204          echo          echo
1205          echo "Error: MODS directory \"$d\" not found!"          echo "Error: MODS directory \"$d\" not found!"
1206          exit 1          exit 1
1207      else      else
1208          echo -n " $d"          printf " $d"
1209          SOURCEDIRS="$SOURCEDIRS $d"          SOURCEDIRS="$SOURCEDIRS $d"
1210          INCLUDEDIRS="$INCLUDEDIRS $d"          INCLUDEDIRS="$INCLUDEDIRS $d"
1211      fi      fi
# Line 1164  else Line 1330  else
1330          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
1331          RETVAL=$?          RETVAL=$?
1332          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
1333              echo -n "Error: can't parse default package list "              printf "Error: can't parse default package list "
1334              echo "-- please check PDEFAULT=\"$PDEFAULT\""              echo "-- please check PDEFAULT=\"$PDEFAULT\""
1335              exit 1              exit 1
1336          fi          fi
# Line 1172  else Line 1338  else
1338              PACKAGES="$PACKAGES $i"              PACKAGES="$PACKAGES $i"
1339          done          done
1340          echo "    before group expansion packages are: $PACKAGES"          echo "    before group expansion packages are: $PACKAGES"
1341          expand_pkg_groups          while ! expand_pkg_groups; do echo > /dev/null; done
1342          echo "    after group expansion packages are:  $PACKAGES"          echo "    after group expansion packages are:  $PACKAGES"
1343      fi      fi
1344  fi  fi
1345    
1346  echo "  applying DISABLE settings"  echo "  applying DISABLE settings"
1347    for i in $PACKAGES ; do
1348        echo $i >> ./.tmp_pack
1349    done
1350    for i in `grep  "-" ./.tmp_pack` ; do
1351        j=`echo $i | sed 's/[-]//'`
1352        DISABLE="$DISABLE $j"
1353    done
1354  pack=  pack=
1355  for p in $PACKAGES ; do  for p in $PACKAGES ; do
1356      addit="t"      addit="t"
# Line 1194  PACKAGES="$pack" Line 1367  PACKAGES="$pack"
1367  echo "  applying ENABLE settings"  echo "  applying ENABLE settings"
1368  echo "" > ./.tmp_pack  echo "" > ./.tmp_pack
1369  PACKAGES="$PACKAGES $ENABLE"  PACKAGES="$PACKAGES $ENABLE"
1370    # Test if each explicitly referenced package exists
1371  for i in $PACKAGES ; do  for i in $PACKAGES ; do
1372      if test ! -d "$ROOTDIR/pkg/$i" ; then      j=`echo $i | sed 's/[-+]//'`
1373        if test ! -d "$ROOTDIR/pkg/$j" ; then
1374          echo "Error: can't find package $i at \"$ROOTDIR/pkg/$i\""          echo "Error: can't find package $i at \"$ROOTDIR/pkg/$i\""
1375          exit 1          exit 1
1376      fi      fi
1377      echo $i >> ./.tmp_pack      echo $i >> ./.tmp_pack
1378  done  done
 pack=`cat ./.tmp_pack | sort | uniq`  
 rm -f ./.tmp_pack  
1379  PACKAGES=  PACKAGES=
1380  for i in $pack ; do  for i in `grep -v "-" ./.tmp_pack | sort | uniq` ; do
1381      PACKAGES="$PACKAGES $i"      PACKAGES="$PACKAGES $i"
1382  done  done
1383    rm -f ./.tmp_pack
1384  echo "    packages are:  $PACKAGES"  echo "    packages are:  $PACKAGES"
1385    
1386  echo "  applying package dependency rules"  echo "  applying package dependency rules"
# Line 1447  rm -rf .links.tmp Line 1621  rm -rf .links.tmp
1621  mkdir .links.tmp  mkdir .links.tmp
1622  echo "# This section creates symbolic links" > srclinks.tmp  echo "# This section creates symbolic links" > srclinks.tmp
1623  echo "" >> srclinks.tmp  echo "" >> srclinks.tmp
1624  echo -n 'SRCFILES = '    > srclist.inc  printf 'SRCFILES = '    > srclist.inc
1625  echo -n 'CSRCFILES = '   > csrclist.inc  printf 'CSRCFILES = '   > csrclist.inc
1626  echo -n 'F90SRCFILES = ' > f90srclist.inc  printf 'F90SRCFILES = ' > f90srclist.inc
1627  echo -n 'HEADERFILES = ' > hlist.inc  printf 'HEADERFILES = ' > hlist.inc
1628  echo -n 'AD_FLOW_FILES = ' > ad_flow_files.inc  printf 'AD_FLOW_FILES = ' > ad_flow_files.inc
1629  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
1630  for d in $alldirs ; do  for d in $alldirs ; do
1631      deplist=      deplist=
# Line 1476  for d in $alldirs ; do Line 1650  for d in $alldirs ; do
1650                  case $extn in                  case $extn in
1651                      F)                      F)
1652                          echo    " \\"  >> srclist.inc                          echo    " \\"  >> srclist.inc
1653                          echo -n " $sf" >> srclist.inc                          printf " $sf" >> srclist.inc
1654                          ;;                          ;;
1655                      F90)                      F90)
1656                          echo    " \\"  >> f90srclist.inc                          echo    " \\"  >> f90srclist.inc
1657                          echo -n " $sf" >> f90srclist.inc                          printf " $sf" >> f90srclist.inc
1658                          ;;                          ;;
1659                      c)                      c)
1660                          echo    " \\"  >> csrclist.inc                          echo    " \\"  >> csrclist.inc
1661                          echo -n " $sf" >> csrclist.inc                          printf " $sf" >> csrclist.inc
1662                          ;;                          ;;
1663                      h)                      h)
1664                          echo    " \\"  >> hlist.inc                          echo    " \\"  >> hlist.inc
1665                          echo -n " $sf" >> hlist.inc                          printf " $sf" >> hlist.inc
1666                          ;;                          ;;
1667                      flow)                      flow)
1668                          echo    " \\"  >> ad_flow_files.inc                          echo    " \\"  >> ad_flow_files.inc
1669                          echo -n " $sf" >> ad_flow_files.inc                          printf " $sf" >> ad_flow_files.inc
1670                          ;;                          ;;
1671                  esac                  esac
1672              fi              fi
# Line 1521  echo "#    $MACHINE" >> $MAKEFILE Line 1695  echo "#    $MACHINE" >> $MAKEFILE
1695  echo "# This makefile was generated automatically on" >> $MAKEFILE  echo "# This makefile was generated automatically on" >> $MAKEFILE
1696  echo "#    $THISDATE" >> $MAKEFILE  echo "#    $THISDATE" >> $MAKEFILE
1697  echo "# by the command:" >> $MAKEFILE  echo "# by the command:" >> $MAKEFILE
1698  echo "#    $0 $@" >> $MAKEFILE  echo "#    $0 $G2ARGS" >> $MAKEFILE
1699  echo "# executed by:" >> $MAKEFILE  echo "# executed by:" >> $MAKEFILE
1700  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE
1701    
# Line 1589  FC = ${FC} Line 1763  FC = ${FC}
1763  # Fortran compiler  # Fortran compiler
1764  F90C = ${F90C}  F90C = ${F90C}
1765  # Link editor  # Link editor
1766  LINK = ${LINK}  LINK = ${LINK} ${LDADD}
1767    
1768  # Defines for CPP  # Defines for CPP
1769  DEFINES = ${DEFINES}  DEFINES = ${DEFINES}
# Line 1621  cat csrclist.inc      >> $MAKEFILE Line 1795  cat csrclist.inc      >> $MAKEFILE
1795  cat f90srclist.inc    >> $MAKEFILE  cat f90srclist.inc    >> $MAKEFILE
1796  cat hlist.inc         >> $MAKEFILE  cat hlist.inc         >> $MAKEFILE
1797  cat ad_flow_files.inc >> $MAKEFILE  cat ad_flow_files.inc >> $MAKEFILE
1798  echo               >> $MAKEFILE  echo >> $MAKEFILE
1799  echo 'F77FILES =  $(SRCFILES:.F=.f)'                                           >> $MAKEFILE  echo 'F77FILES =  $(SRCFILES:.F=.'$FS')'      >> $MAKEFILE
1800  echo 'F90FILES =  $(F90SRCFILES:.F90=.f90)'                                    >> $MAKEFILE  echo 'F90FILES =  $(F90SRCFILES:.F=.'$FS90')' >> $MAKEFILE
1801  echo 'OBJFILES =  $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE  echo 'OBJFILES =  $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE
1802    echo >> $MAKEFILE
1803    echo '.SUFFIXES:' >> $MAKEFILE
1804    echo '.SUFFIXES: .o .'$FS' .p .F .c .'$FS90' .F90' >> $MAKEFILE
1805  rm -f srclist.inc csrclist.inc hlist.inc flist.tmp clist.tmp f90srclist.inc  rm -f srclist.inc csrclist.inc hlist.inc flist.tmp clist.tmp f90srclist.inc
1806  rm -f ad_flow_files.inc  rm -f ad_flow_files.inc
1807    
1808  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
1809    
 .SUFFIXES:  
 .SUFFIXES: .o .f .p .F .c .F90 .f90  
   
1810  all: \$(EXECUTABLE)  all: \$(EXECUTABLE)
1811  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(OBJFILES)  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(OBJFILES)
1812          @echo Creating \$@ ...          @echo Creating \$@ ...
1813          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
1814  depend:  depend:
1815          @make links          @make links
1816          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)          \$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(SRCFILES)
1817          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
1818            -rm -f makedepend.out
1819    
1820  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)
1821    
# Line 1652  output.txt: \$(EXECUTABLE) Line 1826  output.txt: \$(EXECUTABLE)
1826          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
1827    
1828  clean:  clean:
1829          -rm -rf *.o *.f *.p *.f90 *.mod ${RMFILES} work.{pc,pcl} *.template          -rm -rf *.o *.$FS *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template
1830  Clean:  Clean:
1831          @make clean          @make clean
1832          @make cleanlinks          @make cleanlinks
# Line 1663  CLEAN: Line 1837  CLEAN:
1837          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
1838          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
1839          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;
1840          -rm -f \$(EXECUTABLE) output.txt          -rm -f \$(EXECUTABLE) output.txt STD*
1841    
1842  #eh3 Makefile: makefile  #eh3 Makefile: makefile
1843  makefile:  makefile:
1844          $THIS_SCRIPT $@          $THIS_SCRIPT $G2ARGS
1845  cleanlinks:  cleanlinks:
1846          -find . -type l -exec rm {} \;          -find . -type l -exec rm {} \;
1847    
1848  # Special targets ($SPECIAL_FILES) which are create by make  # Special targets ($SPECIAL_FILES) which are create by make
1849  ${PACKAGES_DOT_H}:  ${PACKAGES_DOT_H}:
1850          @echo Creating \$@ ...          @echo Creating \$@ ...
1851          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@
1852  AD_CONFIG.h:  AD_CONFIG.h:
1853          @echo Creating \$@ ...          @echo Creating \$@ ...
1854          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@
1855  FC_NAMEMANGLE.h:  FC_NAMEMANGLE.h:
1856          @echo Creating \$@ ...          @echo Creating \$@ ...
1857          echo "$FC_NAMEMANGLE" > \$@          echo "$FC_NAMEMANGLE" > \$@
1858    
1859  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .$FS - .o  )
1860  .F.f:  
1861    %.o : %.F
1862    
1863    .F.$FS:
1864          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
1865  .f.o:  .$FS.o:
1866          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<
1867  .F90.f90:  .F90.$FS90:
1868          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
1869  .f90.o:  .$FS90.o:
1870          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<
1871  .c.o:  .c.o:
1872          \$(CC) \$(CFLAGS) -c \$<          \$(CC) \$(CFLAGS) -c \$<
1873    
1874  # Special exceptions that use the ( .F - .p - .f - .o ) rule-chain  # Special exceptions that use the ( .F - .p - .$FS - .o ) rule-chain
1875  .F.p:  .F.p:
1876          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
1877  .p.f:  .p.$FS:
1878          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<
1879    
1880  #=========================================  #=========================================
# Line 1724  done Line 1901  done
1901    
1902  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
1903  echo >> $MAKEFILE  echo >> $MAKEFILE
1904  echo -n "AD_FILES = " >> $MAKEFILE  printf "AD_FILES = " >> $MAKEFILE
1905  AD_FILES=`cat ad_files`  AD_FILES=`cat ad_files`
1906  for i in $AD_FILES ; do  for i in $AD_FILES ; do
1907      echo    " \\" >> $MAKEFILE      echo    " \\" >> $MAKEFILE
1908      echo -n " $i" >> $MAKEFILE      printf " $i" >> $MAKEFILE
1909  done  done
1910  echo >> $MAKEFILE  echo >> $MAKEFILE
1911  rm -f ad_files  rm -f ad_files
# Line 1741  adtaf: ad_taf_output.f Line 1918  adtaf: ad_taf_output.f
1918  adtamc: ad_tamc_output.f  adtamc: ad_tamc_output.f
1919    
1920  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1921          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template
1922          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
1923          -rm -f ad_config.template          -rm -f ad_config.template
1924          @make \$(F77FILES)          @make \$(F77FILES)
# Line 1773  ftltaf: ftl_taf_output.f Line 1950  ftltaf: ftl_taf_output.f
1950  ftltamc: ftl_tamc_output.f  ftltamc: ftl_tamc_output.f
1951    
1952  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1953          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template
1954          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h
1955          -rm -f ftl_config.template          -rm -f ftl_config.template
1956          @make \$(F77FILES)          @make \$(F77FILES)
# Line 1822  for i in $KPPFILES ; do Line 1999  for i in $KPPFILES ; do
1999      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
2000          echo "Error: unable to add file \"$i\" to the exceptions list"          echo "Error: unable to add file \"$i\" to the exceptions list"
2001      fi      fi
2002      echo "$base.f: $base.p" >> $MAKEFILE      echo "$base.$FS: $base.p" >> $MAKEFILE
2003  done  done
2004    
2005  echo "  Making list of NOOPTFILES"  echo "  Making list of NOOPTFILES"
# Line 1832  for i in $NOOPTFILES ; do Line 2009  for i in $NOOPTFILES ; do
2009      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
2010          echo "Error: unable to add file \"$i\" to the exceptions list"          echo "Error: unable to add file \"$i\" to the exceptions list"
2011      fi      fi
2012      echo "$base.o: $base.f" >> $MAKEFILE      echo "$base.o: $base.$FS" >> $MAKEFILE
2013      printf "\t\$(FC) \$(FFLAGS) \$(NOOPTFLAGS) -c \$<\n" >> $MAKEFILE      printf "\t\$(FC) \$(FFLAGS) \$(NOOPTFLAGS) -c \$<\n" >> $MAKEFILE
2014  done  done
2015    
# Line 1846  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 2023  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
2023  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
2024    
2025  # Create special header files  # Create special header files
2026  $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"  $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"
2027  if test ! -f $PACKAGES_DOT_H ; then  if test ! -f $PACKAGES_DOT_H ; then
2028      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
2029  else  else
# Line 1860  else Line 2037  else
2037      fi      fi
2038  fi  fi
2039  if test ! -f AD_CONFIG.h ; then  if test ! -f AD_CONFIG.h ; then
2040      $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > AD_CONFIG.h      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > AD_CONFIG.h
2041  fi  fi
2042    
2043    
2044  #  Write the "state" for future records  #  Write the "state" for future records
2045  if test "x$DUMPSTATE" != xf ; then  if test "x$DUMPSTATE" != xf ; then
2046      echo -n "" > genmake_state      printf "" > genmake_state
2047      for i in $gm_state ; do      for i in $gm_state ; do
2048          t1="t2=\$$i"          t1="t2=\$$i"
2049          eval $t1          eval $t1

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.84

  ViewVC Help
Powered by ViewVC 1.1.22