Makefile 5.83 KB
Newer Older
Marco Govoni's avatar
Marco Govoni committed
1
2
# Makefile for the WEST software 

3
4
include ../make.inc

Marco Govoni's avatar
Marco Govoni committed
5
6
default: all

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
report_build_vars :
	@[ "${PYT}" ] || ( echo ">> PYT is not set. Please set Python, ex: make PYT=python3"; exit 1 )
	@[ "${MPIF90}" ] || ( echo ">> MPIF90 is not set."; exit 1 )
	@[ "${CC}" ] || ( echo ">> CC is not set."; exit 1 )
	@echo "              "
	@echo "##############"
	@echo "# Build vars #"
	@echo "##############"
	@echo "              "
	@echo "# TOPDIR : ${TOPDIR}"
	@echo "# FDFLAGS : ${FDFLAGS}"
	@echo "# IFLAGS : ${IFLAGS}"
	@echo "# MOD_FLAG : ${MOD_FLAG}"
	@echo "# MPIF90 : ${MPIF90}"
	@echo "# CC : ${CC}"
	@echo "# F77 : ${F77}"
	@echo "# CPP : ${CPP}"
	@echo "# CPPFLAGS : ${CPPFLAGS}"
	@echo "# CFLAGS : ${CFLAGS}"
	@echo "# F90FLAGS : ${F90FLAGS}"
	@echo "# FFLAGS : ${FFLAGS}"
	@echo "# FFLAGS_NOOPT : ${FFLAGS_NOOPT}"
	@echo "# LD : ${LD}"
	@echo "# LDFLAGS : ${LDFLAGS}"
	@echo "# LD_LIBS : ${LD_LIBS}"
	@echo "# BLAS_LIBS : ${BLAS_LIBS}"
	@echo "# BLAS_LIBS_SWITCH : ${BLAS_LIBS_SWITCH}"
	@echo "# LAPACK_LIBS : ${LAPACK_LIBS}"
	@echo "# LAPACK_LIBS_SWITCH : ${LAPACK_LIBS_SWITCH}"
	@echo "# SCALAPACK_LIBS : ${SCALAPACK_LIBS}"
	@echo "# FFT_LIBS : ${FFT_LIBS}"
	@echo "# MPI_LIBS : ${MPI_LIBS}"
	@echo "# MASS_LIBS : ${MASS_LIBS}"
	@echo "# AR : ${AR}"
	@echo "# ARFLAGS : ${ARFLAGS}"
	@echo "# RANLIB : ${RANLIB}"
	@echo "# FLIB_TARGETS : ${FLIB_TARGETS}"
	@echo "# LIBOBJS : ${LIBOBJS}"
	@echo "# LIBS : ${LIBS}"
	@echo "# WGET : ${WGET}"
	@echo "# PYT : ${PYT}"
	@echo " "

50
pytools: \
51
report_build_vars \
52
53
pytools_do

54
wstat: \
55
pytools_do \
Marco Govoni's avatar
Marco Govoni committed
56
57
libraries_do \
modules_do \
Marco Govoni's avatar
Marco Govoni committed
58
59
60
61
62
63
64
tools_do \
fft_kernel_do \
coulomb_kernel_do \
para_kernel_do \
hamiltonian_kernel_do \
dfpt_kernel_do \
io_kernel_do \
65
66
67
68
69
wstat_do

wfreq: \
wstat \
wfreq_do
Marco Govoni's avatar
Marco Govoni committed
70

71
72
73
74
75
76
westpp: \
wstat \
wfreq \
westpp_do

all: \
77
pytools \
78
79
80
wstat \
wfreq \
westpp 
Marco Govoni's avatar
Marco Govoni committed
81

82
83
84
85
86
pytools_do:
	if test -d Pytools ; then \
	( cd Pytools ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
87
88
89
90
91
libraries_do:
	if test -d Libraries ; then \
	( cd Libraries ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
modules_do:
	if test -d Modules ; then \
	( cd Modules ; sh update_west_version; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

tools_do:
	if test -d Tools ; then \
	( cd Tools ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

fft_kernel_do:
	if test -d FFT_kernel ; then \
	( cd FFT_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

coulomb_kernel_do:
	if test -d Coulomb_kernel ; then \
	( cd Coulomb_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

para_kernel_do:
	if test -d Para_kernel ; then \
	( cd Para_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

hamiltonian_kernel_do:
	if test -d Hamiltonian_kernel ; then \
	( cd Hamiltonian_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

dfpt_kernel_do:
	if test -d DFPT_kernel ; then \
	( cd DFPT_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

io_kernel_do:
	if test -d IO_kernel ; then \
	( cd IO_kernel ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

wstat_do:
	if test -d Wstat ; then \
	( cd Wstat ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

wfreq_do:
	if test -d Wfreq ; then \
	( cd Wfreq ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

westpp_do:
	if test -d Westpp ; then \
	( cd Westpp ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
	else $(MAKE) $(MFLAGS) all ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
147
clean: \
148
pytools_undo \
Marco Govoni's avatar
Marco Govoni committed
149
150
libraries_undo \
modules_undo \
Marco Govoni's avatar
Marco Govoni committed
151
152
153
154
155
156
157
158
159
tools_undo \
fft_kernel_undo \
coulomb_kernel_undo \
para_kernel_undo \
hamiltonian_kernel_undo \
dfpt_kernel_undo \
io_kernel_undo \
wstat_undo \
wfreq_undo \
160
westpp_undo 
Marco Govoni's avatar
Marco Govoni committed
161

162
163
164
165
166
pytools_undo:
	if test -d Pytools ; then \
	( cd Pytools ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
167
168
169
170
171
libraries_undo:
	if test -d Libraries ; then \
	( cd Libraries ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
modules_undo:
	if test -d Modules ; then \
	( cd Modules ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

tools_undo:
	if test -d Tools ; then \
	( cd Tools ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

fft_kernel_undo:
	if test -d FFT_kernel ; then \
	( cd FFT_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

coulomb_kernel_undo:
	if test -d Coulomb_kernel ; then \
	( cd Coulomb_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

para_kernel_undo:
	if test -d Para_kernel ; then \
	( cd Para_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

hamiltonian_kernel_undo:
	if test -d Hamiltonian_kernel ; then \
	( cd Hamiltonian_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

dfpt_kernel_undo:
	if test -d DFPT_kernel ; then \
	( cd DFPT_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

io_kernel_undo:
	if test -d IO_kernel ; then \
	( cd IO_kernel ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

wstat_undo:
	if test -d Wstat ; then \
	( cd Wstat ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

wfreq_undo:
	if test -d Wfreq ; then \
	( cd Wfreq ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

westpp_undo:
	if test -d Westpp ; then \
	( cd Westpp ; if test "$(MAKE)" = "" ; then make clean ; \
	else $(MAKE) clean ; fi ) ; fi

Marco Govoni's avatar
Marco Govoni committed
227
distclean: clean