/[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.28 by adcroft, Wed Feb 7 16:49:20 2001 UTC revision 1.33.2.1 by adcroft, Tue Mar 20 16:53:31 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=//' `)
    if (! $?EXEDIR) set EXEDIR = ( . )  
53     breaksw     breaksw
54   case -mods:   case -mods:
55   case -mods=:   case -mods=:
# Line 120  echo Operating system: $mach Line 119  echo Operating system: $mach
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 pwd=`pwd`    set pwd=`pwd`
122    if ($pwd:t == bin) then    if ($pwd:t == bin & -d ../model & -d ../eesupp & -d ../pkg) then
123      if (-d ../exe & -d ../model & -d ../eesupp & -d ../pkg) then      set ROOTDIR = ( .. )
       set ROOTDIR = ( .. )  
       if (! $?EXEDIR) set EXEDIR = ( ../exe )  
     else if (-d ../model & -d ../eesupp & -d ../pkg) then  
       echo In bin with no exe  
       if (! $?EXEDIR) set EXEDIR = ( . )  
     endif  
124    endif    endif
125  endif  endif
126  # Scan for logical ROOTDIR  # Scan for logical ROOTDIR
# Line 135  if (! $?ROOTDIR) then Line 128  if (! $?ROOTDIR) then
128    foreach dr (. .. ../.. ../../.. ../../../.. ../../../../..)    foreach dr (. .. ../.. ../../.. ../../../.. ../../../../..)
129      if (-d $dr/model & -d $dr/eesupp & -d $dr/pkg) then      if (-d $dr/model & -d $dr/eesupp & -d $dr/pkg) then
130        set ROOTDIR = $dr        set ROOTDIR = $dr
       if (! $?EXEDIR) set EXEDIR = ( . )  
131        echo ROOTDIR was not specified. Setting ROOTDIR = \"$ROOTDIR\"        echo ROOTDIR was not specified. Setting ROOTDIR = \"$ROOTDIR\"
132        break        break
133      endif      endif
# Line 162  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) 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 179  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=()
184      foreach pkg (`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`)
185       if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg)
186      end
187  endif  endif
188  foreach dr ($PACKAGES)  foreach dr ($PACKAGES)
189    set enable    set enable
190    foreach p ($DISABLE)    foreach p ($DISABLE)
191       if ($p != 'all' & ! -d $ROOTDIR/pkg/$p) then
192         echo Specified package \"$p\" does not exist.
193         exit 1
194       endif
195     if ($dr == $p) unset enable     if ($dr == $p) unset enable
196     if ($p == 'all') unset enable     if ($p == 'all') unset enable
197    end    end
# Line 214  foreach dr ($PACKAGES) Line 210  foreach dr ($PACKAGES)
210      echo "*" Package \"$dr\" has not been enabled.      echo "*" Package \"$dr\" has not been enabled.
211    endif    endif
212  end  end
213    if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model)
214    foreach dr ($STANDARDDIRS)
215      set adr=$ROOTDIR/$dr/src
216      if (! -d $adr) then
217        echo Source directory $adr not found.; exit 1
218      endif
219      echo Adding source directory $adr
220      set SOURCEDIRS = ($SOURCEDIRS $adr)
221      set idr = `echo $adr | sed 's/src/inc/'`
222      set INCLUDEDIRS = ($INCLUDEDIRS $idr)
223    end
224    
225  # This is the generic configuration.  # This is the generic configuration.
226  # Platform specific options are chosen below  # Platform specific options are chosen below
# Line 619  all: \$(EXECUTABLE) Line 626  all: \$(EXECUTABLE)
626  depend:  depend:
627          @make links          @make links
628          makedepend -o .f \$(INCLUDES) \$(SRCFILES)          makedepend -o .f \$(INCLUDES) \$(SRCFILES)
629    
630  links: \$(SRCFILES)  links: \$(SRCFILES)
631    
632  small_f: \$(F77FILES)  small_f: \$(F77FILES)
# Line 627  clean: Line 635  clean:
635          -rm -rf *.o *.f *.p ${RMFILES}          -rm -rf *.o *.f *.p ${RMFILES}
636  Clean:  Clean:
637          @make clean          @make clean
638          -find . -type l -exec rm {} \;          @make cleanlinks
639          -rm -f Makefile.bak          -rm -f Makefile.bak
640  CLEAN:  CLEAN:
641          @make Clean          @make Clean
# Line 635  CLEAN: Line 643  CLEAN:
643          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
644          -rm -f \$(EXECUTABLE)          -rm -f \$(EXECUTABLE)
645    
646    makefile:
647            ${0} $argv
648    cleanlinks:
649            -find . -type l -exec rm {} \;
650    
651  # The normal chain of rules is (  .F - .f - .o  )  # The normal chain of rules is (  .F - .f - .o  )
652  .F.f:  .F.f:
653          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@

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

  ViewVC Help
Powered by ViewVC 1.1.22