321 |
|
|
322 |
#================================================================ |
#================================================================ |
323 |
# look for possible FORTRAN compilers |
# look for possible FORTRAN compilers |
324 |
tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" |
tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95 gfortran" |
325 |
p_FC= |
p_FC= |
326 |
for c in $tmp ; do |
for c in $tmp ; do |
327 |
rm -f ./hello.f ./hello |
rm -f ./hello.f ./hello |
353 |
else |
else |
354 |
echo " The possible FORTRAN compilers found in your path are:" |
echo " The possible FORTRAN compilers found in your path are:" |
355 |
echo " "$p_FC |
echo " "$p_FC |
356 |
if test "x$FC" = x ; then |
fi |
357 |
FC=`echo $p_FC | $AWK '{print $1}'` |
|
358 |
echo " Setting FORTRAN compiler to: "$FC |
# Use the first of the compilers found in the current PATH |
359 |
fi |
# that has a correctly-named optfile |
360 |
|
if test "x$OPTFILE" = x -a "x$FC" = x ; then |
361 |
|
for i in $p_FC ; do |
362 |
|
OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$i |
363 |
|
if test -r $OPTFILE ; then |
364 |
|
echo " Setting OPTFILE to: "$OPTFILE |
365 |
|
break |
366 |
|
fi |
367 |
|
done |
368 |
fi |
fi |
369 |
|
|
370 |
if test "x$OPTFILE" = x ; then |
if test "x$OPTFILE" = x ; then |
535 |
*only* works if it is supported by the OPTFILE that |
*only* works if it is supported by the OPTFILE that |
536 |
is being used. |
is being used. |
537 |
|
|
538 |
|
-ts | --ts |
539 |
|
Produce timing information per timestep |
540 |
|
|
541 |
-mpi | --mpi |
-mpi | --mpi |
542 |
Include MPI header files and link to MPI libraries |
Include MPI header files and link to MPI libraries |
543 |
-mpi=PATH | --mpi=PATH |
-mpi=PATH | --mpi=PATH |
609 |
call tsub( string ) |
call tsub( string ) |
610 |
end |
end |
611 |
EOF |
EOF |
612 |
$FC $FFLAGS $DEFINES -c genmake_tcomp.$FS >> genmake_warnings 2>&1 |
$FC $FFLAGS -c genmake_tcomp.$FS >> genmake_warnings 2>&1 |
613 |
RETVAL=$? |
RETVAL=$? |
614 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
615 |
FC_NAMEMANGLE=$default_nm |
FC_NAMEMANGLE=$default_nm |
679 |
RET_C=$? |
RET_C=$? |
680 |
cat <<EOF > genmake_tc_2.$FS |
cat <<EOF > genmake_tc_2.$FS |
681 |
program hello |
program hello |
682 |
Real*8 wtime |
REAL*8 wtime |
683 |
external cloc |
external cloc |
684 |
call cloc(wtime) |
call cloc(wtime) |
685 |
print *," HELLO WORLD", wtime |
print *," HELLO WORLD", wtime |
686 |
end program hello |
end |
687 |
EOF |
EOF |
688 |
$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_warnings 2>&1 |
$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_warnings 2>&1 |
689 |
RET_F=$? |
RET_F=$? |
697 |
} |
} |
698 |
|
|
699 |
|
|
700 |
|
check_HAVE_SIGREG() { |
701 |
|
get_fortran_c_namemangling |
702 |
|
cat <<EOF > genmake_tc_1.c |
703 |
|
$FC_NAMEMANGLE |
704 |
|
#include <stdlib.h> |
705 |
|
#include <stdio.h> |
706 |
|
#include <signal.h> |
707 |
|
#include <errno.h> |
708 |
|
#include <ucontext.h> |
709 |
|
|
710 |
|
int * ip; |
711 |
|
|
712 |
|
static void killhandler( |
713 |
|
unsigned int sn, siginfo_t si, struct ucontext *sc ) |
714 |
|
{ |
715 |
|
*ip = *ip + 1; |
716 |
|
return; |
717 |
|
} |
718 |
|
|
719 |
|
void FC_NAMEMANGLE(sigreg) (int * aip) |
720 |
|
{ |
721 |
|
struct sigaction s; |
722 |
|
ip = aip; |
723 |
|
s.sa_flags = SA_SIGINFO; |
724 |
|
s.sa_sigaction = (void *)killhandler; |
725 |
|
if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) { |
726 |
|
printf("Sigaction returned error = %d\n", errno); |
727 |
|
exit(0); |
728 |
|
} |
729 |
|
return; |
730 |
|
} |
731 |
|
EOF |
732 |
|
make genmake_tc_1.o >> genmake_warnings 2>&1 |
733 |
|
RET_C=$? |
734 |
|
cat <<EOF > genmake_tc_2.$FS |
735 |
|
program hello |
736 |
|
integer anint |
737 |
|
common /iv/ anint |
738 |
|
external sigreg |
739 |
|
call sigreg(anint) |
740 |
|
end |
741 |
|
EOF |
742 |
|
echo >> genmake_warnings |
743 |
|
echo "running: check_HAVE_SIGREG()" >> genmake_warnings |
744 |
|
cat genmake_tc_2.$FS >> genmake_warnings |
745 |
|
COMM="$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o" |
746 |
|
echo $COMM >> genmake_warnings |
747 |
|
$COMM >> genmake_warnings 2>&1 |
748 |
|
RETVAL=$? |
749 |
|
if test "x$RETVAL" = x0 ; then |
750 |
|
HAVE_SIGREG=t |
751 |
|
DEFINES="$DEFINES -DHAVE_SIGREG" |
752 |
|
fi |
753 |
|
rm -f genmake_tc* |
754 |
|
} |
755 |
|
|
756 |
|
|
757 |
|
check_HAVE_SETRLSTK() { |
758 |
|
get_fortran_c_namemangling |
759 |
|
cat <<EOF > genmake_tc_1.c |
760 |
|
$FC_NAMEMANGLE |
761 |
|
#include <sys/time.h> |
762 |
|
#include <sys/resource.h> |
763 |
|
#include <unistd.h> |
764 |
|
void FC_NAMEMANGLE(setrlstk) () |
765 |
|
{ |
766 |
|
struct rlimit rls; |
767 |
|
rls.rlim_cur = RLIM_INFINITY; |
768 |
|
rls.rlim_max = RLIM_INFINITY; |
769 |
|
setrlimit(RLIMIT_STACK, &rls); |
770 |
|
return; |
771 |
|
} |
772 |
|
EOF |
773 |
|
make genmake_tc_1.o >> genmake_warnings 2>&1 |
774 |
|
RET_C=$? |
775 |
|
cat <<EOF > genmake_tc_2.$FS |
776 |
|
program hello |
777 |
|
external setrlstk |
778 |
|
call setrlstk() |
779 |
|
end |
780 |
|
EOF |
781 |
|
echo >> genmake_warnings |
782 |
|
echo "running: check_HAVE_SETRLSTK()" >> genmake_warnings |
783 |
|
cat genmake_tc_2.$FS >> genmake_warnings |
784 |
|
COMM="$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o" |
785 |
|
echo $COMM >> genmake_warnings |
786 |
|
$COMM >> genmake_warnings 2>&1 |
787 |
|
RETVAL=$? |
788 |
|
if test "x$RETVAL" = x0 ; then |
789 |
|
HAVE_SETRLSTK=t |
790 |
|
DEFINES="$DEFINES -DHAVE_SETRLSTK" |
791 |
|
fi |
792 |
|
rm -f genmake_tc* |
793 |
|
} |
794 |
|
|
795 |
|
|
796 |
check_HAVE_STAT() { |
check_HAVE_STAT() { |
797 |
get_fortran_c_namemangling |
get_fortran_c_namemangling |
798 |
cat <<EOF > genmake_tc_1.c |
cat <<EOF > genmake_tc_1.c |
821 |
integer nbyte |
integer nbyte |
822 |
call tfsize(nbyte) |
call tfsize(nbyte) |
823 |
print *," HELLO WORLD", nbyte |
print *," HELLO WORLD", nbyte |
824 |
end program hello |
end |
825 |
EOF |
EOF |
826 |
$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_tc.log 2>&1 |
echo >> genmake_warnings |
827 |
RET_F=$? |
echo "running: check_HAVE_STAT()" >> genmake_warnings |
828 |
test -x ./genmake_tc && ./genmake_tc >> genmake_tc.log 2>&1 |
cat genmake_tc_2.$FS >> genmake_warnings |
829 |
|
COMM="$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o" |
830 |
|
echo $COMM >> genmake_warnings |
831 |
|
$COMM >> genmake_tc.log 2>&1 |
832 |
RETVAL=$? |
RETVAL=$? |
833 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
834 |
HAVE_STAT=t |
HAVE_STAT=t |
842 |
if test ! "x$SKIP_NETCDF_CHECK" = x ; then |
if test ! "x$SKIP_NETCDF_CHECK" = x ; then |
843 |
return |
return |
844 |
fi |
fi |
845 |
echo "" > genmake_tnc.log |
echo >> genmake_warnings |
846 |
|
echo "running: check_netcdf_libs()" >> genmake_warnings |
847 |
cat <<EOF > genmake_tnc.F |
cat <<EOF > genmake_tnc.F |
848 |
program fgennc |
program fgennc |
849 |
#include "netcdf.inc" |
#include "netcdf.inc" |
861 |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
IF (iret .NE. NF_NOERR) write(*,*) NF_STRERROR(iret) |
862 |
end |
end |
863 |
EOF |
EOF |
864 |
echo "Executing:" > genmake_tnc.log |
echo "=== genmake_tnc.F ===" > genmake_tnc.log |
865 |
echo " $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS" \ |
cat genmake_tnc.F >> genmake_tnc.log |
866 |
> genmake_tnc.log |
echo "=== genmake_tnc.F ===" >> genmake_tnc.log |
867 |
RET_CPP=f |
RET_CPP=f |
868 |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
COMM="$CPP $DEFINES $INCLUDES genmake_tnc.F" |
869 |
&& RET_CPP=t |
echo "$COMM" >> genmake_tnc.log |
870 |
|
$COMM > genmake_tnc.$FS 2>/dev/null && RET_CPP=t |
871 |
if test "x$RET_CPP" = xf ; then |
if test "x$RET_CPP" = xf ; then |
872 |
echo " WARNING: CPP failed to pre-process the netcdf test." \ |
echo " WARNING: CPP failed to pre-process the netcdf test." \ |
873 |
> genmake_tnc.log |
>> genmake_tnc.log |
874 |
echo " Please check that \$INCLUDES is properly set." \ |
echo " Please check that \$INCLUDES is properly set." \ |
875 |
> genmake_tnc.log |
>> genmake_tnc.log |
876 |
fi |
fi |
877 |
echo "Executing:" > genmake_tnc.log |
echo "$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log |
878 |
echo " $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS" > genmake_tnc.log |
echo " && $LINK -o genmake_tnc.o $LIBS" >> genmake_tnc.log |
|
echo " $LINK -o genmake_tnc.o $LIBS" > genmake_tnc.log |
|
879 |
$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
880 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1 |
881 |
RET_COMPILE=$? |
RET_COMPILE=$? |
882 |
|
cat genmake_tnc.log >> genmake_warnings |
883 |
|
|
884 |
#EH3 Remove test program execution for machines that either disallow |
#EH3 Remove test program execution for machines that either disallow |
885 |
#EH3 execution or cannot support it (eg. cross-compilers) |
#EH3 execution or cannot support it (eg. cross-compilers) |
892 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
893 |
else |
else |
894 |
# try again with "-lnetcdf" added to the libs |
# try again with "-lnetcdf" added to the libs |
895 |
|
echo "try again with added '-lnetcdf'" > genmake_tnc.log |
896 |
|
echo "$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS \ " >> genmake_tnc.log |
897 |
|
echo " && $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log |
898 |
|
echo " && $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log |
899 |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
900 |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
901 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1 |
902 |
RET_COMPILE=$? |
RET_COMPILE=$? |
903 |
|
cat genmake_tnc.log >> genmake_warnings |
904 |
if test "x$RET_COMPILE" = x0 ; then |
if test "x$RET_COMPILE" = x0 ; then |
905 |
LIBS="$LIBS -lnetcdf" |
LIBS="$LIBS -lnetcdf" |
906 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
|
else |
|
|
cat genmake_tnc.log >> genmake_warnings |
|
907 |
fi |
fi |
908 |
fi |
fi |
909 |
rm -f genmake_tnc* |
rm -f genmake_tnc* |
949 |
NOOPTFLAGS= |
NOOPTFLAGS= |
950 |
MPI= |
MPI= |
951 |
MPIPATH= |
MPIPATH= |
952 |
|
TS= |
953 |
|
HAVE_TEST_L= |
954 |
|
|
955 |
# DEFINES checked by test compilation |
# DEFINES checked by test compilation or command-line |
956 |
HAVE_SYSTEM= |
HAVE_SYSTEM= |
957 |
HAVE_FDATE= |
HAVE_FDATE= |
958 |
FC_NAMEMANGLE= |
FC_NAMEMANGLE= |
959 |
HAVE_CLOC= |
HAVE_CLOC= |
960 |
|
HAVE_SETRLSTK= |
961 |
HAVE_STAT= |
HAVE_STAT= |
962 |
HAVE_NETCDF= |
HAVE_NETCDF= |
963 |
HAVE_ETIME= |
HAVE_ETIME= |
964 |
|
IGNORE_TIME= |
965 |
|
|
966 |
MODS= |
MODS= |
967 |
TOOLSDIR= |
TOOLSDIR= |
1007 |
|
|
1008 |
# The following state can be set directly by command-line switches |
# The following state can be set directly by command-line switches |
1009 |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
1010 |
gm_s2="FC CPP IEEE MPI JAM DUMPSTATE STANDARDDIRS" |
gm_s2="FC CPP IEEE TS MPI JAM DUMPSTATE STANDARDDIRS" |
1011 |
|
|
1012 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
1013 |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
1187 |
-noieee | --noieee) |
-noieee | --noieee) |
1188 |
IEEE= ;; |
IEEE= ;; |
1189 |
|
|
1190 |
|
-ts | --ts) |
1191 |
|
TS=true ;; |
1192 |
|
|
1193 |
-mpi | --mpi) |
-mpi | --mpi) |
1194 |
MPI=true ;; |
MPI=true ;; |
1195 |
-mpi=* | --mpi=*) |
-mpi=* | --mpi=*) |
1213 |
ac_prev=TAMC_EXTRA ;; |
ac_prev=TAMC_EXTRA ;; |
1214 |
-tamc_extra=* | --tamc_extra=*) |
-tamc_extra=* | --tamc_extra=*) |
1215 |
TAMC_EXTRA=$ac_optarg ;; |
TAMC_EXTRA=$ac_optarg ;; |
1216 |
|
|
1217 |
|
-ignoretime | -ignore_time | --ignoretime | --ignore_time) |
1218 |
|
IGNORE_TIME="-DIGNORE_TIME" ;; |
1219 |
|
|
1220 |
-*) |
-*) |
1221 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
1273 |
|
|
1274 |
# Find the MITgcm ${THISVER} |
# Find the MITgcm ${THISVER} |
1275 |
if test -f "${ROOTDIR}/doc/tag-index" ; then |
if test -f "${ROOTDIR}/doc/tag-index" ; then |
1276 |
THISVER=`grep checkpoint ${ROOTDIR}/doc/tag-index | head -1` |
THISVER=`grep '^checkpoint' ${ROOTDIR}/doc/tag-index | head -1` |
1277 |
fi |
fi |
1278 |
|
|
1279 |
if test "x$MAKEFILE" = x ; then |
if test "x$MAKEFILE" = x ; then |
1415 |
EOF |
EOF |
1416 |
exit 1 |
exit 1 |
1417 |
fi |
fi |
1418 |
|
test -L genmake_tlink > /dev/null 2>&1 |
1419 |
|
RETVAL=$? |
1420 |
|
if test "x$RETVAL" = x0 ; then |
1421 |
|
HAVE_TEST_L=t |
1422 |
|
fi |
1423 |
rm -f genmake_test_ln genmake_tlink |
rm -f genmake_test_ln genmake_tlink |
1424 |
|
|
1425 |
# Check for broken *.F/*.f handling and fix if possible |
# Check for broken *.F/*.f handling and fix if possible |
1430 |
DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" |
DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" |
1431 |
fi |
fi |
1432 |
|
|
1433 |
|
if test ! "x$TS" = x ; then |
1434 |
|
echo " Turning on timing per timestep" |
1435 |
|
DEFINES="$DEFINES -DTIME_PER_TIMESTEP" |
1436 |
|
fi |
1437 |
|
|
1438 |
printf "\n=== Checking system libraries ===\n" |
printf "\n=== Checking system libraries ===\n" |
1439 |
printf " Do we have the system() command using $FC... " |
printf " Do we have the system() command using $FC... " |
1440 |
cat > genmake_tcomp.$FS <<EOF |
cat > genmake_tcomp.$FS <<EOF |
1442 |
call system('echo hi') |
call system('echo hi') |
1443 |
end |
end |
1444 |
EOF |
EOF |
1445 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
$FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1446 |
RETVAL=$? |
RETVAL=$? |
1447 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1448 |
HAVE_SYSTEM=t |
HAVE_SYSTEM=t |
1457 |
printf " Do we have the fdate() command using $FC... " |
printf " Do we have the fdate() command using $FC... " |
1458 |
cat > genmake_tcomp.$FS <<EOF |
cat > genmake_tcomp.$FS <<EOF |
1459 |
program hello |
program hello |
1460 |
CHARACTER(128) string |
CHARACTER*(128) string |
1461 |
string = ' ' |
string = ' ' |
1462 |
call fdate( string ) |
call fdate( string ) |
1463 |
print *, string |
print *, string |
1464 |
end |
end |
1465 |
EOF |
EOF |
1466 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
$FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1467 |
RETVAL=$? |
RETVAL=$? |
1468 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1469 |
HAVE_FDATE=t |
HAVE_FDATE=t |
1485 |
print *, tarray |
print *, tarray |
1486 |
end |
end |
1487 |
EOF |
EOF |
1488 |
$FC $FFLAGS $DEFINES -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
$FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1 |
1489 |
RETVAL=$? |
RETVAL=$? |
1490 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1491 |
HAVE_ETIME=t |
HAVE_ETIME=t |
1506 |
fi |
fi |
1507 |
rm -f genmake_t* |
rm -f genmake_t* |
1508 |
|
|
1509 |
|
printf " Can we unlimit the stack size using $FC... " |
1510 |
|
check_HAVE_SETRLSTK |
1511 |
|
if test "x$HAVE_SETRLSTK" != x ; then |
1512 |
|
echo "yes" |
1513 |
|
else |
1514 |
|
echo "no" |
1515 |
|
fi |
1516 |
|
rm -f genmake_t* |
1517 |
|
|
1518 |
|
printf " Can we register a signal handler using $FC... " |
1519 |
|
check_HAVE_SIGREG |
1520 |
|
if test "x$HAVE_SIGREG" != x ; then |
1521 |
|
echo "yes" |
1522 |
|
else |
1523 |
|
echo "no" |
1524 |
|
fi |
1525 |
|
rm -f genmake_t* |
1526 |
|
|
1527 |
printf " Can we use stat() through C calls... " |
printf " Can we use stat() through C calls... " |
1528 |
check_HAVE_STAT |
check_HAVE_STAT |
1529 |
if test "x$HAVE_STAT" != x ; then |
if test "x$HAVE_STAT" != x ; then |
1540 |
else |
else |
1541 |
echo "no" |
echo "no" |
1542 |
fi |
fi |
1543 |
|
DEFINES="$DEFINES $IGNORE_TIME" |
1544 |
|
|
1545 |
printf "\n=== Setting defaults ===\n" |
printf "\n=== Setting defaults ===\n" |
1546 |
printf " Adding MODS directories: " |
printf " Adding MODS directories: " |
2011 |
for sf in $sfiles ; do |
for sf in $sfiles ; do |
2012 |
if test ! -r ".links.tmp/$sf" ; then |
if test ! -r ".links.tmp/$sf" ; then |
2013 |
if test -f "$d/$sf" ; then |
if test -f "$d/$sf" ; then |
2014 |
|
ignore_f=f |
2015 |
case $d/$sf in |
case $d/$sf in |
2016 |
./$PACKAGES_DOT_H) |
./$PACKAGES_DOT_H) |
2017 |
;; |
;; |
2022 |
./BUILD_INFO.h) |
./BUILD_INFO.h) |
2023 |
;; |
;; |
2024 |
*) |
*) |
2025 |
touch .links.tmp/$sf |
# For the local directory *ONLY*, |
2026 |
deplist="$deplist $sf" |
# ignore all soft-links |
2027 |
|
if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then |
2028 |
|
ignore_f=t |
2029 |
|
else |
2030 |
|
touch .links.tmp/$sf |
2031 |
|
deplist="$deplist $sf" |
2032 |
|
fi |
2033 |
;; |
;; |
2034 |
esac |
esac |
2035 |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
if test "x$ignore_f" = xf ; then |
2036 |
case $extn in |
extn=`echo $sf | $AWK -F. '{print $NF}'` |
2037 |
F) |
case $extn in |
2038 |
echo " \\" >> srclist.inc |
F) |
2039 |
printf " $sf" >> srclist.inc |
echo " \\" >> srclist.inc |
2040 |
;; |
printf " $sf" >> srclist.inc |
2041 |
F90) |
;; |
2042 |
echo " \\" >> f90srclist.inc |
F90) |
2043 |
printf " $sf" >> f90srclist.inc |
echo " \\" >> f90srclist.inc |
2044 |
;; |
printf " $sf" >> f90srclist.inc |
2045 |
c) |
;; |
2046 |
echo " \\" >> csrclist.inc |
c) |
2047 |
printf " $sf" >> csrclist.inc |
echo " \\" >> csrclist.inc |
2048 |
;; |
printf " $sf" >> csrclist.inc |
2049 |
h) |
;; |
2050 |
echo " \\" >> hlist.inc |
h) |
2051 |
printf " $sf" >> hlist.inc |
echo " \\" >> hlist.inc |
2052 |
;; |
printf " $sf" >> hlist.inc |
2053 |
flow) |
;; |
2054 |
echo " \\" >> ad_flow_files.inc |
flow) |
2055 |
printf " $sf" >> ad_flow_files.inc |
echo " \\" >> ad_flow_files.inc |
2056 |
;; |
printf " $sf" >> ad_flow_files.inc |
2057 |
esac |
;; |
2058 |
|
esac |
2059 |
|
fi |
2060 |
fi |
fi |
2061 |
fi |
fi |
2062 |
done |
done |
2187 |
cat ad_flow_files.inc >> $MAKEFILE |
cat ad_flow_files.inc >> $MAKEFILE |
2188 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
2189 |
echo 'F77FILES = $(SRCFILES:.F=.'$FS')' >> $MAKEFILE |
echo 'F77FILES = $(SRCFILES:.F=.'$FS')' >> $MAKEFILE |
2190 |
echo 'F90FILES = $(F90SRCFILES:.F=.'$FS90')' >> $MAKEFILE |
echo 'F90FILES = $(F90SRCFILES:.F90=.'$FS90')' >> $MAKEFILE |
2191 |
echo 'OBJFILES = $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE |
echo 'OBJFILES = $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE |
2192 |
echo >> $MAKEFILE |
echo >> $MAKEFILE |
2193 |
echo '.SUFFIXES:' >> $MAKEFILE |
echo '.SUFFIXES:' >> $MAKEFILE |
2207 |
\$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE) |
\$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE) |
2208 |
-rm -f makedepend.out |
-rm -f makedepend.out |
2209 |
|
|
2210 |
|
lib: libmitgcmuv.a |
2211 |
|
|
2212 |
|
libmitgcmuv.a: \$(OBJFILES) |
2213 |
|
ar rcv libmitgcmuv.a \$(OBJFILES) |
2214 |
|
|
2215 |
links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES) |
links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES) |
2216 |
|
|
2217 |
small_f: \$(F77FILES) \$(F90FILES) |
small_f: \$(F77FILES) \$(F90FILES) |