/[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.65 by cnh, Mon Feb 16 16:24:41 2004 UTC revision 1.74 by adcroft, Wed Mar 24 17:12:51 2004 UTC
# 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
# Line 80  find_possible_configs()  { Line 81  find_possible_configs()  {
81      tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`      tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`
82      tmp1=`echo $tmp3 | sed -e 's|x86_64|amd64|'`      tmp1=`echo $tmp3 | sed -e 's|x86_64|amd64|'`
83      tmp2=`echo $tmp1 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`      tmp2=`echo $tmp1 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
84      PLATFORM=$tmp2      tmp3=`echo $tmp2 | sed -e 's/cray sv1/craysv1/'`
85        PLATFORM=$tmp3
86      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
87      echo "  The platform appears to be:  $PLATFORM"      echo "  The platform appears to be:  $PLATFORM"
88            
# Line 100  find_possible_configs()  { Line 102  find_possible_configs()  {
102          CPP="cpp -traditional -P"          CPP="cpp -traditional -P"
103      fi      fi
104    
105      # makedepend is not always available      #  The "original" makedepend is part of the Imake system that is
106        #  most often distributed with XFree86 or with an XFree86 source
107        #  package.  As a result, many machines (eg. generic Linux) do not
108        #  have a system-default "makedepend" available.  For those
109        #  systems, we have two fall-back options:
110        #
111        #    1) a makedepend implementation shipped with the cyrus-imapd
112        #       package:  ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
113        #
114        #    2) a known-buggy xmakedpend shell script
115        #
116        #  So the choices are, in order:
117        #
118        #    1) use the user-specified program
119        #    2) use a system-wide default
120        #    3) locally build and use the cyrus implementation
121        #    4) fall back to the buggy local xmakedpend script
122        #
123      if test "x${MAKEDEPEND}" = x ; then      if test "x${MAKEDEPEND}" = x ; then
124        which makedepend >& /dev/null        which makedepend > /dev/null 2>&1
125        RETVAL=$?        RETVAL=$?
126        if test "x${RETVAL}" = x1 ; then        if test ! "x${RETVAL}" = x0 ; then
127           echo "    makedepend was not found. Using xmakedpend instead."           echo "    a system-default makedepend was not found."
128           MAKEDEPEND='$(TOOLSDIR)/xmakedepend'  
129             #  Try to build the cyrus impl
130             rm -f ./genmake_cy_md
131             (
132                 cd $ROOTDIR/tools/cyrus-imapd-makedepend  \
133                     &&  ./configure > /dev/null 2>&1  \
134                     &&  make > /dev/null 2>&1  \
135                     &&  ./makedepend ifparser.c > /dev/null 2>&1  \
136                     &&  echo "true"
137             ) > ./genmake_cy_md
138             grep true ./genmake_cy_md > /dev/null 2>&1
139             RETVAL=$?
140             if test "x$RETVAL" = x0 ; then
141                 MAKEDEPEND='$(TOOLSDIR)/cyrus-imapd-makedepend/makedepend'
142             else
143                 MAKEDEPEND='$(TOOLSDIR)/xmakedepend'
144             fi
145             rm -f ./genmake_cy_md
146        fi        fi
147      fi      fi
148    
# Line 145  EOF Line 181  EOF
181          echo "   "$p_FC          echo "   "$p_FC
182          if test "x$FC" = x ; then          if test "x$FC" = x ; then
183              FC=`echo $p_FC | $AWK '{print $1}'`              FC=`echo $p_FC | $AWK '{print $1}'`
184                echo "  Setting FORTRAN compiler to: "$FC
185          fi          fi
186      fi      fi
187    
188      for i in $p_FC ; do      if test "x$OPTFILE" = x ; then
189          p_OF=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$i          OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC
190          if test -r $p_OF ; then          if test ! -r $OPTFILE ; then
191              OPTFILE=$p_OF               echo "  I looked for the file "$OPTFILE" but did not find it"
192              echo "  The options file:  $p_OF"          fi
193              echo "    appears to match so we'll use it."      fi
194              break  #    echo "  The options file:  $p_OF"
195          fi  #    echo "    appears to match so we'll use it."
196      done  #   for i in $p_FC ; do
197    #p_OF=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$i
198    #if test -r $p_OF ; then
199    #    OPTFILE=$p_OF
200    #    echo "  The options file:  $p_OF"
201    #    echo "    appears to match so we'll use it."
202    #    break
203    #fi
204    #   done
205      if test "x$OPTFILE" = x ; then      if test "x$OPTFILE" = x ; then
206          cat 1>&2 <<EOF          cat 1>&2 <<EOF
207    
# Line 215  get_pdepend_list()  { Line 260  get_pdepend_list()  {
260      . ./.pd_tmp      . ./.pd_tmp
261      rm -f ./.pd_tmp      rm -f ./.pd_tmp
262    
263      echo -n "PNAME = "${}      printf "PNAME = "${}
264  }  }
265    
266    
# Line 253  Usage: "$0" [OPTIONS] Line 298  Usage: "$0" [OPTIONS]
298        --makefile=NAME | -mf=NAME        --makefile=NAME | -mf=NAME
299            Call the makefile "NAME".  The default is "Makefile".            Call the makefile "NAME".  The default is "Makefile".
300    
301        -makedepend NAME | -md NAME
302          --makedepend=NAME | -md=NAME
303              Use "NAME" for the MAKEDEPEND program.
304    
305      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME
306        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME
307            Specify the location of the MITgcm ROOTDIR as "NAME".            Specify the location of the MITgcm ROOTDIR as "NAME".
# Line 294  Usage: "$0" [OPTIONS] Line 343  Usage: "$0" [OPTIONS]
343            *only* works if it is supported by the OPTFILE that            *only* works if it is supported by the OPTFILE that
344            is being used.            is being used.
345    
346        -mpi | --mpi
347              Include MPI header files and link to MPI libraries
348        -mpi=PATH | --mpi=PATH
349              Include MPI header files and link to MPI libraries using MPI_ROOT
350              set to PATH. i.e. Include files from $PATH/include, link to libraries
351              from $PATH/lib and use binaries from $PATH/bin.
352    
353        -bash NAME
354              Explicitly specify the Bourne or BASH shell to use
355    
356    While it is most often a single word, the "NAME" variables specified    While it is most often a single word, the "NAME" variables specified
357    above can in many cases be a space-delimited string such as:    above can in many cases be a space-delimited string such as:
358    
# Line 458  EOF Line 517  EOF
517      if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then      if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then
518          HAVE_NETCDF=t          HAVE_NETCDF=t
519      else      else
520          cat genmake_tnc.log >> genmake_warnings          # try again with "-lnetcdf" added to the libs
521            $CPP genmake_tnc.F > genmake_tnc.f  \
522                &&  $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \
523                $LIBS -lnetcdf >> genmake_tnc_2.log 2>&1
524            RET_COMPILE=$?
525            test -x ./genmake_tnc  &&  ./genmake_tnc >> genmake_tnc.log 2>&1
526            RETVAL=$?
527            if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then
528                LIBS="$LIBS -lnetcdf"
529                HAVE_NETCDF=t
530            else
531                cat genmake_tnc.log >> genmake_warnings
532            fi
533      fi      fi
534      rm -f genmake_tnc*      rm -f genmake_tnc*
535  }  }
536    
537    
538    
539    ###############################################################################
540    #   Sequential part of script starts here
541    ###############################################################################
542    
543  #  Set defaults here  #  Set defaults here
544  COMMANDL="$0 $@"  COMMANDL="$0 $@"
545    
# Line 474  KPP= Line 550  KPP=
550  FC=  FC=
551  CPP=  CPP=
552  LINK=  LINK=
 # DEFINES="-DWORDLENGTH=4"  
553  DEFINES=  DEFINES=
554  PACKAGES=  PACKAGES=
555  ENABLE=  ENABLE=
# Line 491  FOPTIM= Line 566  FOPTIM=
566  CFLAGS=  CFLAGS=
567  KFLAGS1=  KFLAGS1=
568  KFLAGS2=  KFLAGS2=
569    #LDADD=
570  LIBS=  LIBS=
571  KPPFILES=  KPPFILES=
572  NOOPTFILES=  NOOPTFILES=
573  NOOPTFLAGS=  NOOPTFLAGS=
574    MPI=
575    MPIPATH=
576    
577  # DEFINES checked by test compilation  # DEFINES checked by test compilation
578  HAVE_SYSTEM=  HAVE_SYSTEM=
# Line 509  SOURCEDIRS= Line 587  SOURCEDIRS=
587  INCLUDEDIRS=  INCLUDEDIRS=
588  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
589    
590    G2ARGS=
591    BASH=
592  PWD=`pwd`  PWD=`pwd`
593  MAKE=make  MAKE=make
594  AWK=awk  AWK=awk
# Line 577  for i in . $MODS ; do Line 657  for i in . $MODS ; do
657          break          break
658      fi      fi
659  done  done
660  echo -n "  getting local config information:  "  printf "  getting local config information:  "
661  if test -e $gm_local ; then  if test -e $gm_local ; then
662      echo "using $gm_local"      echo "using $gm_local"
663      . $gm_local      . $gm_local
# Line 601  fi Line 681  fi
681  ac_prev=  ac_prev=
682  for ac_option ; do  for ac_option ; do
683    
684        G2ARGS="$G2ARGS \"$ac_option\""
685    
686      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
687      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
688          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
# Line 642  for ac_option ; do Line 724  for ac_option ; do
724          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
725              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
726                    
727            -bash | --bash)
728                ac_prev=BASH ;;
729            -bash=* | --bash=*)
730                BASH=$ac_optarg ;;
731            
732            -makedepend | --makedepend | -md | --md)
733                ac_prev=MAKEDEPEND ;;
734            -makedepend=* | --makedepend=* | -md=* | --md=*)
735                MAKEDEPEND=$ac_optarg ;;
736            
737          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -ma | --ma)
738              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
739          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -ma=* | --ma=*)
# Line 693  for ac_option ; do Line 785  for ac_option ; do
785              IEEE=true ;;              IEEE=true ;;
786          -noieee | --noieee)          -noieee | --noieee)
787              IEEE= ;;              IEEE= ;;
788    
789            -mpi | --mpi)
790                MPI=true ;;
791            -mpi=* | --mpi=*)
792                MPIPATH=$ac_optarg
793                MPI=true ;;
794                    
795  #       -jam | --jam)  #       -jam | --jam)
796  #           JAM=1 ;;  #           JAM=1 ;;
# Line 745  if test "x${ROOTDIR}" = x ; then Line 843  if test "x${ROOTDIR}" = x ; then
843          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do
844              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
845                  ROOTDIR=$d                  ROOTDIR=$d
846                  echo -n "Warning:  ROOTDIR was not specified but there appears to be"                  printf "Warning:  ROOTDIR was not specified but there appears to be"
847                  echo " a copy of MITgcm at \"$ROOTDIR\" so we'll try it."                  echo " a copy of MITgcm at \"$ROOTDIR\" so we'll try it."
848                  break                  break
849              fi              fi
# Line 779  if test "x$OPTFILE" != xNONE ; then Line 877  if test "x$OPTFILE" != xNONE ; then
877          . "$OPTFILE"          . "$OPTFILE"
878          RETVAL=$?          RETVAL=$?
879          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
880              echo -n "Error: failed to source OPTFILE \"$OPTFILE\""              printf "Error: failed to source OPTFILE \"$OPTFILE\""
881              echo "--please check that variable syntax is bash-compatible"              echo "--please check that variable syntax is bash-compatible"
882              exit 1              exit 1
883          fi          fi
# Line 806  if test "x${AD_OPTFILE}" != xNONE ; then Line 904  if test "x${AD_OPTFILE}" != xNONE ; then
904          . "$AD_OPTFILE"          . "$AD_OPTFILE"
905          RETVAL=$?          RETVAL=$?
906          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
907              echo -n "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""              printf "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""
908              echo "--please check that variable syntax is bash-compatible"              echo "--please check that variable syntax is bash-compatible"
909              exit 1              exit 1
910          fi          fi
# Line 821  fi Line 919  fi
919    
920  #  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,
921  #  either set defaults or complain and abort!  #  either set defaults or complain and abort!
922    if test ! "x$BASH" = x ; then
923        # add a trailing space so that it works within the Makefile syntax (see below)
924        BASH="$BASH "
925    fi
926  if test "x$FC" = x ; then  if test "x$FC" = x ; then
927      cat <<EOF 1>&2      cat <<EOF 1>&2
928    
# Line 885  EOF Line 987  EOF
987  fi  fi
988  rm -f genmake_test_ln genmake_tlink  rm -f genmake_test_ln genmake_tlink
989    
990    if test ! "x$MPI" = x ; then
991          echo "  Turning on MPI cpp macros"
992          DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI"
993    fi
994    
995  printf "\n===  Checking system libraries  ===\n"  printf "\n===  Checking system libraries  ===\n"
996  echo -n "  Do we have the system() command using $FC...  "  printf "  Do we have the system() command using $FC...  "
997  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.f <<EOF
998        program hello        program hello
999        call system('echo hi')        call system('echo hi')
# Line 905  else Line 1011  else
1011  fi  fi
1012  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1013    
1014  echo -n "  Do we have the fdate() command using $FC...  "  printf "  Do we have the fdate() command using $FC...  "
1015  cat > genmake_tcomp.f <<EOF  cat > genmake_tcomp.f <<EOF
1016        program hello        program hello
1017        CHARACTER(128) string        CHARACTER(128) string
# Line 926  else Line 1032  else
1032  fi  fi
1033  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1034    
1035  echo -n "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
1036  check_HAVE_CLOC  check_HAVE_CLOC
1037  if test "x$HAVE_CLOC" != x ; then  if test "x$HAVE_CLOC" != x ; then
1038      echo "yes"      echo "yes"
# Line 935  else Line 1041  else
1041  fi  fi
1042  rm -f genmake_t*  rm -f genmake_t*
1043    
1044  echo -n "  Can we create NetCDF-enabled binaries...  "  printf "  Can we create NetCDF-enabled binaries...  "
1045  check_netcdf_libs  check_netcdf_libs
1046  if test "x$HAVE_NETCDF" != x ; then  if test "x$HAVE_NETCDF" != x ; then
1047      echo "yes"      echo "yes"
# Line 945  fi Line 1051  fi
1051    
1052    
1053  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1054  echo -n "  Adding MODS directories:  "  printf "  Adding MODS directories:  "
1055  for d in $MODS ; do  for d in $MODS ; do
1056      if test ! -d $d ; then      if test ! -d $d ; then
1057          echo          echo
1058          echo "Error: MODS directory \"$d\" not found!"          echo "Error: MODS directory \"$d\" not found!"
1059          exit 1          exit 1
1060      else      else
1061          echo -n " $d"          printf " $d"
1062          SOURCEDIRS="$SOURCEDIRS $d"          SOURCEDIRS="$SOURCEDIRS $d"
1063          INCLUDEDIRS="$INCLUDEDIRS $d"          INCLUDEDIRS="$INCLUDEDIRS $d"
1064      fi      fi
# Line 1077  else Line 1183  else
1183          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
1184          RETVAL=$?          RETVAL=$?
1185          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
1186              echo -n "Error: can't parse default package list "              printf "Error: can't parse default package list "
1187              echo "-- please check PDEFAULT=\"$PDEFAULT\""              echo "-- please check PDEFAULT=\"$PDEFAULT\""
1188              exit 1              exit 1
1189          fi          fi
# Line 1085  else Line 1191  else
1191              PACKAGES="$PACKAGES $i"              PACKAGES="$PACKAGES $i"
1192          done          done
1193          echo "    before group expansion packages are: $PACKAGES"          echo "    before group expansion packages are: $PACKAGES"
1194          expand_pkg_groups          while ! expand_pkg_groups; do echo > /dev/null; done
1195          echo "    after group expansion packages are:  $PACKAGES"          echo "    after group expansion packages are:  $PACKAGES"
1196      fi      fi
1197  fi  fi
1198    
1199  echo "  applying DISABLE settings"  echo "  applying DISABLE settings"
1200    for i in $PACKAGES ; do
1201        echo $i >> ./.tmp_pack
1202    done
1203    for i in `grep  "-" ./.tmp_pack` ; do
1204        j=`echo $i | sed 's/[-]//'`
1205        DISABLE="$DISABLE $j"
1206    done
1207  pack=  pack=
1208  for p in $PACKAGES ; do  for p in $PACKAGES ; do
1209      addit="t"      addit="t"
# Line 1107  PACKAGES="$pack" Line 1220  PACKAGES="$pack"
1220  echo "  applying ENABLE settings"  echo "  applying ENABLE settings"
1221  echo "" > ./.tmp_pack  echo "" > ./.tmp_pack
1222  PACKAGES="$PACKAGES $ENABLE"  PACKAGES="$PACKAGES $ENABLE"
1223    # Test if each explicitly referenced package exists
1224  for i in $PACKAGES ; do  for i in $PACKAGES ; do
1225      if test ! -d "$ROOTDIR/pkg/$i" ; then      j=`echo $i | sed 's/[-+]//'`
1226        if test ! -d "$ROOTDIR/pkg/$j" ; then
1227          echo "Error: can't find package $i at \"$ROOTDIR/pkg/$i\""          echo "Error: can't find package $i at \"$ROOTDIR/pkg/$i\""
1228          exit 1          exit 1
1229      fi      fi
1230      echo $i >> ./.tmp_pack      echo $i >> ./.tmp_pack
1231  done  done
 pack=`cat ./.tmp_pack | sort | uniq`  
 rm -f ./.tmp_pack  
1232  PACKAGES=  PACKAGES=
1233  for i in $pack ; do  for i in `grep -v "-" ./.tmp_pack | sort | uniq` ; do
1234      PACKAGES="$PACKAGES $i"      PACKAGES="$PACKAGES $i"
1235  done  done
1236    rm -f ./.tmp_pack
1237  echo "    packages are:  $PACKAGES"  echo "    packages are:  $PACKAGES"
1238    
1239  echo "  applying package dependency rules"  echo "  applying package dependency rules"
# Line 1360  rm -rf .links.tmp Line 1474  rm -rf .links.tmp
1474  mkdir .links.tmp  mkdir .links.tmp
1475  echo "# This section creates symbolic links" > srclinks.tmp  echo "# This section creates symbolic links" > srclinks.tmp
1476  echo "" >> srclinks.tmp  echo "" >> srclinks.tmp
1477  echo -n 'SRCFILES = '    > srclist.inc  printf 'SRCFILES = '    > srclist.inc
1478  echo -n 'CSRCFILES = '   > csrclist.inc  printf 'CSRCFILES = '   > csrclist.inc
1479  echo -n 'F90SRCFILES = ' > f90srclist.inc  printf 'F90SRCFILES = ' > f90srclist.inc
1480  echo -n 'HEADERFILES = ' > hlist.inc  printf 'HEADERFILES = ' > hlist.inc
1481  echo -n 'AD_FLOW_FILES = ' > ad_flow_files.inc  printf 'AD_FLOW_FILES = ' > ad_flow_files.inc
1482  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
1483  for d in $alldirs ; do  for d in $alldirs ; do
1484      deplist=      deplist=
# Line 1389  for d in $alldirs ; do Line 1503  for d in $alldirs ; do
1503                  case $extn in                  case $extn in
1504                      F)                      F)
1505                          echo    " \\"  >> srclist.inc                          echo    " \\"  >> srclist.inc
1506                          echo -n " $sf" >> srclist.inc                          printf " $sf" >> srclist.inc
1507                          ;;                          ;;
1508                      F90)                      F90)
1509                          echo    " \\"  >> f90srclist.inc                          echo    " \\"  >> f90srclist.inc
1510                          echo -n " $sf" >> f90srclist.inc                          printf " $sf" >> f90srclist.inc
1511                          ;;                          ;;
1512                      c)                      c)
1513                          echo    " \\"  >> csrclist.inc                          echo    " \\"  >> csrclist.inc
1514                          echo -n " $sf" >> csrclist.inc                          printf " $sf" >> csrclist.inc
1515                          ;;                          ;;
1516                      h)                      h)
1517                          echo    " \\"  >> hlist.inc                          echo    " \\"  >> hlist.inc
1518                          echo -n " $sf" >> hlist.inc                          printf " $sf" >> hlist.inc
1519                          ;;                          ;;
1520                      flow)                      flow)
1521                          echo    " \\"  >> ad_flow_files.inc                          echo    " \\"  >> ad_flow_files.inc
1522                          echo -n " $sf" >> ad_flow_files.inc                          printf " $sf" >> ad_flow_files.inc
1523                          ;;                          ;;
1524                  esac                  esac
1525              fi              fi
# Line 1434  echo "#    $MACHINE" >> $MAKEFILE Line 1548  echo "#    $MACHINE" >> $MAKEFILE
1548  echo "# This makefile was generated automatically on" >> $MAKEFILE  echo "# This makefile was generated automatically on" >> $MAKEFILE
1549  echo "#    $THISDATE" >> $MAKEFILE  echo "#    $THISDATE" >> $MAKEFILE
1550  echo "# by the command:" >> $MAKEFILE  echo "# by the command:" >> $MAKEFILE
1551  echo "#    $0 $@" >> $MAKEFILE  echo "#    $0 $G2ARGS" >> $MAKEFILE
1552  echo "# executed by:" >> $MAKEFILE  echo "# executed by:" >> $MAKEFILE
1553  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE
1554    
# Line 1502  FC = ${FC} Line 1616  FC = ${FC}
1616  # Fortran compiler  # Fortran compiler
1617  F90C = ${F90C}  F90C = ${F90C}
1618  # Link editor  # Link editor
1619  LINK = ${LINK}  LINK = ${LINK} ${LDADD}
1620    
1621  # Defines for CPP  # Defines for CPP
1622  DEFINES = ${DEFINES}  DEFINES = ${DEFINES}
# Line 1555  depend: Line 1669  depend:
1669          @make links          @make links
1670          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)
1671          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
1672            -rm -f makedepend.out
1673    
1674  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)
1675    
# Line 1580  CLEAN: Line 1695  CLEAN:
1695    
1696  #eh3 Makefile: makefile  #eh3 Makefile: makefile
1697  makefile:  makefile:
1698          $THIS_SCRIPT $@          $THIS_SCRIPT $G2ARGS
1699  cleanlinks:  cleanlinks:
1700          -find . -type l -exec rm {} \;          -find . -type l -exec rm {} \;
1701    
1702  # Special targets ($SPECIAL_FILES) which are create by make  # Special targets ($SPECIAL_FILES) which are create by make
1703  ${PACKAGES_DOT_H}:  ${PACKAGES_DOT_H}:
1704          @echo Creating \$@ ...          @echo Creating \$@ ...
1705          @\$(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) > \$@
1706  AD_CONFIG.h:  AD_CONFIG.h:
1707          @echo Creating \$@ ...          @echo Creating \$@ ...
1708          @\$(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 > \$@
1709  FC_NAMEMANGLE.h:  FC_NAMEMANGLE.h:
1710          @echo Creating \$@ ...          @echo Creating \$@ ...
1711          echo "$FC_NAMEMANGLE" > \$@          echo "$FC_NAMEMANGLE" > \$@
# Line 1637  done Line 1752  done
1752    
1753  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
1754  echo >> $MAKEFILE  echo >> $MAKEFILE
1755  echo -n "AD_FILES = " >> $MAKEFILE  printf "AD_FILES = " >> $MAKEFILE
1756  AD_FILES=`cat ad_files`  AD_FILES=`cat ad_files`
1757  for i in $AD_FILES ; do  for i in $AD_FILES ; do
1758      echo    " \\" >> $MAKEFILE      echo    " \\" >> $MAKEFILE
1759      echo -n " $i" >> $MAKEFILE      printf " $i" >> $MAKEFILE
1760  done  done
1761  echo >> $MAKEFILE  echo >> $MAKEFILE
1762  rm -f ad_files  rm -f ad_files
# Line 1654  adtaf: ad_taf_output.f Line 1769  adtaf: ad_taf_output.f
1769  adtamc: ad_tamc_output.f  adtamc: ad_tamc_output.f
1770    
1771  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1772          @\$(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
1773          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
1774          -rm -f ad_config.template          -rm -f ad_config.template
1775          @make \$(F77FILES)          @make \$(F77FILES)
# Line 1686  ftltaf: ftl_taf_output.f Line 1801  ftltaf: ftl_taf_output.f
1801  ftltamc: ftl_tamc_output.f  ftltamc: ftl_tamc_output.f
1802    
1803  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1804          @\$(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
1805          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
1806          -rm -f ftl_config.template          -rm -f ftl_config.template
1807          @make \$(F77FILES)          @make \$(F77FILES)
# Line 1759  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 1874  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
1874  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
1875    
1876  # Create special header files  # Create special header files
1877  $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"
1878  if test ! -f $PACKAGES_DOT_H ; then  if test ! -f $PACKAGES_DOT_H ; then
1879      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
1880  else  else
# Line 1773  else Line 1888  else
1888      fi      fi
1889  fi  fi
1890  if test ! -f AD_CONFIG.h ; then  if test ! -f AD_CONFIG.h ; then
1891      $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
1892  fi  fi
1893    
1894    
1895  #  Write the "state" for future records  #  Write the "state" for future records
1896  if test "x$DUMPSTATE" != xf ; then  if test "x$DUMPSTATE" != xf ; then
1897      echo -n "" > genmake_state      printf "" > genmake_state
1898      for i in $gm_state ; do      for i in $gm_state ; do
1899          t1="t2=\$$i"          t1="t2=\$$i"
1900          eval $t1          eval $t1

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.74

  ViewVC Help
Powered by ViewVC 1.1.22