forked from dftbplus/dftbplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
172 lines (135 loc) · 5.63 KB
/
Copy pathmakefile
File metadata and controls
172 lines (135 loc) · 5.63 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
#------------------------------------------------------------------------------#
# DFTB+: general package for performing fast atomistic simulations #
# Copyright (C) 2018 DFTB+ developers group #
# #
# See the LICENSE file for terms of usage and distribution. #
#------------------------------------------------------------------------------#
ROOT := $(PWD)
.PHONY: default misc all
default: dftb+ modes waveplot
misc: misc_skderivs misc_slakovalue
all: default misc
.PHONY: install install_misc install_all
install: install_dftb+ install_modes install_waveplot install_dptools
install_misc: install_misc_skderivs install_misc_slakovalue
.PHONY: test
test: test_dftb+ test_dptools
.PHONY: check
check: check_dptools
include make.config
################################################################################
# Sanity checks
################################################################################
# Check whether DEBUG level is correct
ifeq ($(filter 0 1 2,$(strip $(DEBUG))),)
$(error 'Invalid value $(DEBUG) for DEBUG (must be 0, 1 or 2)')
endif
# Check whether PROGRESS use serial compilation
ifeq ($(strip $(WITH_PROGRESS))$(strip $(WITH_MPI)),11)
$(error 'The PROGRESS library can not be used in MPI binaries')
endif
################################################################################
# Build targets
################################################################################
# You can disable automatic release determination by setting the release
# explicitely in the RELEASE file in the source root directory.
.PHONY: update_release
update_release:
mkdir -p $(BUILDDIR)
[ -r $(ROOT)/RELEASE ] && cp -a $(ROOT)/RELEASE $(BUILDDIR)/RELEASE \
|| $(ROOT)/utils/build/update_release $(BUILDDIR)/RELEASE \
|| echo "(UNKNOWN RELEASE)" > $(BUILDDIR)/RELEASE
.PHONY: dftb+ modes waveplot
dftb+ modes waveplot:
mkdir -p $(BUILDDIR)/prog/$@
$(MAKE) -C $(BUILDDIR)/prog/$@ -f $(ROOT)/prog/$@/make.build \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR)
dftb+: update_release external_xmlf90
ifeq ($(strip $(WITH_SOCKETS)),1)
dftb+: external_fsockets
endif
ifeq ($(strip $(WITH_DFTD3))$(strip $(COMPILE_DFTD3)),11)
dftb+: external_dftd3
endif
ifeq ($(strip $(WITH_MPI)),1)
dftb+: external_mpifx external_scalapackfx
endif
modes: external_xmlf90
waveplot: external_xmlf90
.PHONY: misc_skderivs misc_slakovalue
misc_skderivs misc_slakovalue:
mkdir -p $(BUILDDIR)/prog/misc/$(subst misc_,,$@)
$(MAKE) -C $(BUILDDIR)/prog/misc/$(subst misc_,,$@) \
-f $(ROOT)/prog/misc/$(subst misc_,,$@)/make.build \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR)
misc_skderivs: external_xmlf90
EXTERNAL_NAME = $(subst external_,,$@)
EXTERNALS = external_xmlf90 external_fsockets external_dftd3 external_mpifx\
external_scalapackfx
.PHONY: $(EXTERNALS)
$(EXTERNALS):
mkdir -p $(BUILDDIR)/external/$(EXTERNAL_NAME)
$(MAKE) -C $(BUILDDIR)/external/$(EXTERNAL_NAME) \
-f $(ROOT)/external/$(EXTERNAL_NAME)/make.dpbuild \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR)
################################################################################
# Test targets
################################################################################
.PHONY: test_dftb+
test_dftb+:
$(MAKE) -C $(BUILDDIR)/prog/$(subst test_,,$@) \
-f $(ROOT)/prog/$(subst test_,,$@)/make.build \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR) test
test_dftb+: dftb+
test_dptools:
mkdir -p $(BUILDDIR)/test/tools/dptools
cd $< && $(ROOT)/test/tools/dptools/runtests.sh $(PYTHONS)
################################################################################
# Install targets
################################################################################
.PHONY: install_dftb+ install_modes install_waveplot
install_dftb+ install_modes install_waveplot:
$(MAKE) -C $(BUILDDIR)/prog/$(subst install_,,$@) \
-f $(ROOT)/prog/$(subst install_,,$@)/make.build \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR) install
install_dftb+: dftb+
install_modes: modes
install_waveplot: waveplot
.PHONY: install_misc_skderivs install_misc_slakovalue
install_misc_skderivs install_misc_slakovalue:
$(MAKE) -C $(BUILDDIR)/prog/misc/$(subst install_misc_,,$@) \
-f $(ROOT)/prog/misc/$(subst install_misc_,,$@)/make.build \
ROOT=$(ROOT) BUILDROOT=$(BUILDDIR) install
PYTHON := python
.PHONY: install_dptools
install_dptools:
cd $(ROOT)/tools/dptools \
&& $(PYTHON) setup.py install --prefix $(INSTALLDIR)
################################################################################
# Check targets
################################################################################
PYLINT2 := pylint
PYLINT3 := pylint3
.PHONY: check_dptools check_dptools_py2 check_dptools_py3
check_dptools: check_dptools_py2 check_dptools_py3
check_dptools_py2:
$(PYLINT2) --rcfile utils/srccheck/pylint/pylintrc-2.ini\
tools/dptools/src/dptools/ tools/dptools/bin/*[!~]
check_dptools_py3:
$(PYLINT3) --rcfile utils/srccheck/pylint/pylintrc-3.ini\
tools/dptools/src/dptools/ tools/dptools/bin/*[!~]
################################################################################
# Various targets
################################################################################
.PHONY: distclean
distclean:
rm -rf $(BUILDDIR)
# Create a source distribution from current git check-out
# Note: check-out must contain all submodules
ARCHIVE_NAME := dftbplus
.PHONY: sourcedist
sourcedist:
rm -rf $(BUILDDIR)/_sourcedist
mkdir -p $(BUILDDIR)/_sourcedist
$(ROOT)/utils/build/make_archive.sh $(ARCHIVE_NAME) \
$(BUILDDIR)/_sourcedist