--- MITgcm/tools/genmake2 2003/10/23 04:41:41 1.22 +++ MITgcm/tools/genmake2 2003/11/04 19:51:54 1.28 @@ -1,6 +1,6 @@ #!/bin/bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.22 2003/10/23 04:41:41 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.28 2003/11/04 19:51:54 edhill Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -72,7 +72,8 @@ tmp1=`uname`"_"`uname -m` tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` - PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'` + 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/'` OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")` echo " The platform appears to be: $PLATFORM" # if test "x$OFLIST" = x ; then @@ -104,7 +105,7 @@ fi # look for possible fortran compilers - tmp="$MITGCM_FC $FC g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" + tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" p_FC= for c in $tmp ; do rm -f ./hello.f ./hello @@ -909,24 +910,6 @@ fi done -# This is compatible with the old genmake. The "DISABLE_*" flags -# need to be replaced by the "ALLOW_*" flags set below. -# -# echo -n " Setting package-specific CPP flags: " -# pkrm=( mom_fluxform mom_vecinv generic_advdiff ) -# pkrmdef=( -DDISABLE_MOM_FLUXFORM -DDISABLE_MOM_VECINV -DDISABLE_GENERIC_ADVDIFF -DDISABLE_DEBUGMODE ) -# echo -n " " -# i=0 -# while test $i -lt "${#pkrm[@]}" ; do -# echo "$PACKAGES" | grep "${pk[$i]}" > /dev/null 2>&1 -# RETVAL=$? -# if test "x$RETVAL" = x1 ; then -# DEFINES="$DEFINES ${pkdef[$i]}" -# echo -n " ${pkdef[$i]}" -# fi -# i=$(( $i + 1 )) -# done -# echo # Create a list of #define and #undef to enable/disable packages PACKAGES_DOT_H=PACKAGES_CONFIG.h @@ -960,22 +943,6 @@ if test "x$has_pack" = xf ; then undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'` echo "#undef $undef" >> $PACKAGES_DOT_H".tmp" -# DEFINES="$DEFINES -U$undef" - -#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! - case $n in - mom_fluxform) - DEFINES="$DEFINES -DDISABLE_MOM_FLUXFORM" - ;; - mom_vecinv) - DEFINES="$DEFINES -DDISABLE_MOM_VECINV" - ;; - debug) - DEFINES="$DEFINES -DDISABLE_DEBUGMODE" - ;; - esac -#EH3 WARNING : This is an UGLY HACK that needs to be removed!!! - fi fi done @@ -1364,16 +1331,13 @@ cat >>$MAKEFILE < AD_CONFIG.h - # ... AD ... -ad: ad_taf -ad_taf_f: ad_taf_output.f -ad_tamc_f: ad_tamc_output.f +adall: ad_taf +adtaf: ad_taf_output.f +adtamc: ad_tamc_output.f -ad_input_code.f: \$(SRCFILES) - cat ad_config.template > AD_CONFIG.h +ad_input_code.f: \$(AD_FILES) \$(HEADERFILES) + cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h @make \$(F77FILES) @make \$(AD_FLOW_FILES) cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f @@ -1394,12 +1358,13 @@ # ... FTL ... -ftl: ftl_taf -ftl_taf_f: ftl_taf_output.f -ftl_tamc_f: ftl_tamc_output.f +ftlall: ftl_taf +ftltaf: ftl_taf_output.f +ftltamc: ftl_tamc_output.f -ftl_input_code.f: \$(SRCFILES) - cat ftl_config.template > AD_CONFIG.h +ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES) + cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h + @make \$(F77FILES) @make \$(AD_FLOW_FILES) cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f @@ -1423,7 +1388,8 @@ svd_taf_f: svd_taf_output.f svd_input_code.f: \$(SRCFILES) - cat svd_config.template > AD_CONFIG.h + 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 @@ -1474,37 +1440,37 @@ printf "\n=== Done ===\n" # Write the "template" files for the adjoint builds -cat >>AD_CONFIG.template <AD_CONFIG.template <>ad_config.template <ad_config.template <>ftl_config.template <ftl_config.template <>svd_config.template <svd_config.template <