-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile.am
222 lines (168 loc) · 7.21 KB
/
Makefile.am
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
# QMCkl - Quantum Monte Carlo kernel library
#
# BSD 3-Clause License
#
# Copyright (c) 2020, TREX Center of Excellence
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ACLOCAL_AMFLAGS = -I m4
VERSION_MAJOR = @VERSION_MAJOR@
VERSION_MINOR = @VERSION_MINOR@
VERSION_PATCH = @VERSION_PATCH@
SUBDIRS =
CLEANFILES = qmckl.mod qmckl_verificarlo_f.mod qmckl_constants.mod
EXTRA_DIST =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgconfig/qmckl.pc
qmckl_h = include/qmckl.h
qmckl_f = include/qmckl_f.F90
qmckl_fo = include/qmckl_f.o
include_HEADERS = $(qmckl_h) $(qmckl_f)
test_headers = include/chbrclf.h include/n2.h
QMCKL_TEST_DIR = $(abs_srcdir)/share/qmckl/test_data/
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/include
AM_CPPFLAGS += -I$(srcdir)/src -I$(srcdir)/include -I$(QMCKL_TEST_DIR)
AM_CPPFLAGS += -DQMCKL_TEST_DIR=\"$(QMCKL_TEST_DIR)\"
lib_LTLIBRARIES = src/libqmckl.la
src_libqmckl_la_SOURCES = $(qmckl_h) $(qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
src_libqmckl_la_LDFLAGS = $(LDFLAGS)
CLEANFILES+=$(qmckl_fo) $(test_qmckl_o) $(FH_TYPE_FILES) $(FH_FUNC_FILES)
include generated.mk
htmldir = $(docdir)/html
textdir = $(docdir)/text
htmldir_loc = share/doc/qmckl/html
textdir_loc = share/doc/qmckl/text
ln_s_verbose = $(ln_s_verbose_@AM_V@)
ln_s_verbose_ = $(ln_s_verbose_@AM_DEFAULT_V@)
ln_s_verbose_0 = @echo " LN_S $<";
# Include Guix manifest in the source code distribution tarball
tools_qmckl_scm = tools/qmckl.scm
EXTRA_DIST += $(tools_qmckl_scm) $(test_headers)
# Documentation rules
if HAVE_DOC
htmlize_el = $(htmldir_loc)/htmlize.el
dist_html_DATA = $(HTML_FILES) \
$(htmldir_loc)/qmckl.css \
$(htmldir_loc)/index.html
dist_text_DATA = $(TEXT_FILES)
html-local: $(htmlize_el) $(dist_html_DATA)
text: $(htmlize_el) $(dist_text_DATA)
doc: html text
endif
setup_py = $(srcdir)/python/setup.py
process_header_py = $(srcdir)/python/src/process_header.py
test_py = $(srcdir)/python/test/test_api.py
qmckl_i = $(srcdir)/python/src/qmckl.i
numpy_i = $(srcdir)/python/src/numpy.i
qmckl_wrap_c = python/src/qmckl_wrap.c
qmckl_include_i = python/src/qmckl_include.i
qmckl_py = python/src/qmckl.py
if HAVE_PYTHON
dist_python_DATA = $(setup_py) $(qmckl_py) $(qmckl_wrap_c) \
$(srcdir)/python/pyproject.toml \
$(srcdir)/python/requirements.txt \
$(srcdir)/python/README.md
python-install: $(qmckl_h) $(lib_LTLIBRARIES) $(dist_python_DATA)
$(MKDIR_P) python/src
cd python ; \
[[ ! -f pyproject.toml ]] && \
cp $(abs_srcdir)/python/{pyproject.toml,requirements.txt,README.md,setup.py} . ; \
cp src/qmckl.py . ; \
export QMCKL_INCLUDEDIR="$(prefix)/include" ; \
export QMCKL_LIBDIR="$(prefix)/lib" ; \
python3 -m pip install .
python-test: $(test_py)
cd $(abs_srcdir)/python/test/ && \
python test_api.py
endif
.PHONY: cppcheck python-test python-install source
if QMCKL_DEVEL
if VFC_CI
AM_LDFLAGS=-lvfc_probes -lvfc_probes_f
ACLOCAL_AMFLAGS += -I tools
endif
EXTRA_DIST += $(ORG_FILES) $(TANGLED_FILES) $(EXPORTED_FILES)
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(qmckl_f) $(qmckl_h) $(htmlize_el)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(EXPORTED_FILES) $(htmlize_el)
EXTRA_DIST += \
tools/build_doc.sh \
tools/build_makefile.py \
tools/build_qmckl_f.sh \
tools/build_qmckl_h.sh \
tools/config_doc.el \
tools/config_tangle.el \
tools/init.el \
tools/install_htmlize.sh \
tools/lib.org \
tools/tangle.sh \
tools/theme.setup
## Silent
## ======
export_verbose = $(export_verbose_@AM_V@)
export_verbose_ = $(export_verbose_@AM_DEFAULT_V@)
export_verbose_0 = @echo " DOC $@";
tangle_verbose = $(tangle_verbose_@AM_V@)
tangle_verbose_ = $(tangle_verbose_@AM_DEFAULT_V@)
tangle_verbose_0 = @echo " ORG $<";
cat_h_verbose = $(cat_h_verbose_@AM_V@)
cat_h_verbose_ = $(cat_h_verbose_@AM_DEFAULT_V@)
cat_h_verbose_0 = @echo " HEADER $@";
## Rules
## =====
SUFFIXES = .F90 .h .org .c _f.F90 _func.h _type.h _private_func.h _private_type.h
$(qmckl_h): $(H_FUNC_FILES) $(H_TYPE_FILES)
$(cat_h_verbose)top_builddir=$(abs_top_builddir) srcdir=$(abs_srcdir) qmckl_h=$(qmckl_h) $(srcdir)/tools/build_qmckl_h.sh
$(qmckl_f): $(FH_FUNC_FILES) $(FH_TYPE_FILES)
echo $(FH_TYPE_FILES) $(FH_FUNC_FILES)
$(cat_h_verbose)top_builddir=$(abs_top_builddir) srcdir=$(abs_srcdir) qmckl_f=$(qmckl_f) $(srcdir)/tools/build_qmckl_f.sh
$(htmlize_el):
$(MKDIR_P) $(htmldir_loc) $(textdir_loc)
abs_srcdir=$(abs_srcdir) $(srcdir)/tools/install_htmlize.sh $(htmlize_el)
tests/chbrclf.h: $(qmckl_h)
tests/n2.h: $(qmckl_h)
cppcheck: cppcheck.out
cppcheck.out: $(qmckl_h)
cd src/ && \
cppcheck --addon=cert -q --error-exitcode=0 \
--enable=all --suppress="unusedStructMember"\
--suppress="unusedFunction" \
--suppress="missingIncludeSystem" \
--suppress="knownConditionTrueFalse" \
--language=c --std=c99 -rp --platform=unix64 \
-I$(srcdir)/include -I$(top_builddir)/include *.c *.h 2>../$@
$(qmckl_include_i): $(qmckl_h) $(process_header_py)
$(MKDIR_P) python/src
python3 $(process_header_py) $(qmckl_h)
mv qmckl_include.i $(qmckl_include_i)
$(qmckl_py): $(qmckl_i) $(qmckl_include_i)
$(srcdir)/tools/missing swig -Iinclude -Ipython/src -python -py3 -builtin -o $(qmckl_wrap_c) $(qmckl_i) || :
$(qmckl_wrap_c): $(qmckl_py)
source: $(TANGLED_FILES) $(qmckl_h) $(qmckl_f)
CLEANFILES += $(qmckl_wrap_c) \
$(qmckl_include_i) \
$(qmckl_py)
endif