122 |
stop |
stop |
123 |
end |
end |
124 |
EOF |
EOF |
125 |
test -f Makefile && mv -f Makefile Makefile.bak |
test -f $MAKEFILE && mv -f $MAKEFILE $MAKEFILE".tst" |
126 |
cat <<EOF >> Makefile |
cat <<EOF >> $MAKEFILE |
127 |
.SUFFIXES: |
.SUFFIXES: |
128 |
.SUFFIXES: .$tfs .F |
.SUFFIXES: .$tfs .F |
129 |
.F.$tfs: |
.F.$tfs: |
148 |
return |
return |
149 |
fi |
fi |
150 |
fi |
fi |
151 |
rm -f genmake_hello.* Makefile |
rm -f genmake_hello.* $MAKEFILE |
152 |
test -f Makefile && mv -f Makefile.bak Makefile |
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
153 |
|
|
154 |
# If we make it here, use the extensions |
# If we make it here, use the extensions |
155 |
FS=$tfs |
FS=$tfs |
181 |
if test "x${MAKEDEPEND}" = x ; then |
if test "x${MAKEDEPEND}" = x ; then |
182 |
which makedepend > /dev/null 2>&1 |
which makedepend > /dev/null 2>&1 |
183 |
RV0=$? |
RV0=$? |
184 |
|
test -f $MAKEFILE && mv -f $MAKEFILE $MAKEFILE".tst" |
185 |
|
# echo 'MAKEFILE="'$MAKEFILE'"' |
186 |
|
cat <<EOF >> $MAKEFILE |
187 |
|
# THIS IS A TEST MAKEFILE GENERATED BY "genmake2" |
188 |
|
# |
189 |
|
# Some "makedepend" implementations will die if they cannot |
190 |
|
# find a Makefile -- so this file is here to gives them an |
191 |
|
# empty one to find and parse. |
192 |
|
EOF |
193 |
cat <<EOF >> genmake_tc.f |
cat <<EOF >> genmake_tc.f |
194 |
program test |
program test |
195 |
write(*,*) 'test' |
write(*,*) 'test' |
197 |
end |
end |
198 |
EOF |
EOF |
199 |
makedepend genmake_tc.f > /dev/null 2>&1 |
makedepend genmake_tc.f > /dev/null 2>&1 |
200 |
|
test -f $MAKEFILE && rm -f $MAKEFILE |
201 |
|
test -f $MAKEFILE".tst" && mv -f $MAKEFILE".tst" $MAKEFILE |
202 |
RV1=$? |
RV1=$? |
203 |
if test "x${RV0}${RV1}" = x00 ; then |
if test "x${RV0}${RV1}" = x00 ; then |
204 |
MAKEDEPEND=makedepend |
MAKEDEPEND=makedepend |
815 |
PACKAGES= |
PACKAGES= |
816 |
ENABLE= |
ENABLE= |
817 |
DISABLE= |
DISABLE= |
818 |
MAKEFILE= |
# MAKEFILE= |
819 |
#MAKEDEPEND= |
# MAKEDEPEND= |
820 |
PDEPEND= |
PDEPEND= |
821 |
DUMPSTATE=t |
DUMPSTATE=t |
822 |
PDEFAULT= |
PDEFAULT= |
1106 |
|
|
1107 |
done |
done |
1108 |
|
|
1109 |
|
|
1110 |
if test -f ./.genmakerc ; then |
if test -f ./.genmakerc ; then |
1111 |
echo |
echo |
1112 |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\"" |
1151 |
THISVER=`grep checkpoint ${ROOTDIR}/doc/tag-index | head -1` |
THISVER=`grep checkpoint ${ROOTDIR}/doc/tag-index | head -1` |
1152 |
fi |
fi |
1153 |
|
|
1154 |
|
if test "x$MAKEFILE" = x ; then |
1155 |
|
MAKEFILE="Makefile" |
1156 |
|
fi |
1157 |
|
|
1158 |
echo " getting OPTFILE information: " |
echo " getting OPTFILE information: " |
1159 |
if test "x${OPTFILE}" = x ; then |
if test "x${OPTFILE}" = x ; then |
1160 |
if test "x$MITGCM_OF" = x ; then |
if test "x$MITGCM_OF" = x ; then |
1184 |
fi |
fi |
1185 |
fi |
fi |
1186 |
|
|
|
# Check for broken systems that cannot correctly distinguish *.F and *.f files |
|
|
# check_for_broken_Ff |
|
|
|
|
1187 |
echo " getting AD_OPTFILE information: " |
echo " getting AD_OPTFILE information: " |
1188 |
if test "x${AD_OPTFILE}" = x ; then |
if test "x${AD_OPTFILE}" = x ; then |
1189 |
if test "x$MITGCM_AD_OF" = x ; then |
if test "x$MITGCM_AD_OF" = x ; then |
1211 |
fi |
fi |
1212 |
fi |
fi |
1213 |
|
|
1214 |
|
#==================================================================== |
1215 |
|
# Set default values if not set by the optfile |
1216 |
|
# |
1217 |
# Check that FC, CC, LINK, CPP, S64, LN, and MAKE are defined. If not, |
# Check that FC, CC, LINK, CPP, S64, LN, and MAKE are defined. If not, |
1218 |
# either set defaults or complain and abort! |
# either set defaults or complain and abort! |
1219 |
if test ! "x$BASH" = x ; then |
if test ! "x$BASH" = x ; then |
1404 |
done |
done |
1405 |
echo |
echo |
1406 |
|
|
|
if test "x$MAKEFILE" = x ; then |
|
|
MAKEFILE="Makefile" |
|
|
fi |
|
1407 |
if test "x${PLATFORM}" = x ; then |
if test "x${PLATFORM}" = x ; then |
1408 |
PLATFORM=$p_PLATFORM |
PLATFORM=$p_PLATFORM |
1409 |
fi |
fi |