forked from wannier-developers/wannier90
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
229 lines (199 loc) · 7.55 KB
/
Makefile
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
ifndef ROOTDIR
ROOTDIR=.
endif
REALMAKEFILE=../Makefile.2
TAR := $(shell if which gnutar 1>/dev/null 2> /dev/null; then echo gnutar; else echo tar; fi )
default: wannier post
PREFIX ?= /usr
VERSION_MAJOR = 3
VERSION_MINOR = 1
VERSION_PATCH = 0
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
VERSION_SHORT = $(VERSION_MAJOR).$(VERSION_MINOR)
install: default
install -d $(DESTDIR)$(PREFIX)/bin/
for x in wannier90.x postw90.x w90chk2chk.x w90spn2spn.x ; do \
if [ -f "$$x" ]; then install -m755 "$$x" "$(DESTDIR)$(PREFIX)/bin/$$x"; fi; \
done
if [ -f "utility/w90pov/w90pov" ]; then install -m755 "utility/w90pov/w90pov" "$(DESTDIR)$(PREFIX)/bin/w90pov"; fi;
if [ -f "utility/w90vdw/w90vdw.x" ]; then install -m755 "utility/w90vdw/w90vdw.x" "$(DESTDIR)$(PREFIX)/bin/w90vdw.x"; fi;
install -d $(DESTDIR)$(PREFIX)/lib/
if [ -f "libwannier.a" ]; then install -m644 "libwannier.a" "$(DESTDIR)$(PREFIX)/lib/libwannier.a"; fi;
if [ -f "libwannier.a" ]; then $(MAKE) pkgconfig; fi;
all: wannier lib post w90chk2chk w90pov w90vdw w90spn2spn
doc: thedoc
w90chk2chk: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) w90chk2chk)
w90spn2spn: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) w90spn2spn)
wannier: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) wannier)
lib: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) libs)
dynlib: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) dynlibs)
w90pov:
(cd $(ROOTDIR)/utility/w90pov && $(MAKE) )
w90vdw:
(cd $(ROOTDIR)/utility/w90vdw && $(MAKE) )
libs: lib
PKGCONFIG_FILENAME = wannier.pc
pkgconfig:
$(file > $(PKGCONFIG_FILENAME),prefix=$(DESTDIR)$(PREFIX))
$(file >> $(PKGCONFIG_FILENAME),exec_prefix=$(DESTDIR)$(PREFIX)/bin)
$(file >> $(PKGCONFIG_FILENAME),libdir=$(DESTDIR)$(PREFIX)/lib)
$(file >> $(PKGCONFIG_FILENAME),includedir=$(DESTDIR)$(PREFIX)/include)
$(file >> $(PKGCONFIG_FILENAME),)
$(file >> $(PKGCONFIG_FILENAME),Name: wannier)
$(file >> $(PKGCONFIG_FILENAME),Description: Compute maximally-localised Wannier functions.)
$(file >> $(PKGCONFIG_FILENAME),Requires: )
$(file >> $(PKGCONFIG_FILENAME),Version: $(VERSION))
$(file >> $(PKGCONFIG_FILENAME),Libs: -L$${libdir} -lwannier)
$(file >> $(PKGCONFIG_FILENAME),Cflags: -I$${includedir})
install -D -m644 "$(PKGCONFIG_FILENAME)" "$(DESTDIR)$(PREFIX)/lib/pkgconfig/$(PKGCONFIG_FILENAME)"
cd $(ROOTDIR) && rm -f $(PKGCONFIG_FILENAME)
post: objdir
(cd $(ROOTDIR)/src/obj && $(MAKE) -f $(REALMAKEFILE) post)
clean:
cd $(ROOTDIR) && rm -f *~
cd $(ROOTDIR) && rm -f src/*~
cd $(ROOTDIR) && rm -f $(PKGCONFIG_FILENAME)
@( cd $(ROOTDIR) && if [ -d src/obj ] ; \
then cd src/obj && \
$(MAKE) -f $(REALMAKEFILE) clean && \
cd ../ && rm -rf obj ; \
fi )
cd $(ROOTDIR)/docs && rm -r site
$(MAKE) -C $(ROOTDIR)/utility/w90pov clean
$(MAKE) -C $(ROOTDIR)/utility/w90vdw clean
cd $(ROOTDIR)/test-suite && ./clean_tests
veryclean: clean
cd $(ROOTDIR) && rm -f wannier90.x postw90.x libwannier.a libwan2.a w90chk2chk.x w90spn2spn.x
cd $(ROOTDIR)/docs && rm -r site
cd $(ROOTDIR)/test-suite && ./clean_tests -i
thedoc:
@(echo "The latex user_guide and tutorials have been migrated to markdown \
format, for more details see 'docs/README.md' file.")
# For now hardcoded to 3.1.0, and using HEAD
# Better to get the version from the io.F90 file and use
# the tag (e.g. v3.1.0) instead of HEAD
dist:
cd $(ROOTDIR) && git archive HEAD --prefix=wannier90-3.1.0/ -o wannier90-3.1.0.tar.gz
dist-legacy:
@(cd $(ROOTDIR) && $(TAR) -cz --transform='s,^\./,wannier90-3.1/,' -f wannier90-3.1.tar.gz \
./src/*.?90 \
./src/postw90/*.?90 \
./autodoc/README.txt \
./autodoc/*.md \
./autodoc/media/favicon*png \
./examples/README \
./examples/example01/UNK* \
./examples/*/*.win \
./examples/example0[2-4]/*.eig \
./examples/example0[1-4]/*.*mn \
./examples/example0[5-9]/*.scf \
./examples/example1[0-3]/*.scf \
./examples/example0[5-9]/*.nscf \
./examples/example1[0-3]/*.nscf \
./examples/example0[5-9]/*.pw2wan \
./examples/example1[0-3]/*.pw2wan \
./examples/example1[4-5]/defected/*.scf \
./examples/example1[4-5]/defected/*.nscf \
./examples/example1[4-5]/defected/*.win \
./examples/example1[4-5]/defected/*.pw2wan \
./examples/example1[4-5]/periodic/*.scf \
./examples/example1[4-5]/periodic/*.nscf \
./examples/example1[4-5]/periodic/*.win \
./examples/example1[4-5]/periodic/*.pw2wan \
./examples/example16-noqe/Si.amn \
./examples/example16-noqe/Si.mmn \
./examples/example16-noqe/Si.eig \
./examples/example16-withqe/Si.scf \
./examples/example16-withqe/Si.nscf \
./examples/example16-withqe/Si.pw2wan \
./examples/example1[7-9]/*.scf \
./examples/example1[7-9]/*.nscf \
./examples/example1[7-9]/*.pw2wan \
./examples/example20/*.scf \
./examples/example20/*.nscf \
./examples/example20/*.pw2wan \
./examples/example20/SrMnO3/SrMnO3-d.pw2wan \
./examples/example20/SrMnO3/SrMnO3-d.win \
./examples/example20/SrMnO3/SrMnO3-eg.pw2wan \
./examples/example20/SrMnO3/SrMnO3-eg.win \
./examples/example20/SrMnO3/SrMnO3.nscf \
./examples/example20/SrMnO3/SrMnO3.scf \
./examples/example20/SrMnO3/SrMnO3-t2g.pw2wan \
./examples/example20/SrMnO3/SrMnO3-t2g.win \
./examples/example2[1-2]/README \
./examples/example2[1-2]/*/*.scf \
./examples/example2[1-2]/*/*.nscf \
./examples/example2[1-2]/*/*.win \
./examples/example2[1-2]/*/*.sym \
./examples/example2[1-2]/*/*.pw2wan \
./pseudo/*.UPF \
./pwscf/README \
./pwscf/v*/*.f90 \
./pwscf/v*/README \
./config/make.inc* \
./utility/*.pl \
./utility/PL_assessment/*.f90 \
./utility/PL_assessment/README \
./utility/w90vdw/w90vdw.f90 \
./utility/w90vdw/README \
./utility/w90vdw/doc/Makefile \
./utility/w90vdw/doc/w90vdw.tex \
./utility/w90vdw/examples/benzene_s_val/benzene_s_val.* \
./utility/w90vdw/examples/benzene_s_val/ref/benzene_s_val.* \
./utility/w90vdw/examples/benzene_s_cond/benzene_s_cond.* \
./utility/w90vdw/examples/benzene_s_cond/ref/benzene_s_cond.* \
./utility/w90pov/doc/*.tex \
./utility/w90pov/doc/*.pdf \
./utility/w90pov/doc/figs/*.png \
./utility/w90pov/src/*.f90 \
./utility/w90pov/src/*.c \
./utility/w90pov/examples/*/*.gz \
./utility/w90pov/examples/*/*.inp \
./utility/w90pov/examples/*/*.inc \
./utility/w90pov/examples/*/*.pov \
./utility/w90pov/examples/*/ref/*.png \
./utility/w90pov/README \
./utility/w90chk2chk/README \
./doc/*/*.tex \
./doc/*/*.eps \
./doc/*/*.fig \
./doc/wannier90.bib \
./*/Makefile \
./*/Makefile.2 \
./*/*/Makefile \
./Makefile \
./LICENSE \
./README* \
./CHANGE.log \
)
test-serial: w90chk2chk wannier post
(cd $(ROOTDIR)/test-suite && ./run_tests --category=default )
test-parallel: w90chk2chk wannier post
(cd $(ROOTDIR)/test-suite && ./run_tests --category=par --numprocs=4 )
# Alias
tests: test-serial test-parallel
dist-lite:
@(cd $(ROOTDIR) && $(TAR) -cz --transform='s,^\./,wannier90/,' -f wannier90.tar.gz \
./src/*.?90 \
./src/postw90/*.?90 \
./config/* \
./*/Makefile \
./utility/*.pl \
./*/Makefile \
./*/Makefile.2 \
./*/*/Makefile \
./Makefile \
./LICENSE \
./README.* \
./CHANGE.log \
)
objdir:
@( cd $(ROOTDIR) && if [ ! -d src/obj ] ; \
then mkdir src/obj ; \
fi ) ;
.PHONY: wannier default all doc lib libs post clean veryclean thedoc dist test-serial test-parallel dist-lite objdir objdirp tests w90spn2spn install pkgconfig