-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.in
127 lines (117 loc) · 2.45 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#
# Makefile for Calypso geoynamo platform
# Written by H. Matsui
#
SHELL = @SHELL@
#
# directories of Calypso
#
SRCDIR = @abs_top_srcdir@
INSTDIR= @prefix@
#
MHDDIR = $(SRCDIR)/src
MAKEDIR= $(SRCDIR)/work
BUILDDIR= $(SRCDIR)/bin
TESTDIR= $(SRCDIR)/tests
#
# MPI settings
#
MPICHDIR = @MPIDIR@
MPICHLIBDIR = $(MPICHDIR)/lib
MPICHBINDIR = $(MPICHDIR)/bin
MPICHINCDIR = @MPIINCDIR@
MPILIBS = @MPILIBS@
MPIRUN = mpirun
#
# compilers
#
F90_LOCAL = @FC@
MPIF90 = @MPIFC@
GMAKE = @GMAKE@
AR = @ar_bin@
RANLIB = @RANLIB@
#
# optimization flags
#
F90OPTFLAGS= @FCFLAGS@ @OPENMP_FCFLAGS@
#
# BLAS settings
#
BLAS_LIBS = @BLAS_LIBS@
#
# FFTW3 settings
#
FFTW3_CFLAGS= @FFTW3_CFLAGS@
FFTW3_LIBS= @FFTW3_LIBS@
#
# HDF5 fortran wrapper settings
#
HDF5_FFLAGS= @HDF5_FFLAGS@
HDF5_LDFLAGS= @HDF5_LDFLAGS@
HDF5_FLIBS= @HDF5_PFLIBS@
#
# --- Please do not chenge the following ---
#
MAKE_MOD_DEP= $(BUILDDIR)/make_f90depends
#
all: makemake
cd $(MAKEDIR); make
make test
$(MAKE_MOD_DEP): $(MHDDIR)/module_dependency/make_module_dependency.f90
if [ ! -d $(BUILDDIR) ]; then \
mkdir $(BUILDDIR); \
fi
$(F90_LOCAL) $< -o $@
makemake: $(MAKE_MOD_DEP)
echo "# Construct Makefile"; \
cd $(MHDDIR) ; \
$(GMAKE) \
GMAKE="$(GMAKE)" \
MAKEDIR="$(MAKEDIR)" \
BUILDDIR="$(BUILDDIR)" \
INSTDIR="$(INSTDIR)" \
MHDDIR="$(MHDDIR)" \
MPICHDIR="$(MPICHDIR)" \
MPICHLIBDIR="$(MPICHLIBDIR)" \
MPILIBS="$(MPILIBS)" \
MPICHBINDIR="$(MPICHBINDIR)" \
MPICHINCDIR="$(MPICHINCDIR)" \
BLAS_LIBS="$(BLAS_LIBS)" \
FFTW3_CFLAGS="$(FFTW3_CFLAGS)" \
FFTW3_LIBS="$(FFTW3_LIBS)" \
HDF5_FFLAGS="$(HDF5_FFLAGS)" \
HDF5_LDFLAGS="$(HDF5_LDFLAGS)" \
HDF5_FLIBS="$(HDF5_FLIBS)" \
FC_NAME_MANGLE="$(FC_NAME_MANGLE)" \
OPTFLAGS="$(OPTFLAGS)" \
F90OPTFLAGS="$(F90OPTFLAGS)" \
F90LIB="$(F90LIB)" \
MPIF90="$(MPIF90)" \
AR="$(AR)" \
RANLIB="$(RANLIB)" \
MAKE_MOD_DEP="$(MAKE_MOD_DEP)" \
makemake
test:
echo "Test!!"; \
cd $(TESTDIR) ; \
$(GMAKE) \
GMAKE="$(GMAKE)" \
BUILDDIR="$(BUILDDIR)" \
TESTDIR="$(TESTDIR)" \
MHDDIR="$(MHDDIR)" \
MPIRUN="$(MPIRUN)" \
test
install:
cd $(MAKEDIR) ; \
make install
clean:
for dir in $(MAKEDIR) $(MHDDIR) $(TESTDIR) ; do \
echo "# cleaning $${dir} directory..."; \
( cd $${dir}; \
make clean )\
done; \
rm -f mpif.h *.o *.mod *~ *.par *.diag *.a *.f90
distclean:
echo "# Back to initial package"; \
rm -fr $(MAKEDIR) $(BUILDDIR) Makefile config.log
cd $(TESTDIR) ; make distclean