/[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.45 by heimbach, Mon Nov 24 15:08:24 2003 UTC revision 1.46 by adcroft, Tue Nov 25 14:18:50 2003 UTC
# Line 1147  done Line 1147  done
1147    
1148  # Create a list of #define and #undef to enable/disable packages  # Create a list of #define and #undef to enable/disable packages
1149  PACKAGES_DOT_H=PACKAGES_CONFIG.h  PACKAGES_DOT_H=PACKAGES_CONFIG.h
 cat <<EOF >$PACKAGES_DOT_H".tmp"  
 C=== GENMAKE v2 ===  
 C  The following defines have been set by GENMAKE, so please do not  
 C  edit anything below these comments.  In general, you should  
 C  add or remove packages by re-running genmake with different  
 C  "-enable" and/or "-disable" options.  
   
 #ifndef PACKAGES_H  
 #define PACKAGES_H  
   
 C  Packages disabled by genmake:  
 EOF  
1150  #  The following UGLY HACK sets multiple "#undef"s and it needs to go  #  The following UGLY HACK sets multiple "#undef"s and it needs to go
1151  #  away.  On 2003-08-12, CNH, JMC, and EH3 agreed that the CPP_OPTIONS.h  #  away.  On 2003-08-12, CNH, JMC, and EH3 agreed that the CPP_OPTIONS.h
1152  #  file would eventually be split up so that all package-related #define  #  file would eventually be split up so that all package-related #define
# Line 1177  for n in $names ; do Line 1165  for n in $names ; do
1165          done          done
1166          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
1167              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`
             echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"  
1168              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
1169          fi          fi
1170      fi      fi
1171  done  done
 cat <<EOF >>$PACKAGES_DOT_H".tmp"  
   
 C  Packages enabled by genmake:  
 EOF  
1172  ENABLED_PACKAGES=  ENABLED_PACKAGES=
1173  for i in $PACKAGES ; do  for i in $PACKAGES ; do
1174      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`
     echo "#define $def" >> $PACKAGES_DOT_H".tmp"  
1175      ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def"      ENABLED_PACKAGES="$ENABLED_PACKAGES -D$def"
1176  #eh3 DEFINES="$DEFINES -D$def"  #eh3 DEFINES="$DEFINES -D$def"
1177    
1178  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
1179      case $i in      case $i in
1180          aim_v23)          aim_v23)
             echo "#define   ALLOW_AIM" >> $PACKAGES_DOT_H".tmp"  
1181              DEFINES="$DEFINES -DALLOW_AIM"              DEFINES="$DEFINES -DALLOW_AIM"
1182                ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"
1183              echo "Warning: ALLOW_AIM is set to enable aim_v23. This is REALLY ugly Jean-Michel :-)"              echo "Warning: ALLOW_AIM is set to enable aim_v23. This is REALLY ugly Jean-Michel :-)"
1184              ;;              ;;
1185      esac      esac
1186  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
1187    
1188  done  done
 cat <<EOF >>$PACKAGES_DOT_H".tmp"  
   
 #endif /* PACKAGES_H */  
 EOF  
   
 if test ! -f $PACKAGES_DOT_H ; then  
     mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H  
 else  
     cmp $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H  
     RETVAL=$?  
     if test "x$RETVAL" = x0 ; then  
         rm -f $PACKAGES_DOT_H".tmp"  
     else  
         mv -f $PACKAGES_DOT_H $PACKAGES_DOT_H".bak"  
         mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H  
     fi  
 fi  
1189    
1190  echo "  Adding STANDARDDIRS"  echo "  Adding STANDARDDIRS"
1191  BUILDDIR=${BUILDDIR:-.}  BUILDDIR=${BUILDDIR:-.}
# Line 1521  cleanlinks: Line 1486  cleanlinks:
1486  # Special targets  # Special targets
1487  ${PACKAGES_DOT_H}:  ${PACKAGES_DOT_H}:
1488          @echo Creating \$@ ...          @echo Creating \$@ ...
1489          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warngin - this file is automatically generated - do NOT edit" "Enabled packages:" \$(ENABLED_PACKAGES) " " "Disabled packages:" \$(DISABLED_PACKAGES) > \$@          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warngin - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@
1490  AD_CONFIG.h:  AD_CONFIG.h:
1491          @echo Creating \$@ ...          @echo Creating \$@ ...
1492          @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@          @\$(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 > \$@
1493    
1494  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .f - .o  )
1495  .F.f:  .F.f:
# Line 1689  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 1654  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
1654    
1655  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
1656    
 #  Write the "template" files for the adjoint builds  
 cat >AD_CONFIG.template <<EOF  
 C  WARNING: This file is automatically generated by genmake2 and  
 C    used by the Makefile rules.  Please DO NOT EDIT this file  
 C    unless you are CERTAIN that you know what you are doing.  
   
 #undef ALLOW_ADJOINT_RUN  
 #undef ALLOW_TANGENTLINEAR_RUN  
 #undef ALLOW_ECCO_OPTIMIZATION  
 EOF  
 cat >ad_config.template <<EOF  
 C  WARNING: This file is automatically generated by genmake2 and  
 C    used by the Makefile rules.  Please DO NOT EDIT this file  
 C    unless you are CERTAIN that you know what you are doing.  
   
 #define ALLOW_ADJOINT_RUN  
 #undef ALLOW_TANGENTLINEAR_RUN  
 #undef ALLOW_ECCO_OPTIMIZATION  
 EOF  
 cat >ftl_config.template <<EOF  
 C  WARNING: This file is automatically generated by genmake2 and  
 C    used by the Makefile rules.  Please DO NOT EDIT this file  
 C    unless you are CERTAIN that you know what you are doing.  
   
 #undef ALLOW_ADJOINT_RUN  
 #define ALLOW_TANGENTLINEAR_RUN  
 #undef ALLOW_ECCO_OPTIMIZATION  
 EOF  
 cat >svd_config.template <<EOF  
 C  WARNING: This file is automatically generated by genmake2 and  
 C    used by the Makefile rules.  Please DO NOT EDIT this file  
 C    unless you are CERTAIN that you know what you are doing.  
   
 #undef ALLOW_ADJOINT_RUN  
 #undef ALLOW_TANGENTLINEAR_RUN  
 #undef ALLOW_ECCO_OPTIMIZATION  
 EOF  
 cp AD_CONFIG.template AD_CONFIG.h  
   
1657    
1658  #  Write the "state" for future records  #  Write the "state" for future records
1659  if test "x$DUMPSTATE" != xf ; then  if test "x$DUMPSTATE" != xf ; then

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.22