-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
317 lines (269 loc) · 9.23 KB
/
Makefile
File metadata and controls
317 lines (269 loc) · 9.23 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# Makefile for the WEST software
include ../make.inc
default:
@echo "Welcome to WEST!"
@echo
@echo "to install WEST, type at the shell prompt:"
@echo ' make conf PYT=python3 PYT_LDFLAGS="`python3-config --ldflags --embed`"'
@echo " make [-j] target"
@echo
@echo "where target identifies one or multiple packages"
@echo " wstat calculation of static dielectric response using PDEP"
@echo " wfreq calculation of dynamical dielectric response and GW self-energy"
@echo " westpp postprocessing programs"
@echo " wbse calculation of BSE"
@echo ' all same as "make wstat wfreq westpp wbse"'
@echo
@echo "where target is one of the following operations:"
@echo " doc build WEST documentation"
@echo
@echo " clean remove executables and objects"
@echo ' veryclean remove files produced by "make conf" as well'
conf: \
update_make_inc \
include_make_inc \
update_version \
depend
update_make_inc:
@[ "$(PYT)" ] || ( echo ">> PYT is not set. Ex: make conf PYT=python3"; exit 1 )
@echo "Welcome to WEST!"
@echo
@echo "version : `$(PYT) ./Pytools/read_json.py VERSION.json version`"
@echo "url : `$(PYT) ./Pytools/read_json.py VERSION.json url`"
@echo "license : `$(PYT) ./Pytools/read_json.py VERSION.json license`"
@echo " " > west_make.inc
@echo WESTDIR=`pwd` >> west_make.inc
@echo PYT=$(PYT) >> west_make.inc
@echo PYT_LDFLAGS=$(PYT_LDFLAGS) >> west_make.inc
@echo
@echo "Generated file: west_make.inc"
@cat west_make.inc
@echo
include_make_inc:
@[ -f "west_make.inc" ] || ( echo '>> Cannot find west_make.inc. Run "make conf" first.'; exit 1 )
$(eval include ./west_make.inc)
update_version:
if test -d Modules ; then \
( cd Modules ; ./update_west_version $(WESTDIR) `$(PYT) ../Pytools/read_json.py ../VERSION.json version`; ) ; fi
@echo "Generated file: west_version.f90"
@echo
depend:
if test -x west_makedeps ; then ./west_makedeps ; fi
@echo
report_build_vars:
@echo
@echo "##############"
@echo "# Build vars #"
@echo "##############"
@echo
@[ "$(MPIF90)" ] || ( echo ">> MPIF90 is not set."; exit 1 )
@[ "$(CC)" ] || ( echo ">> CC is not set."; exit 1 )
@echo "# WEST_VERSION_NUMBER : `$(PYT) ./Pytools/read_json.py VERSION.json version`"
@echo "# WESTDIR : $(WESTDIR)"
@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 "# LAPACK_LIBS : $(LAPACK_LIBS)"
@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 "# WGET : $(WGET)"
@echo "# PYT : $(PYT)"
@echo "# PYT_LDFLAGS : $(PYT_LDFLAGS)"
@echo
pytools: \
include_make_inc \
report_build_vars \
pytools_do
wstat: \
pytools \
libraries_do \
modules_do \
tools_do \
fft_kernel_do \
coulomb_kernel_do \
para_kernel_do \
hamiltonian_kernel_do \
dfpt_kernel_do \
io_kernel_do \
wstat_do
wfreq: \
pytools \
wstat \
wfreq_do
westpp: \
pytools \
wstat \
wbse \
westpp_do
wbse: \
pytools \
wstat \
wbse_do
all: \
pytools \
wstat \
wfreq \
wbse \
westpp
doc: include_make_inc
if test -d doc ; then \
( cd doc ; if test "$(MAKE)" = "" ; then make $(MFLAGS) html; \
else $(MAKE) $(MFLAGS) html ; fi ) ; fi
@echo "Open the file: $(WESTDIR)/doc/_build/html/index.html"
pytools_do:
if test -d Pytools ; then \
( cd Pytools ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
libraries_do:
if test -d Libraries ; then \
( cd Libraries ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
modules_do: update_version libraries_do
if test -d Modules ; then \
( cd Modules ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
tools_do: modules_do libraries_do
if test -d Tools ; then \
( cd Tools ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
fft_kernel_do: modules_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: tools_do modules_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: tools_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: modules_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: para_kernel_do fft_kernel_do tools_do modules_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: para_kernel_do tools_do fft_kernel_do modules_do libraries_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: io_kernel_do dfpt_kernel_do para_kernel_do coulomb_kernel_do fft_kernel_do tools_do modules_do libraries_do
if test -d Wstat ; then \
( cd Wstat ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; \
else $(MAKE) $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; fi ) ; fi
wfreq_do: io_kernel_do dfpt_kernel_do para_kernel_do coulomb_kernel_do fft_kernel_do tools_do modules_do libraries_do
if test -d Wfreq ; then \
( cd Wfreq ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; \
else $(MAKE) $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; fi ) ; fi
wbse_do: wstat_do io_kernel_do dfpt_kernel_do para_kernel_do coulomb_kernel_do fft_kernel_do tools_do modules_do libraries_do
if test -d ../LR_Modules; then \
( cd ../LR_Modules ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; \
else $(MAKE) $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; fi ) ; fi
cd ../West
if test -d Wbse ; then \
( cd Wbse ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; \
else $(MAKE) $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; fi ) ; fi
westpp_do: wbse_do io_kernel_do para_kernel_do coulomb_kernel_do fft_kernel_do tools_do modules_do libraries_do
if test -d Westpp ; then \
( cd Westpp ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; \
else $(MAKE) $(MFLAGS) all PYT_LDFLAGS="$(PYT_LDFLAGS)"; fi ) ; fi
clean: \
pytools_undo \
libraries_undo \
modules_undo \
tools_undo \
fft_kernel_undo \
coulomb_kernel_undo \
para_kernel_undo \
hamiltonian_kernel_undo \
dfpt_kernel_undo \
io_kernel_undo \
wstat_undo \
wfreq_undo \
wbse_undo \
westpp_undo
pytools_undo:
if test -d Pytools ; then \
( cd Pytools ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
libraries_undo:
if test -d Libraries ; then \
( cd Libraries ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
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
wbse_undo:
if test -d Wbse ; then \
( cd Wbse ; 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
unconf:
[ -f "west_make.inc" ] && ( rm west_make.inc )
undepend:
find . -name make.depend -delete
veryclean: clean \
unconf \
undepend