/[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.32 by adcroft, Mon Mar 5 19:57:31 2001 UTC
# Line 118  echo Operating system: $mach Line 118  echo Operating system: $mach
118  # 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
119  # 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
120  if (! $?ROOTDIR) then  if (! $?ROOTDIR) then
121    set ROOTDIR = ( .. )    set pwd=`pwd`
122  else    if ($pwd:t == bin & -d ../model & -d ../eesupp & -d ../pkg) then
123    if (! $?EXEDIR) set EXEDIR = ( . )      set ROOTDIR = ( .. )
124      endif
125    endif
126    # Scan for logical ROOTDIR
127    if (! $?ROOTDIR) then
128      foreach dr (. .. ../.. ../../.. ../../../.. ../../../../..)
129        if (-d $dr/model & -d $dr/eesupp & -d $dr/pkg) then
130          set ROOTDIR = $dr
131          echo ROOTDIR was not specified. Setting ROOTDIR = \"$ROOTDIR\"
132          break
133        endif
134      end
135    endif
136    if (! $?ROOTDIR) then
137      echo Root directory was not specified and could not be determined.
138      echo Specify the root location of the model source with -rootdir=dir
139      exit 1
140  endif  endif
141  if (! -d $ROOTDIR) then  if (! -d $ROOTDIR) then
142    echo Root directory $ROOTDIR not found.;exit 1    echo Root directory $ROOTDIR not found.;exit 1
# Line 138  if (! $?BUILDDIR) set BUILDDIR = ( . ) Line 154  if (! $?BUILDDIR) set BUILDDIR = ( . )
154  if (! -d $BUILDDIR) then  if (! -d $BUILDDIR) then
155    echo Build directory $BUILDDIR not found.;exit 1    echo Build directory $BUILDDIR not found.;exit 1
156  endif  endif
157  if (! $?EXEDIR) set EXEDIR = ( $ROOTDIR/exe )  if (! $?EXEDIR) then
158      set pwd=`pwd`
159      if ($pwd:t == bin & -d ../exe & $ROOTDIR == ..) then
160       set EXEDIR = ( ../exe )
161      else
162       set EXEDIR = ( . )
163      endif
164    endif
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 156  foreach dr ($SOURCEDIRS) Line 179  foreach dr ($SOURCEDIRS)
179    endif    endif
180    echo Adding mods directory $adr    echo Adding mods directory $adr
181  end  end
 if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model diags)  
 foreach dr ($STANDARDDIRS)  
   set adr=$ROOTDIR/$dr/src  
   if (! -d $adr) then  
     echo Source directory $adr not found.; exit 1  
   endif  
   echo Adding source directory $adr  
   set SOURCEDIRS = ($SOURCEDIRS $adr)  
   set idr = `echo $adr | sed 's/src/inc/'`  
   set INCLUDEDIRS = ($INCLUDEDIRS $idr)  
 end  
182  if (! $?PACKAGES) then  if (! $?PACKAGES) then
183    set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`)    set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`)
184  endif  endif
185  foreach dr ($PACKAGES)  foreach dr ($PACKAGES)
186    set enable    set enable
187    foreach p ($DISABLE)    foreach p ($DISABLE)
188       if ($p != 'all' & ! -d $ROOTDIR/pkg/$p) then
189         echo Specified package \"$p\" does not exist.
190         exit 1
191       endif
192     if ($dr == $p) unset enable     if ($dr == $p) unset enable
193     if ($p == 'all') unset enable     if ($p == 'all') unset enable
194    end    end
# Line 191  foreach dr ($PACKAGES) Line 207  foreach dr ($PACKAGES)
207      echo "*" Package \"$dr\" has not been enabled.      echo "*" Package \"$dr\" has not been enabled.
208    endif    endif
209  end  end
210    if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model diags)
211    foreach dr ($STANDARDDIRS)
212      set adr=$ROOTDIR/$dr/src
213      if (! -d $adr) then
214        echo Source directory $adr not found.; exit 1
215      endif
216      echo Adding source directory $adr
217      set SOURCEDIRS = ($SOURCEDIRS $adr)
218      set idr = `echo $adr | sed 's/src/inc/'`
219      set INCLUDEDIRS = ($INCLUDEDIRS $idr)
220    end
221    
222  # This is the generic configuration.  # This is the generic configuration.
223  # Platform specific options are chosen below  # Platform specific options are chosen below
# Line 596  all: \$(EXECUTABLE) Line 623  all: \$(EXECUTABLE)
623  depend:  depend:
624          @make links          @make links
625          makedepend -o .f \$(INCLUDES) \$(SRCFILES)          makedepend -o .f \$(INCLUDES) \$(SRCFILES)
626    
627  links: \$(SRCFILES)  links: \$(SRCFILES)
628    
629  small_f: \$(F77FILES)  small_f: \$(F77FILES)
# Line 604  clean: Line 632  clean:
632          -rm -rf *.o *.f *.p ${RMFILES}          -rm -rf *.o *.f *.p ${RMFILES}
633  Clean:  Clean:
634          @make clean          @make clean
635          -find . -type l -exec rm {} \;          @make cleanlinks
636          -rm -f Makefile.bak          -rm -f Makefile.bak
637  CLEAN:  CLEAN:
638          @make Clean          @make Clean
639          -find \$(ROOTDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
640          -find \$(ROOTDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
641          -rm -f \$(EXECUTABLE)          -rm -f \$(EXECUTABLE)
642    
643    makefile:
644            ${0} $argv
645    cleanlinks:
646            -find . -type l -exec rm {} \;
647    
648  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .f - .o  )
649  .F.f:  .F.f:
650          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@

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

  ViewVC Help
Powered by ViewVC 1.1.22