--- MITgcm/tools/genmake2 2004/09/27 15:49:48 1.99 +++ MITgcm/tools/genmake2 2004/09/30 16:46:45 1.100 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.99 2004/09/27 15:49:48 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.100 2004/09/30 16:46:45 edhill Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -1490,6 +1490,41 @@ rm -f ./.tmp_pack echo " packages are: $PACKAGES" +# Check availability of NetCDF and then either build the MNC template +# files or delete mnc from the list of available packages. +echo $PACKAGES | grep ' mnc ' > /dev/null 2>&1 +RETVAL=$? +if test "x$RETVAL" = x0 ; then + if test "x$HAVE_NETCDF" != xt ; then + cat < make_mnc.errors 2>&1 + RETVAL=$? + if test "x${RETVAL}" = x0 ; then + rm -f make_mnc.errors + else + echo "Error: problem encountered while building source files in pkg/mnc:" + cat make_mnc.errors 1>&2 + exit 1 + fi + fi +fi + echo " applying package dependency rules" ck= while test "x$ck" != xtt ; do @@ -1574,39 +1609,6 @@ fi done -# Build MNC templates and check for ability to build and use NetCDF -echo $PACKAGES | grep ' mnc ' > /dev/null 2>&1 -RETVAL=$? -if test "x$RETVAL" = x0 ; then - ( cd $ROOTDIR"/pkg/mnc" && $MAKE templates ) > make_mnc.errors 2>&1 - RETVAL=$? - if test "x${RETVAL}" = x0 ; then - rm -f make_mnc.errors - else - echo "Error: problem encountered while building source files in pkg/mnc:" - cat make_mnc.errors 1>&2 - exit 1 - fi - if test "x$HAVE_NETCDF" != xt ; then - cat <