88 |
echo "Including paths to JAM libraries" |
echo "Including paths to JAM libraries" |
89 |
breaksw |
breaksw |
90 |
case -help: |
case -help: |
91 |
echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi]" |
echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi] [-jam] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]" |
92 |
|
cat << EOF |
93 |
|
|
94 |
|
$0 is used to generate the Makefile in the current directory. |
95 |
|
|
96 |
|
Typical invocations are: |
97 |
|
o from "bin": ../tools/genmake |
98 |
|
o from "verification/expt/code": ../../../tools/genmake |
99 |
|
o from "verification/expt/input": ../../../tools/genmake -mods=../code |
100 |
|
o from a scratch directory: ~/mitgcm/tools/genmake -rootdir=~/mitgcm |
101 |
|
or ~/mitgcm/tools/genmake -rootdir=~/mitgcm -mods=~/mymods |
102 |
|
|
103 |
|
Packages (collected modules of code) can be disabled to avoid unnecessary |
104 |
|
compilation of unused code. For instance if you know you will not |
105 |
|
use GM/Redi, KPP and OBCS and they are appropriate turned-off in the |
106 |
|
configuration: |
107 |
|
.../tools/genmake -disable=gmredi,kpp,obcs |
108 |
|
|
109 |
|
If you add some source files you can re-call the previous instance of |
110 |
|
genmake with "make makefile". |
111 |
|
|
112 |
|
genmake also reads the file .genmakerc which can be used to configure |
113 |
|
options (primarily the command-line options above) for particular experiments. |
114 |
|
EOF |
115 |
exit |
exit |
116 |
breaksw |
breaksw |
117 |
default: |
default: |
203 |
echo Adding mods directory $adr |
echo Adding mods directory $adr |
204 |
end |
end |
205 |
if (! $?PACKAGES) then |
if (! $?PACKAGES) then |
206 |
set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`) |
set PACKAGES=() |
207 |
|
foreach pkg (`cd $ROOTDIR/pkg; find . -type d | grep -v CVS | sed 's:\./::' | grep -v "\." | sort`) |
208 |
|
if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg) |
209 |
|
end |
210 |
endif |
endif |
211 |
foreach dr ($PACKAGES) |
foreach dr ($PACKAGES) |
212 |
set enable |
set enable |
217 |
endif |
endif |
218 |
if ($dr == $p) unset enable |
if ($dr == $p) unset enable |
219 |
if ($p == 'all') unset enable |
if ($p == 'all') unset enable |
220 |
|
# The following allows entire trees to be disabled |
221 |
|
if ($dr:h == $p) unset enable |
222 |
|
if ($dr:h:h == $p) unset enable |
223 |
|
if ($dr:h:h:h == $p) unset enable |
224 |
|
if ($dr:h:h:h:h == $p) unset enable |
225 |
end |
end |
226 |
foreach p ($ENABLE) |
foreach p ($ENABLE) |
227 |
if ($dr == $p) set enable |
if ($dr == $p) set enable |