/[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.11.2.8 by edhill, Thu Oct 2 18:26:44 2003 UTC revision 1.11.2.10 by edhill, Fri Oct 3 19:49:06 2003 UTC
# Line 72  find_possible_configs()  { Line 72  find_possible_configs()  {
72    
73      tmp1=`uname`"_"`uname -m`      tmp1=`uname`"_"`uname -m`
74      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
75      PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/'`      PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
76      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
77      echo "  The platform appears to be:  $PLATFORM"      echo "  The platform appears to be:  $PLATFORM"
78  #     if test "x$OFLIST" = x ; then  #     if test "x$OFLIST" = x ; then
# Line 239  usage()  { Line 239  usage()  {
239      echo "      -disable=NAME | --disable=NAME"      echo "      -disable=NAME | --disable=NAME"
240      echo "    -enable NAME | --enable NAME"      echo "    -enable NAME | --enable NAME"
241      echo "      -enable=NAME | --enable=NAME"      echo "      -enable=NAME | --enable=NAME"
242        echo "    -standarddirs NAME | --standarddirs NAME"
243        echo "      -standarddirs=NAME | --standarddirs=NAME"
244      echo "    -noopt NAME | --noopt NAME"      echo "    -noopt NAME | --noopt NAME"
245      echo "      -noopt=NAME | --noopt=NAME"      echo "      -noopt=NAME | --noopt=NAME"
246  #    echo "    -cpp NAME | --cpp NAME"  #    echo "    -cpp NAME | --cpp NAME"
# Line 313  MODS= Line 315  MODS=
315  TOOLSDIR=  TOOLSDIR=
316  SOURCEDIRS=  SOURCEDIRS=
317  INCLUDEDIRS=  INCLUDEDIRS=
318    STANDARDDIRS=
319    
320  PWD=`pwd`  PWD=`pwd`
321  MAKE=make  MAKE=make
# Line 323  MACHINE=`uname -a` Line 326  MACHINE=`uname -a`
326  EXECUTABLE=  EXECUTABLE=
327  EXEHOOK=  EXEHOOK=
328  EXEDIR=  EXEDIR=
329    PACKAGES_CONF=
330    
331  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
332  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT"  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT"
333  gm_s2="FC IEEE MPI JAM DUMPSTATE"  gm_s2="FC IEEE MPI JAM DUMPSTATE STANDARDDIRS"
334    
335  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
336  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "
337  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"
338  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"
339  gm_s6="EXECUTABLE EXEHOOK EXEDIR"  gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF"
340    
341  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6"  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6"
342    
343    
344  echo  echo
345  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
346  gm_local="./gm_local"  gm_local="genmake_local"
347    for i in . $MODS ; do
348        if test -r $i/$gm_local ; then
349            source $i/$gm_local
350            break
351        fi
352    done
353  echo -n "  getting local config information:  "  echo -n "  getting local config information:  "
354  if test -e $gm_local ; then  if test -e $gm_local ; then
355      echo "using $gm_local"      echo "using $gm_local"
# Line 431  for ac_option ; do Line 441  for ac_option ; do
441          -enable=* | --enable=*)          -enable=* | --enable=*)
442              ENABLE=$ac_optarg ;;              ENABLE=$ac_optarg ;;
443                    
444            -standarddirs | --standarddirs)
445                ac_prev=STANDARDDIRS ;;
446            -standarddirs=* | --standarddirs=*)
447                STANDARDDIRS=$ac_optarg ;;
448    
449          -noopt | --noopt)          -noopt | --noopt)
450              ac_prev=NOOPT ;;              ac_prev=NOOPT ;;
451          -noopt=* | --noopt=*)          -noopt=* | --noopt=*)
# Line 524  if test "x$OPTFILE" != xNONE ; then Line 539  if test "x$OPTFILE" != xNONE ; then
539              exit 1              exit 1
540          fi          fi
541          if test "x$DUMPSTATE" != xf ; then          if test "x$DUMPSTATE" != xf ; then
542              cp -f $OPTFILE "gm_optfile"              cp -f $OPTFILE "genmake_optfile"
543          fi          fi
544      else      else
545          echo "Error: can't read OPTFILE=\"$OPTFILE\""          echo "Error: can't read OPTFILE=\"$OPTFILE\""
# Line 540  if test "x$FC" = x ; then Line 555  if test "x$FC" = x ; then
555  Error: no Fortran compiler: please specify using one of the following:  Error: no Fortran compiler: please specify using one of the following:
556    1) within the options file ("FC=...") as specified by "-of=OPTFILE"    1) within the options file ("FC=...") as specified by "-of=OPTFILE"
557    2) the "-fc=XXX" command-line option    2) the "-fc=XXX" command-line option
558    3) the "./gm_local" file    3) the "./genmake_local" file
559  EOF  EOF
560      exit 1      exit 1
561  fi  fi
# Line 558  if test "x$RETVAL" != x0 ; then Line 573  if test "x$RETVAL" != x0 ; then
573  Error: C pre-processor "$CPP" failed the test case: please specify using:  Error: C pre-processor "$CPP" failed the test case: please specify using:
574    
575    1) within the options file ("CPP=...") as specified by "-of=OPTFILE"    1) within the options file ("CPP=...") as specified by "-of=OPTFILE"
576    2) the "./gm_local" file    2) the "./genmake_local" file
577    
578  EOF  EOF
579      exit 1      exit 1
# Line 923  fi Line 938  fi
938    
939  echo "  Adding STANDARDDIRS"  echo "  Adding STANDARDDIRS"
940  BUILDDIR=${BUILDDIR:-.}  BUILDDIR=${BUILDDIR:-.}
941  STANDARDDIRS=${STANDARDDIRS:-"eesupp model"}  if test "x$STANDARDDIRS" = x ; then
942        STANDARDDIRS="eesupp model"
943    fi
944  for d in $STANDARDDIRS ; do  for d in $STANDARDDIRS ; do
945      adr="$ROOTDIR/$d/src"      adr="$ROOTDIR/$d/src"
946      if test ! -d $adr ; then      if test ! -d $adr ; then
# Line 1153  clean: Line 1170  clean:
1170  Clean:  Clean:
1171          @make clean          @make clean
1172          @make cleanlinks          @make cleanlinks
1173          -rm -f Makefile.bak gm_state gm_optfile make.log          -rm -f Makefile.bak genmake_state genmake_optfile make.log
1174  CLEAN:  CLEAN:
1175          @make Clean          @make Clean
1176          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
# Line 1223  printf "\n===  Done  ===\n" Line 1240  printf "\n===  Done  ===\n"
1240    
1241  #  Write the "state" for future records  #  Write the "state" for future records
1242  if test "x$DUMPSTATE" != xf ; then  if test "x$DUMPSTATE" != xf ; then
1243      echo -n "" > gm_state      echo -n "" > genmake_state
1244      for i in $gm_state ; do      for i in $gm_state ; do
1245          t1="t2=\$$i"          t1="t2=\$$i"
1246          eval $t1          eval $t1
1247          echo "$i='$t2'" >> gm_state          echo "$i='$t2'" >> genmake_state
1248      done      done
1249  fi  fi

Legend:
Removed from v.1.11.2.8  
changed lines
  Added in v.1.11.2.10

  ViewVC Help
Powered by ViewVC 1.1.22