--- MITgcm/tools/genmake2 2003/12/05 15:08:33 1.53 +++ MITgcm/tools/genmake2 2004/01/11 17:02:47 1.59 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.53 2003/12/05 15:08:33 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.59 2004/01/11 17:02:47 edhill Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -78,7 +78,9 @@ tmp1=`uname`"_"`uname -m` tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'` - PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'` + tmp1=`echo $tmp3 | sed -e 's|x86_64|amd64|'` + tmp2=`echo $tmp1 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'` + PLATFORM=$tmp2 OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")` echo " The platform appears to be: $PLATFORM" @@ -476,7 +478,7 @@ TOOLSDIR= SOURCEDIRS= INCLUDEDIRS= -STANDARDDIRS= +STANDARDDIRS="USE_THE_DEFAULT" PWD=`pwd` MAKE=make @@ -960,6 +962,20 @@ fi fi +#same for exch2 +if test -r $ROOTDIR"/pkg/exch2/Makefile" ; then + echo " Making source files in exch2 from templates" + ( cd $ROOTDIR"/pkg/exch2/" && $MAKE ) > make_exch2.errors 2>&1 + RETVAL=$? + if test "x${RETVAL}" = x0 ; then + rm -f make_exch2.errors + else + echo "Error: problem encountered while building source files in exch2:" + cat make_exch2.errors + exit 1 + fi +fi + printf "\n=== Determining package settings ===\n" if test "x${PDEPEND}" = x ; then tmp=$ROOTDIR"/pkg/pkg_depend" @@ -1177,9 +1193,8 @@ #EH3 WARNING : This is an UGLY HACK that needs to be removed!!! case $i in aim_v23) - DEFINES="$DEFINES -DALLOW_AIM" ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM" - 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." ;; esac #EH3 WARNING : This is an UGLY HACK that needs to be removed!!! @@ -1188,27 +1203,29 @@ echo " Adding STANDARDDIRS" BUILDDIR=${BUILDDIR:-.} -if test "x$STANDARDDIRS" = x ; then +if test "x$STANDARDDIRS" = xUSE_THE_DEFAULT ; then STANDARDDIRS="eesupp model" fi -for d in $STANDARDDIRS ; do - adr="$ROOTDIR/$d/src" - if test ! -d $adr ; then - echo "Error: directory $adr not found -- please check that ROOTDIR=\"$ROOTDIR\"" - echo " is correct and that you correctly specified the STANDARDDIRS option" - exit 1 - else - SOURCEDIRS="$SOURCEDIRS $adr" - fi - adr="$ROOTDIR/$d/inc" - if test ! -d $adr ; then - echo "Error: directory $adr not found -- please check that ROOTDIR=\"$ROOTDIR\"" - echo " is correct and that you correctly specified the STANDARDDIRS option" - exit 1 - else - INCLUDEDIRS="$INCLUDEDIRS $adr" - fi -done +if test "x$STANDARDDIRS" != x ; then + for d in $STANDARDDIRS ; do + adr="$ROOTDIR/$d/src" + if test ! -d $adr ; then + echo "Error: directory $adr not found -- please check that ROOTDIR=\"$ROOTDIR\"" + echo " is correct and that you correctly specified the STANDARDDIRS option" + exit 1 + else + SOURCEDIRS="$SOURCEDIRS $adr" + fi + adr="$ROOTDIR/$d/inc" + if test ! -d $adr ; then + echo "Error: directory $adr not found -- please check that ROOTDIR=\"$ROOTDIR\"" + echo " is correct and that you correctly specified the STANDARDDIRS option" + exit 1 + else + INCLUDEDIRS="$INCLUDEDIRS $adr" + fi + done +fi echo " Searching for *OPTIONS.h files in order to warn about the presence" echo " of \"#define \"-type statements that are no longer allowed:" @@ -1218,7 +1235,7 @@ names=`ls -1 "$ROOTDIR/pkg"` for i in $spaths ; do try="$i/CPP_OPTIONS.h" - if test -f $try -a -r $try -a "x$CPP_OPTIONS" == x ; then + if test -f $try -a -r $try -a "x$CPP_OPTIONS" = x ; then echo " found CPP_OPTIONS=\"$try\"" CPP_OPTIONS="$try" # New safety test: make sure packages are not mentioned in CPP_OPTIONS.h @@ -1227,7 +1244,7 @@ done fi try="$i/CPP_EEOPTIONS.h" - if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" == x ; then + if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" = x ; then echo " found CPP_EEOPTIONS=\"$try\"" # New safety test: make sure MPI is not determined by CPP_EEOPTIONS.h #**** not yet enabled ****