/[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.39 by edhill, Fri Nov 14 19:01:36 2003 UTC revision 1.44 by adcroft, Mon Nov 24 14:54:12 2003 UTC
# Line 76  find_possible_configs()  { Line 76  find_possible_configs()  {
76      PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`      PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
77      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
78      echo "  The platform appears to be:  $PLATFORM"      echo "  The platform appears to be:  $PLATFORM"
 #     if test "x$OFLIST" = x ; then  
 #       echo "  No pre-defined options files were found matching this platform"  
 #       echo "  but examples for other platforms can be found in:"  
 #       echo "    $ROOTDIR/tools/build_options"  
 #     else  
 #       echo "  Options files (located in $ROOTDIR/tools/build_options) that"  
 #       echo "  may work with this machine are:"  
 #       for i in $OFLIST ; do  
 #           echo "    $i"  
 #       done  
 #     fi  
79            
80      echo "test" > test      echo "test" > test
81      ln -s ./test link      ln -s ./test link
# Line 225  get_pdepend_list()  { Line 214  get_pdepend_list()  {
214    
215  #  Explain usage  #  Explain usage
216  usage()  {  usage()  {
217      echo  cat <<EOF
218      echo "Usage: "$0" [OPTIONS]"  
219      echo "  where [OPTIONS] can be:"  Usage: "$0" [OPTIONS]
220      echo    where [OPTIONS] can be:
221      echo "    -help | --help | -h | --h"  
222      echo "    -nooptfile | --nooptfile"      -help | --help | -h | --h
223      echo "      -optfile NAME | --optfile NAME | -of NAME | --of NAME"            Print this help message and exit.
224      echo "      -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME"  
225      echo "    -pdepend NAME | --pdepend NAME"      -nooptfile | --nooptfile
226      echo "      -pdepend=NAME | --pdepend=NAME"        -optfile NAME | --optfile NAME | -of NAME | --of NAME
227      echo "    -pdefault NAME | --pdefault NAME"        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
228      echo "      -pdefault=NAME | --pdefault=NAME"            Use "NAME" as the optfile.  By default, an attempt will be
229      echo "    -make NAME | -m NAME"            made to find an appropriate "standard" optfile in the
230      echo "      --make=NAME | -m=NAME"            tools/build_options/ directory.
231      echo "    -makefile NAME | -mf NAME"  
232      echo "      --makefile=NAME | -mf=NAME"      -pdepend NAME | --pdepend NAME
233      echo "    -platform NAME | --platform NAME | -pl NAME | --pl NAME"        -pdepend=NAME | --pdepend=NAME
234      echo "      -platform=NAME | --platform=NAME | -pl=NAME | --pl=NAME"            Get package dependency information from "NAME".
235      echo "    -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME"  
236      echo "      -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME"      -pdefault NAME | --pdefault NAME
237      echo "    -mods NAME | --mods NAME | -mo NAME | --mo NAME"        -pdefault=NAME | --pdefault=NAME
238      echo "      -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME"            Get the default package list from "NAME".
239      echo "    -disable NAME | --disable NAME"  
240      echo "      -disable=NAME | --disable=NAME"      -make NAME | -m NAME
241      echo "    -enable NAME | --enable NAME"        --make=NAME | -m=NAME
242      echo "      -enable=NAME | --enable=NAME"            Use "NAME" for the MAKE program. The default is "make" but
243      echo "    -standarddirs NAME | --standarddirs NAME"            many platforms, "gmake" is the preferred choice.
244      echo "      -standarddirs=NAME | --standarddirs=NAME"  
245      echo "    -noopt NAME | --noopt NAME"      -makefile NAME | -mf NAME
246      echo "      -noopt=NAME | --noopt=NAME"        --makefile=NAME | -mf=NAME
247  #    echo "    -cpp NAME | --cpp NAME"            Call the makefile "NAME".  The default is "Makefile".
248  #    echo "      -cpp=NAME | --cpp=NAME"  
249      echo "    -fortran NAME | --fortran NAME | -fc NAME | --fc NAME"      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME
250      echo "      -fc=NAME | --fc=NAME"        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME
251      echo "    -[no]ieee | --[no]ieee"            Specify the location of the MITgcm ROOTDIR as "NAME".
252      echo "    -[no]mpi | --[no]mpi"            By default, genamke will try to find the location by
253      echo "    -[no]jam | --[no]jam"            looking in parent directories (up to the 5th parent).
254      echo  
255      echo "  and NAME is a string such as:"      -mods NAME | --mods NAME | -mo NAME | --mo NAME
256      echo        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME
257      echo "    --enable pkg1   --enable 'pkg1 pkg2'   --enable 'pkg1 pkg2 pkg3'"            Here, "NAME" specifies a list of directories that are
258      echo "    -mods=dir1   -mods='dir1'   -mods='dir1 dir2 dir3'"            used for additional source code.  Files found in the
259      echo "    -foptim='-Mvect=cachesize:512000,transform -xtypemap=real:64,double:64,integer:32'"            "mods list" are given preference over files of the same
260      echo            name found elsewhere.
261      echo "  which, depending upon your shell, may need to be single-quoted"  
262      echo "  if it contains spaces, dashes, or other special characters."      -disable NAME | --disable NAME
263          -disable=NAME | --disable=NAME
264              Here "NAME" specifies a list of packages that we don't
265              want to use.  If this violates package dependencies,
266              genamke will exit with an error message.
267    
268        -enable NAME | --enable NAME
269          -enable=NAME | --enable=NAME
270              Here "NAME" specifies a list of packages that we wish
271              to specifically enable.  If this violates package
272              dependencies, genamke will exit with an error message.
273    
274        -standarddirs NAME | --standarddirs NAME
275          -standarddirs=NAME | --standarddirs=NAME
276              Here, "NAME" specifies a list of directories to be
277              used as the "standard" code.
278    
279        -fortran NAME | --fortran NAME | -fc NAME | --fc NAME
280          -fc=NAME | --fc=NAME
281              Use "NAME" as the fortran compiler.  By default, genmake
282              will search for a working compiler by trying a list of
283              "usual suspects" such as g77, f77, etc.
284    
285        -[no]ieee | --[no]ieee
286              Do or don't use IEEE numerics.  Note that this option
287              *only* works if it is supported by the OPTFILE that
288              is being used.
289    
290      While it is most often a single word, the "NAME" variables specified
291      above can in many cases be a space-delimited string such as:
292    
293        --enable pkg1   --enable 'pkg1 pkg2'   --enable 'pkg1 pkg2 pkg3'
294        -mods=dir1   -mods='dir1'   -mods='dir1 dir2 dir3'
295        -foptim='-Mvect=cachesize:512000,transform -xtypemap=real:64,double:64,integer:32'
296    
297      which, depending upon your shell, may need to be single-quoted.
298    
299      For more detailed genmake documentation, please see:
300    
301        http://mitgcm.org/devel_HOWTO/
302    
303    EOF
304    
305      exit 1      exit 1
306  }  }
307    
# Line 293  WARNING: Please contact <MITgcm-support@ Line 324  WARNING: Please contact <MITgcm-support@
324  EOF  EOF
325          return 1          return 1
326      fi      fi
327      c_tcall=`nm genmake_test.o | grep tcall | cut -d ' ' -f 3`      c_tcall=`nm genmake_test.o | grep 'T ' | grep tcall | cut -d ' ' -f 3`
328      RETVAL=$?      RETVAL=$?
329      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
330          FC_NAMEMANGLE=$default_nm          FC_NAMEMANGLE=$default_nm
# Line 323  WARNING: Please contact <MITgcm-support@ Line 354  WARNING: Please contact <MITgcm-support@
354  EOF  EOF
355          return 1          return 1
356      fi      fi
357      f_tcall=`nm genmake_tcomp.o | grep tcall | cut -d ' ' -f 3`      f_tcall=`nm genmake_tcomp.o | grep 'T ' | grep tcall | cut -d ' ' -f 3`
358      RETVAL=$?      RETVAL=$?
359      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
360          FC_NAMEMANGLE=$default_nm          FC_NAMEMANGLE=$default_nm
# Line 473  TAMC_EXTRA= Line 504  TAMC_EXTRA=
504    
505    
506  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
507  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT"  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE"
508  gm_s2="FC IEEE MPI JAM DUMPSTATE STANDARDDIRS"  gm_s2="FC IEEE MPI JAM DUMPSTATE STANDARDDIRS"
509    
510  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
# Line 491  gm_s12="TAF_EXTRA TAMC_EXTRA" Line 522  gm_s12="TAF_EXTRA TAMC_EXTRA"
522  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7"  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7"
523  gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12"  gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12"
524    
525    cat <<EOF
526    
527    GENMAKE :
528    
529    A program for GENerating MAKEfiles for the MITgcm project.  For a
530    quick list of options, use "genmake -h" or for more detail see:
531    
532      http://mitgcm.org/devel_HOWTO/
533    
534    EOF
535    
 echo  
536  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
537  gm_local="genmake_local"  gm_local="genmake_local"
538  for i in . $MODS ; do  for i in . $MODS ; do
# Line 571  for ac_option ; do Line 611  for ac_option ; do
611          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -ma=* | --ma=*)
612              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
613                    
614          -platform | --platform | -pl | --pl)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
615              ac_prev=PLATFORM ;;              echo "ERROR: The platform option has been removed.  Please specify"
616          -platform=* | --platform=* | -pl=* | --pl=*)              echo "  the build options using the \"optfile\" mechanism."
617              PLATFORM=$ac_optarg ;;              echo
618                usage
619                ;;
620                    
621          -rootdir | --rootdir | -rd | --rd)          -rootdir | --rootdir | -rd | --rd)
622              ac_prev=ROOTDIR ;;              ac_prev=ROOTDIR ;;
# Line 601  for ac_option ; do Line 643  for ac_option ; do
643          -standarddirs=* | --standarddirs=*)          -standarddirs=* | --standarddirs=*)
644              STANDARDDIRS=$ac_optarg ;;              STANDARDDIRS=$ac_optarg ;;
645    
         -noopt | --noopt)  
             ac_prev=NOOPT ;;  
         -noopt=* | --noopt=*)  
             NOOPT=$ac_optarg ;;  
           
646  #           -cpp | --cpp)  #           -cpp | --cpp)
647  #               ac_prev=cpp ;;  #               ac_prev=cpp ;;
648  #           -cpp=* | --cpp=*)  #           -cpp=* | --cpp=*)
# Line 621  for ac_option ; do Line 658  for ac_option ; do
658          -noieee | --noieee)          -noieee | --noieee)
659              IEEE= ;;              IEEE= ;;
660                    
661          -mpi | --mpi)  #       -jam | --jam)
662              MPI=true ;;  #           JAM=1 ;;
663          -nompi | --nompi)  #       -nojam | --nojam)
664              MPI= ;;  #           JAM=0 ;;
           
         -jam | --jam)  
             JAM=1 ;;  
         -nojam | --nojam)  
             JAM=0 ;;  
665                    
666          -ds | --ds)          -ds | --ds)
667              DUMPSTATE=t ;;              DUMPSTATE=t ;;
# Line 909  fi Line 941  fi
941  if test "x$S64" = x ; then  if test "x$S64" = x ; then
942      S64='$(TOOLSDIR)/set64bitConst.sh'      S64='$(TOOLSDIR)/set64bitConst.sh'
943  fi  fi
944    THIS_SCRIPT=`echo ${0} | sed 's:'$TOOLSDIR':\$(TOOLSDIR):'`
945    
946  EXECUTABLE=${EXECUTABLE:-mitgcmuv}  EXECUTABLE=${EXECUTABLE:-mitgcmuv}
947    
# Line 960  rm -f ./.pd_tmp Line 993  rm -f ./.pd_tmp
993  #  Search for default packages.  Note that a "$ROOTDIR/pkg/pkg_groups"  #  Search for default packages.  Note that a "$ROOTDIR/pkg/pkg_groups"
994  #  file should eventually be added so that, for convenience, one can  #  file should eventually be added so that, for convenience, one can
995  #  specify groups of packages using names like "ocean" and "atmosphere".  #  specify groups of packages using names like "ocean" and "atmosphere".
996  echo  -n "  checking default package list:  "  echo "  checking default package list:  "
997  if test "x${PDEFAULT}" = x ; then  if test "x${PDEFAULT}" = x ; then
998      for i in "." $MODS ; do      for i in "." $MODS ; do
999          if test -r $i"/packages.conf" ; then          if test -r $i"/packages.conf" ; then
# Line 973  if test "x${PDEFAULT}" = x ; then Line 1006  if test "x${PDEFAULT}" = x ; then
1006      PDEFAULT="$ROOTDIR/pkg/pkg_default"      PDEFAULT="$ROOTDIR/pkg/pkg_default"
1007  fi  fi
1008  if test "x${PDEFAULT}" = xNONE ; then  if test "x${PDEFAULT}" = xNONE ; then
1009      echo "default packages file disabled"      echo "    default packages file disabled"
1010  else  else
1011      if test ! -r $PDEFAULT ; then      if test ! -r $PDEFAULT ; then
         echo ""  
1012          echo "Warning:  can't read default packages from PDEFAULT=\"$PDEFAULT\""          echo "Warning:  can't read default packages from PDEFAULT=\"$PDEFAULT\""
1013      else      else
1014          echo "  using PDEFAULT=\"$PDEFAULT\""          echo "    using PDEFAULT=\"$PDEFAULT\""
1015          #  Strip the comments and add all the names          #  Strip the comments and add all the names
1016          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
1017          RETVAL=$?          RETVAL=$?
# Line 1133  EOF Line 1165  EOF
1165  #  statements could be separated and handled only by genmake.  #  statements could be separated and handled only by genmake.
1166  names=`ls -1 "$ROOTDIR/pkg"`  names=`ls -1 "$ROOTDIR/pkg"`
1167  all_pack=  all_pack=
1168    DISABLED_PACKAGES=
1169  for n in $names ; do  for n in $names ; do
1170      if test -d "$ROOTDIR/pkg/$n" -a "x$n" != xCVS ; then      if test -d "$ROOTDIR/pkg/$n" -a "x$n" != xCVS ; then
1171          has_pack="f"          has_pack="f"
# Line 1145  for n in $names ; do Line 1178  for n in $names ; do
1178          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
1179              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`
1180              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"
1181                DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
1182          fi          fi
1183      fi      fi
1184  done  done
# Line 1152  cat <<EOF >>$PACKAGES_DOT_H".tmp" Line 1186  cat <<EOF >>$PACKAGES_DOT_H".tmp"
1186    
1187  C  Packages enabled by genmake:  C  Packages enabled by genmake:
1188  EOF  EOF
1189    ENABLED_PACKAGES=
1190  for i in $PACKAGES ; do  for i in $PACKAGES ; do
1191      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`
1192      echo "#define $def" >> $PACKAGES_DOT_H".tmp"      echo "#define $def" >> $PACKAGES_DOT_H".tmp"
1193        ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def"
1194  #eh3 DEFINES="$DEFINES -D$def"  #eh3 DEFINES="$DEFINES -D$def"
1195    
1196  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
# Line 1247  for i in $SOURCEDIRS ; do Line 1283  for i in $SOURCEDIRS ; do
1283      done      done
1284  done  done
1285    
 cat <<EOF > adjoint_sed  
 s/call adopen(/call adopen ( mythid,\\  
      \&           /g  
 s/call adclose(/call adclose( mythid,\\  
      \&           /g  
 s/call adread(/call adread ( mythid,\\  
      \&           /g  
 s/call adwrite(/call adwrite( mythid,\\  
      \&           /g  
   
 EOF  
   
1286  echo  echo
1287  echo "===  Creating the Makefile  ==="  echo "===  Creating the Makefile  ==="
1288  echo "  setting INCLUDES"  echo "  setting INCLUDES"
# Line 1288  for d in $alldirs ; do Line 1312  for d in $alldirs ; do
1312      for sf in $sfiles ; do      for sf in $sfiles ; do
1313          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
1314              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
1315                    case $d/$sf in
1316                      ./$PACKAGES_DOT_H)
1317                            ;;
1318                      ./AD_CONFIG.h)
1319                            ;;
1320                      ./FC_NAMEMANGLE.h)
1321                            ;;
1322                      *)
1323                            touch .links.tmp/$sf
1324                            deplist="$deplist $sf"
1325                            ;;
1326                    esac
1327                  extn=`echo $sf | $AWK -F '.' '{print $NF}'`                  extn=`echo $sf | $AWK -F '.' '{print $NF}'`
                 touch .links.tmp/$sf  
                 deplist="$deplist $sf"  
1328                  case $extn in                  case $extn in
1329                      F)                      F)
1330                          echo    " \\"  >> srclist.inc                          echo    " \\"  >> srclist.inc
# Line 1381  EXE_AD      = ${EXE_AD} Line 1415  EXE_AD      = ${EXE_AD}
1415  EXE_FTL     = ${EXE_FTL}  EXE_FTL     = ${EXE_FTL}
1416  EXE_SVD     = ${EXE_SVD}  EXE_SVD     = ${EXE_SVD}
1417    
1418    ENABLED_PACKAGES = ${ENABLED_PACKAGES}
1419    DISABLED_PACKAGES = ${DISABLED_PACKAGES}
1420    
1421  EOF  EOF
1422    
1423  #  Note: figure out some way to add Hyades JAM libraries here  #  Note: figure out some way to add Hyades JAM libraries here
# Line 1445  cat >>$MAKEFILE <<EOF Line 1482  cat >>$MAKEFILE <<EOF
1482  .SUFFIXES: .o .f .p .F .c .F90 .f90  .SUFFIXES: .o .f .p .F .c .F90 .f90
1483    
1484  all: \$(EXECUTABLE)  all: \$(EXECUTABLE)
1485  \$(EXECUTABLE): \$(OBJFILES)  \$(EXECUTABLE): links \$(OBJFILES)
1486            @echo Creating \$@ ...
1487          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
1488  depend:  depend:
1489          @make links          @make links
1490          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)
1491          ${TOOLSDIR}/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
1492    
1493  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) ${PACKAGES_DOT_H} AD_CONFIG.h
1494    
1495  small_f: \$(F77FILES) \$(F90FILES)  small_f: \$(F77FILES) \$(F90FILES)
1496    
# Line 1461  output.txt: \$(EXECUTABLE) Line 1499  output.txt: \$(EXECUTABLE)
1499          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
1500    
1501  clean:  clean:
1502          -cat AD_CONFIG.template > AD_CONFIG.h          -rm -rf *.o *.f *.p *.f90 *.mod ${RMFILES} work.{pc,pcl} *.template
         -rm -rf *.o *.f *.p *.f90 *.mod ${RMFILES} work.{pc,pcl}  
1503  Clean:  Clean:
1504          @make clean          @make clean
1505          @make cleanlinks          @make cleanlinks
1506          -rm -f Makefile.bak genmake_state genmake_*optfile make.log          -rm -f ${PACKAGES_DOT_H} AD_CONFIG.h
1507            -rm -f Makefile.bak genmake_state genmake_*optfile genmake_warnings make.log
1508  CLEAN:  CLEAN:
1509          @make Clean          @make Clean
1510          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
# Line 1476  CLEAN: Line 1514  CLEAN:
1514    
1515  #eh3 Makefile: makefile  #eh3 Makefile: makefile
1516  makefile:  makefile:
1517          ${0} $@          $THIS_SCRIPT $@
1518  cleanlinks:  cleanlinks:
1519          -find . -type l -exec rm {} \;          -find . -type l -exec rm {} \;
1520    
1521    # Special targets
1522    ${PACKAGES_DOT_H}:
1523            @echo Creating \$@ ...
1524            @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warngin - this file is automatically generated - do NOT edit" "Enabled packages:" \$(ENABLED_PACKAGES) " " "Disabled packages:" \$(DISABLED_PACKAGES) > \$@
1525    AD_CONFIG.h:
1526            @echo Creating \$@ ...
1527            @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@
1528    
1529  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .f - .o  )
1530  .F.f:  .F.f:
1531          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
# Line 1539  adtaf: ad_taf_output.f Line 1585  adtaf: ad_taf_output.f
1585  adtamc: ad_tamc_output.f  adtamc: ad_tamc_output.f
1586    
1587  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1588            @\$(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
1589          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
1590            -rm -f ad_config.template
1591          @make \$(F77FILES)          @make \$(F77FILES)
1592          @make \$(AD_FLOW_FILES)          @make \$(AD_FLOW_FILES)
1593          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f
1594    
1595  ad_taf_output.f: ad_input_code.f  ad_taf_output.f: ad_input_code.f
1596          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f
1597          cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f          cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.f
1598    
1599  adtafonly:  adtafonly:
1600          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f
1601          cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f          cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.f
1602    
1603  ad_taf: ad_taf_output.o \$(OBJFILES)  ad_taf: ad_taf_output.o \$(OBJFILES)
1604          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)
1605    
1606  ad_tamc_output.f: ad_input_code.f  ad_tamc_output.f: ad_input_code.f
1607          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f
1608          cat ad_input_code_ad.f | sed -f adjoint_sed > ad_tamc_output.f          cat ad_input_code_ad.f | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.f
1609    
1610  ad_tamc: ad_tamc_output.o \$(OBJFILES)  ad_tamc: ad_tamc_output.o \$(OBJFILES)
1611          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)
# Line 1569  ftltaf: ftl_taf_output.f Line 1617  ftltaf: ftl_taf_output.f
1617  ftltamc: ftl_tamc_output.f  ftltamc: ftl_tamc_output.f
1618    
1619  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1620            @\$(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
1621          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
1622            -rm -f ftl_config.template
1623          @make \$(F77FILES)          @make \$(F77FILES)
1624          @make \$(AD_FLOW_FILES)          @make \$(AD_FLOW_FILES)
1625          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f
1626    
1627  ftl_taf_output.f: ftl_input_code.f  ftl_taf_output.f: ftl_input_code.f
1628          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f
1629          cat ftl_input_code_ftl.f | sed -f adjoint_sed > ftl_taf_output.f          cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.f
1630    
1631    ftltafonly:
1632            \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f
1633            cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.f
1634    
1635  ftl_taf: ftl_taf_output.o \$(OBJFILES)  ftl_taf: ftl_taf_output.o \$(OBJFILES)
1636          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)
1637    
1638  ftl_tamc_output.f: ftl_input_code.f  ftl_tamc_output.f: ftl_input_code.f
1639          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.f          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.f
1640          cat ftl_input_code_ftl.f | sed -f adjoint_sed > ftl_tamc_output.f          cat ftl_input_code_ftl.f | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.f
1641    
1642  ftl_tamc: ftl_tamc_output.o \$(OBJFILES)  ftl_tamc: ftl_tamc_output.o \$(OBJFILES)
1643          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS)          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS)
1644    
1645    
1646  # ... SVD ...  # ... SVD ...
1647  svd: svd_taf  svdtaf: ad_taf_output.f ftl_taf_output.f
1648  svd_taf_f: svd_taf_output.f  svdall: svd_taf
   
 svd_input_code.f: \$(SRCFILES)  
         cmp svd_config.template AD_CONFIG.h || cat svd_config.template > AD_CONFIG.h  
         @make \$(F77FILES)  
         @make \$(AD_FLOW_FILES)  
         cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f  
   
 svd_taf_output.f: svd_input_code.f  
         \$(TAF) \$(SVD_TAF_FLAGS) \$(TAF_EXTRA) svd_input_code.f  
         cat svd_input_code_ad.f | sed -f adjoint_sed > svd_taf_output.f  
1649    
1650  svd_taf: svd_taf_output.o \$(OBJFILES)  svd_taf: ad_taf_output.o ftl_taf_output.o \$(OBJFILES)
1651          \$(LINK) -o ${EXE_SVD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) svd_taf_output.o \$(LIBS)          \$(LINK) -o mitgcmuv_svd \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o ftl_taf_output.o \$(LIBS)
1652    
1653    
1654  #=========================================  #=========================================

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.22