10 |
# Default lists |
# Default lists |
11 |
set DISABLE = ( aim ) |
set DISABLE = ( aim ) |
12 |
set ENABLE = ( ) |
set ENABLE = ( ) |
13 |
set MYMODS = ( ) |
set MODS = ( ) |
14 |
|
|
15 |
# Grab variables/lists from .genmakerc |
# Grab variables/lists from .genmakerc |
16 |
if (-r .genmakerc) source .genmakerc |
if (-r .genmakerc) source .genmakerc |
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 -mymods: |
case -mods: |
56 |
case -mymods=: |
case -mods=: |
57 |
echo "To specify an additional source directory you must specify one with -mymods=dir" |
echo "To specify an additional source directory you must specify one with -mods=dir" |
58 |
echo "with NO space eg. -mymods=../code or -mymods=/usr/people/joe/src" |
echo "with NO space eg. -mods=../code or -mods=/usr/people/joe/src" |
59 |
exit |
exit |
60 |
breaksw |
breaksw |
61 |
case -mymods=*: |
case -mods=*: |
62 |
set MYMODS = ( $MYMODS `echo $arg | sed 's/-mymods=//' | sed 's/,/ /' `) |
set MODS = ( $MODS `echo $arg | sed 's/-mods=//' | sed 's/,/ /g' `) |
63 |
breaksw |
breaksw |
64 |
case -disable: |
case -disable: |
65 |
case -disable=: |
case -disable=: |
68 |
exit |
exit |
69 |
breaksw |
breaksw |
70 |
case -disable=*: |
case -disable=*: |
71 |
set DISABLE = ( $DISABLE `echo $arg | sed 's/-disable=//' | sed 's/,/ /' `) |
set DISABLE = ( $DISABLE `echo $arg | sed 's/-disable=//' | sed 's/,/ /g' `) |
72 |
breaksw |
breaksw |
73 |
case -enable: |
case -enable: |
74 |
case -enable=: |
case -enable=: |
78 |
exit |
exit |
79 |
breaksw |
breaksw |
80 |
case -enable=*: |
case -enable=*: |
81 |
set ENABLE = ( $ENABLE `echo $arg | sed 's/-enable=//' | sed 's/,/ /' `) |
set ENABLE = ( $ENABLE `echo $arg | sed 's/-enable=//' | sed 's/,/ /g' `) |
82 |
breaksw |
breaksw |
83 |
case -mpi: |
case -mpi: |
84 |
echo "Enabling MPI options" |
echo "Enabling MPI options" |
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 |
151 |
endif |
endif |
152 |
# If -mymods wasn't specified then we will assume that we can find all the |
# If -mods wasn't specified then we will assume that we can find all the |
153 |
# source code in the standard directories |
# source code in the standard directories |
154 |
if (! $?MYMODS) then |
if (! $?MODS) then |
155 |
set SOURCEDIRS = ( ) |
set SOURCEDIRS = ( ) |
156 |
set INCLUDEDIRS = ( . ) |
set INCLUDEDIRS = ( . ) |
157 |
else |
else |
158 |
set SOURCEDIRS = ( $MYMODS ) |
set SOURCEDIRS = ( $MODS ) |
159 |
set INCLUDEDIRS = ( . $MYMODS ) |
set INCLUDEDIRS = ( . $MODS ) |
160 |
endif |
endif |
161 |
if (! $?BUILDDIR) set BUILDDIR = ( . ) |
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 |
175 |
foreach dr ($SOURCEDIRS) |
foreach dr ($SOURCEDIRS) |
176 |
set adr=$dr |
set adr=$dr |
177 |
if (! -d $adr) then |
if (! -d $adr) then |
178 |
echo Mymods directory $adr not found.; exit 1 |
echo mods directory $adr not found.; exit 1 |
179 |
endif |
endif |
180 |
echo Adding mymods directory $adr |
echo Adding mods directory $adr |
181 |
end |
end |
182 |
if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model diags) |
if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model diags) |
183 |
foreach dr ($STANDARDDIRS) |
foreach dr ($STANDARDDIRS) |
187 |
endif |
endif |
188 |
echo Adding source directory $adr |
echo Adding source directory $adr |
189 |
set SOURCEDIRS = ($SOURCEDIRS $adr) |
set SOURCEDIRS = ($SOURCEDIRS $adr) |
190 |
set INCLUDEDIRS = ($INCLUDEDIRS $adr:s/src/inc/) |
set idr = `echo $adr | sed 's/src/inc/'` |
191 |
|
set INCLUDEDIRS = ($INCLUDEDIRS $idr) |
192 |
end |
end |
193 |
if (! $?PACKAGES) then |
if (! $?PACKAGES) then |
194 |
set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`) |
set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`) |
254 |
set KPPFILES = ( 'main.F' ) |
set KPPFILES = ( 'main.F' ) |
255 |
set KFLAGS1 = ( '-scan=132 -noconc -cmp=' ) |
set KFLAGS1 = ( '-scan=132 -noconc -cmp=' ) |
256 |
set FC = ( 'f77' ) |
set FC = ( 'f77' ) |
257 |
set FFLAGS = ( '-convert big_endian -r8 -extend_source -u -automatic -call_shared -notransform_loops -align dcommons' ) |
set FFLAGS = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' ) |
258 |
set FOPTIM = ( '-O5 -fast -tune host -inline all' ) |
set FOPTIM = ( '-O5 -fast -tune host -inline all' ) |
259 |
set NOOPTFLAGS = ( '-O0' ) |
set NOOPTFLAGS = ( '-O0' ) |
260 |
set LIBS = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' ) |
set LIBS = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' ) |
484 |
if ($#deplist != 0) then |
if ($#deplist != 0) then |
485 |
echo "# These files are linked from $dr" >> srclinks.tmp |
echo "# These files are linked from $dr" >> srclinks.tmp |
486 |
echo $deplist':' >> srclinks.tmp |
echo $deplist':' >> srclinks.tmp |
487 |
echo '\t$(LN) '$dr'/$@ $@' >> srclinks.tmp |
echo ' $(LN) '$dr'/$@ $@' >> srclinks.tmp |
488 |
endif |
endif |
489 |
end |
end |
490 |
rm -rf .links.tmp |
rm -rf .links.tmp |
532 |
SOURCEDIRS = ${SOURCEDIRS} |
SOURCEDIRS = ${SOURCEDIRS} |
533 |
INCLUDEDIRS = ${INCLUDEDIRS} |
INCLUDEDIRS = ${INCLUDEDIRS} |
534 |
EXEDIR = ${EXEDIR} |
EXEDIR = ${EXEDIR} |
535 |
EXECUTABLE = \$(EXEDIR)${EXECUTABLE} |
EXECUTABLE = \$(EXEDIR)/${EXECUTABLE} |
536 |
TOOLSDIR = ${TOOLSDIR} |
TOOLSDIR = ${TOOLSDIR} |
537 |
|
|
538 |
EOF |
EOF |
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 ) |