122 |
stop |
stop |
123 |
end |
end |
124 |
EOF |
EOF |
125 |
test -e Makefile && mv -f Makefile Makefile.bak |
test -f Makefile && mv -f Makefile Makefile.bak |
126 |
cat <<EOF >> Makefile |
cat <<EOF >> Makefile |
127 |
%.$tfs : %.F |
%.$tfs : %.F |
128 |
.SUFFIXES: |
.SUFFIXES: |
131 |
EOF |
EOF |
132 |
$MAKE "genmake_hello."$tfs > /dev/null 2>&1 |
$MAKE "genmake_hello."$tfs > /dev/null 2>&1 |
133 |
RETVAL=$? |
RETVAL=$? |
134 |
if test "x$RETVAL" != x0 -o ! -e "genmake_hello."$tfs ; then |
if test "x$RETVAL" != x0 -o ! -f "genmake_hello."$tfs ; then |
135 |
if test "x$FS" = x ; then |
if test "x$FS" = x ; then |
136 |
FS='for' |
FS='for' |
137 |
FS90='fr9' |
FS90='fr9' |
149 |
fi |
fi |
150 |
fi |
fi |
151 |
rm -f genmake_hello.* Makefile |
rm -f genmake_hello.* Makefile |
152 |
test -e Makefile && mv -f Makefile.bak Makefile |
test -f Makefile && mv -f Makefile.bak Makefile |
153 |
|
|
154 |
# If we make it here, use the extensions |
# If we make it here, use the extensions |
155 |
FS=$tfs |
FS=$tfs |
483 |
|
|
484 |
# Build a CPP macro to automate calling C routines from FORTRAN |
# Build a CPP macro to automate calling C routines from FORTRAN |
485 |
get_fortran_c_namemangling() { |
get_fortran_c_namemangling() { |
486 |
|
|
487 |
|
#echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\"" |
488 |
|
if test ! "x$FC_NAMEMANGLE" = x ; then |
489 |
|
return 0 |
490 |
|
fi |
491 |
|
|
492 |
default_nm="#define FC_NAMEMANGLE(X) X ## _" |
default_nm="#define FC_NAMEMANGLE(X) X ## _" |
493 |
|
|
494 |
cat > genmake_test.c <<EOF |
cat > genmake_test.c <<EOF |
625 |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
626 |
end |
end |
627 |
EOF |
EOF |
628 |
$CPP genmake_tnc.for > genmake_tnc.f \ |
#echo "$CPP $DEFINES $INCLUDES" |
629 |
|
$CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f \ |
630 |
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f $LIBS >> genmake_tnc.log 2>&1 |
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f $LIBS >> genmake_tnc.log 2>&1 |
631 |
RET_COMPILE=$? |
RET_COMPILE=$? |
632 |
test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
635 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
636 |
else |
else |
637 |
# try again with "-lnetcdf" added to the libs |
# try again with "-lnetcdf" added to the libs |
638 |
$CPP genmake_tnc.for > genmake_tnc.f \ |
$CPP $DEFINES $INCLUDES genmake_tnc.for > genmake_tnc.f \ |
639 |
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \ |
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \ |
640 |
$LIBS -lnetcdf >> genmake_tnc_2.log 2>&1 |
$LIBS -lnetcdf >> genmake_tnc_2.log 2>&1 |
641 |
RET_COMPILE=$? |
RET_COMPILE=$? |
778 |
fi |
fi |
779 |
done |
done |
780 |
printf " getting local config information: " |
printf " getting local config information: " |
781 |
if test -e $gm_local ; then |
if test -f $gm_local ; then |
782 |
echo "using $gm_local" |
echo "using $gm_local" |
783 |
. $gm_local |
. $gm_local |
784 |
# echo "DISABLE=$DISABLE" |
# echo "DISABLE=$DISABLE" |
1697 |
echo "" >> hlist.inc |
echo "" >> hlist.inc |
1698 |
echo "" >> ad_flow_files.inc |
echo "" >> ad_flow_files.inc |
1699 |
|
|
1700 |
if test -e $MAKEFILE ; then |
if test -f $MAKEFILE ; then |
1701 |
mv -f $MAKEFILE "$MAKEFILE.bak" |
mv -f $MAKEFILE "$MAKEFILE.bak" |
1702 |
fi |
fi |
1703 |
echo " Writing makefile: $MAKEFILE" |
echo " Writing makefile: $MAKEFILE" |