--- MITgcm/tools/genmake2 2003/11/25 14:18:50 1.46 +++ MITgcm/tools/genmake2 2003/11/25 14:57:45 1.47 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.46 2003/11/25 14:18:50 adcroft Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.47 2003/11/25 14:57:45 adcroft Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -1486,7 +1486,7 @@ # Special targets ${PACKAGES_DOT_H}: @echo Creating \$@ ... - @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warngin - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@ + @\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@ AD_CONFIG.h: @echo Creating \$@ ... @\$(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 > \$@ @@ -1654,6 +1654,24 @@ printf "\n=== Done ===\n" +# Create special header files +$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" +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 +if test ! -f AD_CONFIG.h ; then + $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 +fi + # Write the "state" for future records if test "x$DUMPSTATE" != xf ; then