/[MITgcm]/MITgcm/tools/genmake
ViewVC logotype

Diff of /MITgcm/tools/genmake

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.25 by cnh, Tue Feb 6 04:22:36 2001 UTC revision 1.28 by adcroft, Wed Feb 7 16:49:20 2001 UTC
# Line 50  while ($#allargs) Line 50  while ($#allargs)
50      echo "***" Command line \"$arg\" will override this.      echo "***" Command line \"$arg\" will override this.
51     endif     endif
52     set ROOTDIR = ( `echo $arg | sed 's/-rootdir=//' `)     set ROOTDIR = ( `echo $arg | sed 's/-rootdir=//' `)
53       if (! $?EXEDIR) set EXEDIR = ( . )
54     breaksw     breaksw
55   case -mods:   case -mods:
56   case -mods=:   case -mods=:
# Line 118  echo Operating system: $mach Line 119  echo Operating system: $mach
119  # If -rootdir wasn't specified then assume script is being run from bin  # If -rootdir wasn't specified then assume script is being run from bin
120  # but if it was supplied then we should place the executable in the build dir  # but if it was supplied then we should place the executable in the build dir
121  if (! $?ROOTDIR) then  if (! $?ROOTDIR) then
122    set ROOTDIR = ( .. )    set pwd=`pwd`
123  else    if ($pwd:t == bin) then
124    if (! $?EXEDIR) set EXEDIR = ( . )      if (-d ../exe & -d ../model & -d ../eesupp & -d ../pkg) then
125          set ROOTDIR = ( .. )
126          if (! $?EXEDIR) set EXEDIR = ( ../exe )
127        else if (-d ../model & -d ../eesupp & -d ../pkg) then
128          echo In bin with no exe
129          if (! $?EXEDIR) set EXEDIR = ( . )
130        endif
131      endif
132    endif
133    # Scan for logical ROOTDIR
134    if (! $?ROOTDIR) then
135      foreach dr (. .. ../.. ../../.. ../../../.. ../../../../..)
136        if (-d $dr/model & -d $dr/eesupp & -d $dr/pkg) then
137          set ROOTDIR = $dr
138          if (! $?EXEDIR) set EXEDIR = ( . )
139          echo ROOTDIR was not specified. Setting ROOTDIR = \"$ROOTDIR\"
140          break
141        endif
142      end
143    endif
144    if (! $?ROOTDIR) then
145      echo Root directory was not specified and could not be determined.
146      echo Specify the root location of the model source with -rootdir=dir
147      exit 1
148  endif  endif
149  if (! -d $ROOTDIR) then  if (! -d $ROOTDIR) then
150    echo Root directory $ROOTDIR not found.;exit 1    echo Root directory $ROOTDIR not found.;exit 1
# Line 138  if (! $?BUILDDIR) set BUILDDIR = ( . ) Line 162  if (! $?BUILDDIR) set BUILDDIR = ( . )
162  if (! -d $BUILDDIR) then  if (! -d $BUILDDIR) then
163    echo Build directory $BUILDDIR not found.;exit 1    echo Build directory $BUILDDIR not found.;exit 1
164  endif  endif
 if (! $?EXEDIR) set EXEDIR = ( $ROOTDIR/exe )  
165  if (! -d $EXEDIR) then  if (! -d $EXEDIR) then
166    echo Executable directory $EXEDIR not found.;exit 1    echo Executable directory $EXEDIR not found.;exit 1
167  endif  endif
# Line 608  Clean: Line 631  Clean:
631          -rm -f Makefile.bak          -rm -f Makefile.bak
632  CLEAN:  CLEAN:
633          @make Clean          @make Clean
634          -find \$(ROOTDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
635          -find \$(ROOTDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
636          -rm -f \$(EXECUTABLE)          -rm -f \$(EXECUTABLE)
637    
638  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .f - .o  )

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.22