Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ db2203e0

History | View | Annotate | Download (49.2 kB)

1 e8230860 Michael Hanselmann
# Ganeti makefile
2 e8230860 Michael Hanselmann
# - Indent with tabs only.
3 e8230860 Michael Hanselmann
# - Keep files sorted; one line per file.
4 e8230860 Michael Hanselmann
# - Directories in lib/ must have their own *dir variable (see hypervisor).
5 e8230860 Michael Hanselmann
# - All directories must be listed DIRS.
6 0a7bed64 Michael Hanselmann
# - Use autogen.sh to generate Makefile.in and configure script.
7 e8230860 Michael Hanselmann
8 e8230860 Michael Hanselmann
# Automake doesn't export these variables before version 1.10.
9 e8230860 Michael Hanselmann
abs_top_builddir = @abs_top_builddir@
10 e8230860 Michael Hanselmann
abs_top_srcdir = @abs_top_srcdir@
11 e8230860 Michael Hanselmann
12 08366664 Michael Hanselmann
# Helper values for calling builtin functions
13 08366664 Michael Hanselmann
empty :=
14 08366664 Michael Hanselmann
space := $(empty) $(empty)
15 08366664 Michael Hanselmann
comma := ,
16 08366664 Michael Hanselmann
17 a01dd3c6 Iustin Pop
# Use bash in order to be able to use pipefail
18 a01dd3c6 Iustin Pop
SHELL=/bin/bash
19 a01dd3c6 Iustin Pop
20 6e06b36c Iustin Pop
ACLOCAL_AMFLAGS = -I autotools
21 4f3d5b76 Michael Hanselmann
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
22 b959138f Michael Hanselmann
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
23 eed5c5df Michael Hanselmann
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
24 5d3c30df Michael Hanselmann
CHECK_HEADER = $(top_srcdir)/autotools/check-header
25 c55cc346 Iustin Pop
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
26 73d0e218 Iustin Pop
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
27 96602be4 Michael Hanselmann
CHECK_VERSION = $(top_srcdir)/autotools/check-version
28 7385c51d Michael Hanselmann
CHECK_NEWS = $(top_srcdir)/autotools/check-news
29 f6cbcc06 Michael Hanselmann
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
30 95eb4188 Michael Hanselmann
DOCPP = $(top_srcdir)/autotools/docpp
31 e8230860 Michael Hanselmann
REPLACE_VARS_SED = autotools/replace_vars.sed
32 d99d1e36 Iustin Pop
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
33 d5a2a550 Michael Hanselmann
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
34 6e3bf290 Michael Hanselmann
SHELL_ENV_INIT = autotools/shell-env-init
35 e8230860 Michael Hanselmann
36 22c5390d Iustin Pop
# Note: these are automake-specific variables, and must be named after
37 22c5390d Iustin Pop
# the directory + 'dir' suffix
38 2d48a3a2 Michael Hanselmann
clientdir = $(pkgpythondir)/client
39 e8230860 Michael Hanselmann
hypervisordir = $(pkgpythondir)/hypervisor
40 ff9efc03 Michael Hanselmann
httpdir = $(pkgpythondir)/http
41 dc101ecc Michael Hanselmann
masterddir = $(pkgpythondir)/masterd
42 12426ae1 Guido Trotter
confddir = $(pkgpythondir)/confd
43 8c229cc7 Oleksiy Mishchenko
rapidir = $(pkgpythondir)/rapi
44 899c4d2c Michael Hanselmann
serverdir = $(pkgpythondir)/server
45 9f4bb951 Michael Hanselmann
watcherdir = $(pkgpythondir)/watcher
46 bb44b1ae Michael Hanselmann
impexpddir = $(pkgpythondir)/impexpd
47 c047a981 Michael Hanselmann
utilsdir = $(pkgpythondir)/utils
48 e8230860 Michael Hanselmann
toolsdir = $(pkglibdir)/tools
49 7617fd6b Iustin Pop
iallocatorsdir = $(pkglibdir)/iallocators
50 0d2bf835 René Nussbaumer
pytoolsdir = $(pkgpythondir)/tools
51 e8230860 Michael Hanselmann
docdir = $(datadir)/doc/$(PACKAGE)
52 b8fe7ca6 Iustin Pop
myexeclibdir = $(pkglibdir)
53 e8230860 Michael Hanselmann
54 a4f12da4 Michael Hanselmann
# Delete output file if an error occurred while building it
55 a4f12da4 Michael Hanselmann
.DELETE_ON_ERROR:
56 a4f12da4 Michael Hanselmann
57 d5506465 Iustin Pop
HTOOLS_DIRS = \
58 d5506465 Iustin Pop
	htools \
59 d5506465 Iustin Pop
	htools/Ganeti \
60 358a0a8f Iustin Pop
	htools/Ganeti/Confd \
61 458a286a Iustin Pop
	htools/Ganeti/HTools \
62 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend \
63 4cbe9bda Iustin Pop
	htools/Ganeti/HTools/Program \
64 f0f3a6df Iustin Pop
	htools/Ganeti/Query \
65 e5a29b6c Iustin Pop
	htest \
66 e5a29b6c Iustin Pop
	htest/Test \
67 2733df51 Iustin Pop
	htest/Test/Ganeti \
68 aed2325f Iustin Pop
	htest/Test/Ganeti/Confd \
69 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools \
70 879d9290 Iustin Pop
	htest/Test/Ganeti/HTools/Backend \
71 aed2325f Iustin Pop
	htest/Test/Ganeti/Query
72 d5506465 Iustin Pop
73 e8230860 Michael Hanselmann
DIRS = \
74 dad26941 Iustin Pop
	$(HTOOLS_DIRS) \
75 e8230860 Michael Hanselmann
	autotools \
76 e8230860 Michael Hanselmann
	daemons \
77 e8230860 Michael Hanselmann
	devel \
78 e8230860 Michael Hanselmann
	doc \
79 e8230860 Michael Hanselmann
	doc/examples \
80 c51580b3 Guido Trotter
	doc/examples/gnt-debug \
81 dad26941 Iustin Pop
	doc/examples/hooks \
82 dad26941 Iustin Pop
	htest/data \
83 dad26941 Iustin Pop
	htest/data/rapi \
84 dad26941 Iustin Pop
	htest/shelltests \
85 e8230860 Michael Hanselmann
	lib \
86 f9897b6d Michael Hanselmann
	lib/build \
87 dad26941 Iustin Pop
	lib/client \
88 2f16ea8f Michael Hanselmann
	lib/confd \
89 ff9efc03 Michael Hanselmann
	lib/http \
90 e8230860 Michael Hanselmann
	lib/hypervisor \
91 bb44b1ae Michael Hanselmann
	lib/impexpd \
92 dc101ecc Michael Hanselmann
	lib/masterd \
93 8c229cc7 Oleksiy Mishchenko
	lib/rapi \
94 899c4d2c Michael Hanselmann
	lib/server \
95 0d2bf835 René Nussbaumer
	lib/tools \
96 c047a981 Michael Hanselmann
	lib/utils \
97 9f4bb951 Michael Hanselmann
	lib/watcher \
98 e8230860 Michael Hanselmann
	man \
99 e8230860 Michael Hanselmann
	qa \
100 e8230860 Michael Hanselmann
	test \
101 e8230860 Michael Hanselmann
	test/data \
102 1e6fab60 Agata Murawska
	test/data/ovfdata \
103 d92518d3 Agata Murawska
	test/data/ovfdata/other \
104 e8230860 Michael Hanselmann
	tools
105 e8230860 Michael Hanselmann
106 2750b299 Michael Hanselmann
BUILDTIME_DIR_AUTOCREATE = \
107 c964d962 Michael Hanselmann
	scripts \
108 22c5390d Iustin Pop
	$(APIDOC_DIR) \
109 22c5390d Iustin Pop
	$(APIDOC_HS_DIR) \
110 358a0a8f Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti \
111 358a0a8f Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti/Confd \
112 358a0a8f Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti/HTools \
113 879d9290 Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti/HTools/Backend \
114 458a286a Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
115 662de722 Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti/Query \
116 dad26941 Iustin Pop
	$(APIDOC_PY_DIR) \
117 22c5390d Iustin Pop
	$(COVERAGE_DIR) \
118 22c5390d Iustin Pop
	$(COVERAGE_HS_DIR) \
119 dad26941 Iustin Pop
	$(COVERAGE_PY_DIR) \
120 b91e9518 Iustin Pop
	.hpc
121 2750b299 Michael Hanselmann
122 2750b299 Michael Hanselmann
BUILDTIME_DIRS = \
123 2750b299 Michael Hanselmann
	$(BUILDTIME_DIR_AUTOCREATE) \
124 6b997854 Michael Hanselmann
	doc/html
125 6b997854 Michael Hanselmann
126 6b997854 Michael Hanselmann
DIRCHECK_EXCLUDE = \
127 6b997854 Michael Hanselmann
	$(BUILDTIME_DIRS) \
128 6b997854 Michael Hanselmann
	ganeti-[0-9]*.[0-9]*.[0-9]* \
129 6b997854 Michael Hanselmann
	doc/html/_*
130 6b997854 Michael Hanselmann
131 22c5390d Iustin Pop
# some helper vars
132 22c5390d Iustin Pop
COVERAGE_DIR = doc/coverage
133 22c5390d Iustin Pop
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
134 22c5390d Iustin Pop
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
135 22c5390d Iustin Pop
APIDOC_DIR = doc/api
136 22c5390d Iustin Pop
APIDOC_PY_DIR = $(APIDOC_DIR)/py
137 22c5390d Iustin Pop
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
138 22c5390d Iustin Pop
139 2ab2b9f5 Iustin Pop
MAINTAINERCLEANFILES = \
140 d17e74b4 Iustin Pop
	$(docpng) \
141 b76aac08 Michael Hanselmann
	$(maninput) \
142 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
143 84a12e40 Iustin Pop
	doc/news.rst \
144 7a03d293 Michael Hanselmann
	doc/upgrade.rst \
145 84a12e40 Iustin Pop
	vcs-version
146 2ab2b9f5 Iustin Pop
147 d17e74b4 Iustin Pop
maintainer-clean-local:
148 6b997854 Michael Hanselmann
	rm -rf $(BUILDTIME_DIRS)
149 d17e74b4 Iustin Pop
150 e8230860 Michael Hanselmann
CLEANFILES = \
151 2f16ea8f Michael Hanselmann
	$(addsuffix /*.py[co],$(DIRS)) \
152 d5506465 Iustin Pop
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
153 d5506465 Iustin Pop
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
154 2d48a3a2 Michael Hanselmann
	$(PYTHON_BOOTSTRAP) \
155 f774bd03 Michael Hanselmann
	epydoc.conf \
156 5098afd1 Iustin Pop
	$(REPLACE_VARS_SED) \
157 6e3bf290 Michael Hanselmann
	$(SHELL_ENV_INIT) \
158 f154a7a3 Michael Hanselmann
	daemons/daemon-util \
159 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner \
160 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES) \
161 f72f8622 Iustin Pop
	doc/examples/bash_completion \
162 e80aeb89 Michael Hanselmann
	doc/examples/bash_completion-debug \
163 d5a2a550 Michael Hanselmann
	lib/_generated_rpc.py \
164 2ab2b9f5 Iustin Pop
	$(man_MANS) \
165 2ab2b9f5 Iustin Pop
	$(manhtml) \
166 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
167 e5afb848 Michael Hanselmann
	tools/vcluster-setup \
168 3735787e Iustin Pop
	stamp-directories \
169 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
170 d6159933 Iustin Pop
	$(nodist_pkgpython_PYTHON) \
171 c3f67183 Iustin Pop
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
172 3096524e Iustin Pop
	$(HS_BUILT_TEST_HELPERS) \
173 b0dcdc10 Iustin Pop
	htools/ganeti-confd \
174 f0f3a6df Iustin Pop
	.hpc/*.mix htools/*.tix htest/*.tix \
175 191ff68c Iustin Pop
	doc/hs-lint.html
176 e8230860 Michael Hanselmann
177 4c3d5fb6 Iustin Pop
GENERATED_FILES = \
178 5098afd1 Iustin Pop
	$(built_base_sources) \
179 96a7481d Michael Hanselmann
	$(BUILT_PYTHON_SOURCES) \
180 96a7481d Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
181 96a7481d Michael Hanselmann
182 ada0e680 Iustin Pop
HTOOLS_GENERATED_FILES =
183 ada0e680 Iustin Pop
if WANT_HTOOLS
184 ada0e680 Iustin Pop
HTOOLS_GENERATED_FILES += $(HS_PROGS)
185 04520998 Iustin Pop
if ENABLE_CONFD
186 f8d01158 Iustin Pop
HTOOLS_GENERATED_FILES += htools/hconfd htools/ganeti-confd
187 ada0e680 Iustin Pop
endif
188 ada0e680 Iustin Pop
endif
189 ada0e680 Iustin Pop
190 96a7481d Michael Hanselmann
built_base_sources = \
191 3735787e Iustin Pop
	stamp-directories \
192 3735787e Iustin Pop
	stamp-srclinks
193 2d1f248e Michael Hanselmann
194 96a7481d Michael Hanselmann
built_python_base_sources = \
195 13aeae6a Iustin Pop
	lib/_autoconf.py \
196 96a7481d Michael Hanselmann
	lib/_vcsversion.py
197 96a7481d Michael Hanselmann
198 96a7481d Michael Hanselmann
BUILT_PYTHON_SOURCES = \
199 96a7481d Michael Hanselmann
	$(built_python_base_sources) \
200 d5a2a550 Michael Hanselmann
	lib/_generated_rpc.py
201 e8230860 Michael Hanselmann
202 5098afd1 Iustin Pop
# Generating the RPC wrappers depends on many things, so make sure
203 5098afd1 Iustin Pop
# it's built at the end of the built sources
204 96a7481d Michael Hanselmann
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
205 96a7481d Michael Hanselmann
206 656a7fdf Iustin Pop
# these are all built from the underlying %.in sources
207 656a7fdf Iustin Pop
BUILT_EXAMPLES = \
208 656a7fdf Iustin Pop
	doc/examples/ganeti-kvm-poweroff.initd \
209 656a7fdf Iustin Pop
	doc/examples/ganeti.cron \
210 656a7fdf Iustin Pop
	doc/examples/ganeti.initd \
211 aa75500a Guido Trotter
	doc/examples/ganeti-master-role.ocf \
212 17071597 Guido Trotter
	doc/examples/ganeti-node-role.ocf \
213 656a7fdf Iustin Pop
	doc/examples/gnt-config-backup \
214 656a7fdf Iustin Pop
	doc/examples/hooks/ipsec
215 656a7fdf Iustin Pop
216 08366664 Michael Hanselmann
nodist_pkgpython_PYTHON = \
217 08366664 Michael Hanselmann
	$(BUILT_PYTHON_SOURCES)
218 08366664 Michael Hanselmann
219 f9897b6d Michael Hanselmann
noinst_PYTHON = \
220 5f43f393 Michael Hanselmann
	lib/build/__init__.py \
221 dad26941 Iustin Pop
	lib/build/shell_example_lexer.py \
222 dad26941 Iustin Pop
	lib/build/sphinx_ext.py
223 f9897b6d Michael Hanselmann
224 e8230860 Michael Hanselmann
pkgpython_PYTHON = \
225 e8230860 Michael Hanselmann
	lib/__init__.py \
226 a8a76bc2 Guido Trotter
	lib/asyncnotifier.py \
227 e8230860 Michael Hanselmann
	lib/backend.py \
228 e8230860 Michael Hanselmann
	lib/bdev.py \
229 e8230860 Michael Hanselmann
	lib/bootstrap.py \
230 e8230860 Michael Hanselmann
	lib/cli.py \
231 e8230860 Michael Hanselmann
	lib/cmdlib.py \
232 cea881e5 Michael Hanselmann
	lib/compat.py \
233 e8230860 Michael Hanselmann
	lib/config.py \
234 e8230860 Michael Hanselmann
	lib/constants.py \
235 821d9e43 Michael Hanselmann
	lib/daemon.py \
236 e8230860 Michael Hanselmann
	lib/errors.py \
237 62e0e880 Iustin Pop
	lib/ht.py \
238 e8230860 Michael Hanselmann
	lib/jqueue.py \
239 8b537bb0 Michael Hanselmann
	lib/jstore.py \
240 e8230860 Michael Hanselmann
	lib/locking.py \
241 e8230860 Michael Hanselmann
	lib/luxi.py \
242 e8230860 Michael Hanselmann
	lib/mcpu.py \
243 a744b676 Manuel Franceschini
	lib/netutils.py \
244 e8230860 Michael Hanselmann
	lib/objects.py \
245 32683096 René Nussbaumer
	lib/objectutils.py \
246 e8230860 Michael Hanselmann
	lib/opcodes.py \
247 ced78a66 Agata Murawska
	lib/ovf.py \
248 3329f4de Michael Hanselmann
	lib/pathutils.py \
249 a123dc19 Michael Hanselmann
	lib/qlang.py \
250 4ca96421 Michael Hanselmann
	lib/query.py \
251 e8230860 Michael Hanselmann
	lib/rpc.py \
252 6648cb36 Michael Hanselmann
	lib/rpc_defs.py \
253 f12e1736 René Nussbaumer
	lib/runtime.py \
254 e8230860 Michael Hanselmann
	lib/serializer.py \
255 e8230860 Michael Hanselmann
	lib/ssconf.py \
256 e8230860 Michael Hanselmann
	lib/ssh.py \
257 ac2d0fe4 Michael Hanselmann
	lib/storage.py \
258 1338f2b4 Balazs Lecz
	lib/uidpool.py \
259 05e733b4 Michael Hanselmann
	lib/vcluster.py \
260 76094e37 Michael Hanselmann
	lib/workerpool.py
261 e8230860 Michael Hanselmann
262 2d48a3a2 Michael Hanselmann
client_PYTHON = \
263 c2855a12 Michael Hanselmann
	lib/client/__init__.py \
264 02266fe0 Michael Hanselmann
	lib/client/gnt_backup.py \
265 7b3e7d41 Michael Hanselmann
	lib/client/gnt_cluster.py \
266 6d50f5f9 Michael Hanselmann
	lib/client/gnt_debug.py \
267 667dbd6b Adeodato Simo
	lib/client/gnt_group.py \
268 e792102d Michael Hanselmann
	lib/client/gnt_instance.py \
269 a09b9e3d Michael Hanselmann
	lib/client/gnt_job.py \
270 37494fa4 Michael Hanselmann
	lib/client/gnt_node.py \
271 6d50f5f9 Michael Hanselmann
	lib/client/gnt_os.py
272 2d48a3a2 Michael Hanselmann
273 e8230860 Michael Hanselmann
hypervisor_PYTHON = \
274 e8230860 Michael Hanselmann
	lib/hypervisor/__init__.py \
275 e8230860 Michael Hanselmann
	lib/hypervisor/hv_base.py \
276 48297fa2 Iustin Pop
	lib/hypervisor/hv_chroot.py \
277 e8230860 Michael Hanselmann
	lib/hypervisor/hv_fake.py \
278 eb58f9b1 Guido Trotter
	lib/hypervisor/hv_kvm.py \
279 4b5e40a5 Iustin Pop
	lib/hypervisor/hv_lxc.py \
280 e8230860 Michael Hanselmann
	lib/hypervisor/hv_xen.py
281 e8230860 Michael Hanselmann
282 8c229cc7 Oleksiy Mishchenko
rapi_PYTHON = \
283 8c229cc7 Oleksiy Mishchenko
	lib/rapi/__init__.py \
284 10b207d4 Oleksiy Mishchenko
	lib/rapi/baserlib.py \
285 95ab4de9 David Knowles
	lib/rapi/client.py \
286 20b509de Michael Hanselmann
	lib/rapi/client_utils.py \
287 10b207d4 Oleksiy Mishchenko
	lib/rapi/connector.py \
288 a85f23fa Michael Hanselmann
	lib/rapi/rlib2.py \
289 a85f23fa Michael Hanselmann
	lib/rapi/testutils.py
290 8c229cc7 Oleksiy Mishchenko
291 ff9efc03 Michael Hanselmann
http_PYTHON = \
292 02cab3e7 Michael Hanselmann
	lib/http/__init__.py \
293 be500c29 Michael Hanselmann
	lib/http/auth.py \
294 02cab3e7 Michael Hanselmann
	lib/http/client.py \
295 02cab3e7 Michael Hanselmann
	lib/http/server.py
296 ff9efc03 Michael Hanselmann
297 12426ae1 Guido Trotter
confd_PYTHON = \
298 71f27d19 Guido Trotter
	lib/confd/__init__.py \
299 b0dcdc10 Iustin Pop
	lib/confd/client.py
300 8c229cc7 Oleksiy Mishchenko
301 dc101ecc Michael Hanselmann
masterd_PYTHON = \
302 033a1d00 Michael Hanselmann
	lib/masterd/__init__.py \
303 0fcd0cad René Nussbaumer
	lib/masterd/iallocator.py \
304 033a1d00 Michael Hanselmann
	lib/masterd/instance.py
305 dc101ecc Michael Hanselmann
306 bb44b1ae Michael Hanselmann
impexpd_PYTHON = \
307 bb44b1ae Michael Hanselmann
	lib/impexpd/__init__.py
308 bb44b1ae Michael Hanselmann
309 9f4bb951 Michael Hanselmann
watcher_PYTHON = \
310 9ca87fb3 Michael Hanselmann
	lib/watcher/__init__.py \
311 adf6301e Michael Hanselmann
	lib/watcher/nodemaint.py \
312 adf6301e Michael Hanselmann
	lib/watcher/state.py
313 9f4bb951 Michael Hanselmann
314 899c4d2c Michael Hanselmann
server_PYTHON = \
315 29d91329 Michael Hanselmann
	lib/server/__init__.py \
316 5119f2ec Michael Hanselmann
	lib/server/masterd.py \
317 d9c82a4e Michael Hanselmann
	lib/server/noded.py \
318 d9c82a4e Michael Hanselmann
	lib/server/rapi.py
319 899c4d2c Michael Hanselmann
320 0d2bf835 René Nussbaumer
pytools_PYTHON = \
321 0d2bf835 René Nussbaumer
	lib/tools/__init__.py \
322 d12b9f66 Michael Hanselmann
	lib/tools/ensure_dirs.py \
323 d12b9f66 Michael Hanselmann
	lib/tools/prepare_node_join.py
324 0d2bf835 René Nussbaumer
325 c047a981 Michael Hanselmann
utils_PYTHON = \
326 4fd029cf Michael Hanselmann
	lib/utils/__init__.py \
327 79d22269 Michael Hanselmann
	lib/utils/algo.py \
328 9d1b963f Michael Hanselmann
	lib/utils/filelock.py \
329 f21bb4b7 Michael Hanselmann
	lib/utils/hash.py \
330 3865ca48 Michael Hanselmann
	lib/utils/io.py \
331 1ae4c5a1 Michael Hanselmann
	lib/utils/log.py \
332 8dc76d54 Guido Trotter
	lib/utils/mlock.py \
333 17b97ab3 Michael Hanselmann
	lib/utils/nodesetup.py \
334 a4ccecf6 Michael Hanselmann
	lib/utils/process.py \
335 7fcffe27 Michael Hanselmann
	lib/utils/retry.py \
336 7831fc5f Michael Hanselmann
	lib/utils/text.py \
337 c50645c0 Michael Hanselmann
	lib/utils/wrapper.py \
338 c50645c0 Michael Hanselmann
	lib/utils/x509.py
339 c047a981 Michael Hanselmann
340 f05c99f3 Michael Hanselmann
docrst = \
341 ffa6869f Iustin Pop
	doc/admin.rst \
342 dad26941 Iustin Pop
	doc/cluster-merge.rst \
343 5c0c1eeb Iustin Pop
	doc/design-2.0.rst \
344 4f366caf Michael Hanselmann
	doc/design-2.1.rst \
345 e56bb0e8 Guido Trotter
	doc/design-2.2.rst \
346 1eb85930 Guido Trotter
	doc/design-2.3.rst \
347 78b40c5e Michael Hanselmann
	doc/design-2.4.rst \
348 d774ce92 Michael Hanselmann
	doc/design-2.5.rst \
349 40309ed7 Michael Hanselmann
	doc/design-2.6.rst \
350 97aac894 Michael Hanselmann
	doc/design-2.7.rst \
351 dad26941 Iustin Pop
	doc/design-autorepair.rst \
352 dad26941 Iustin Pop
	doc/design-bulk-create.rst \
353 dad26941 Iustin Pop
	doc/design-chained-jobs.rst \
354 ae9b5e0f Tsachy Shacham
	doc/design-cpu-pinning.rst \
355 dad26941 Iustin Pop
	doc/design-draft.rst \
356 dad26941 Iustin Pop
	doc/design-htools-2.3.rst \
357 278ddaa9 Michael Hanselmann
	doc/design-http-server.rst \
358 1375e1d9 Michael Hanselmann
	doc/design-impexp2.rst \
359 ed9fda24 Michael Hanselmann
	doc/design-lu-generated-jobs.rst \
360 d55b80b0 Guido Trotter
	doc/design-linuxha.rst \
361 4055b109 Adeodato Simo
	doc/design-multi-reloc.rst \
362 eec83a95 Apollon Oikonomopoulos
	doc/design-network.rst \
363 7742b03c Michael Hanselmann
	doc/design-node-add.rst \
364 dad26941 Iustin Pop
	doc/design-oob.rst \
365 64ea845e Michael Hanselmann
	doc/design-ovf-support.rst \
366 dad26941 Iustin Pop
	doc/design-partitioned.rst \
367 dad26941 Iustin Pop
	doc/design-query-splitting.rst \
368 dad26941 Iustin Pop
	doc/design-query2.rst \
369 2ff01d78 Michael Hanselmann
	doc/design-remote-commands.rst \
370 d85f01e7 Iustin Pop
	doc/design-resource-model.rst \
371 a997cec5 Apollon Oikonomopoulos
	doc/design-shared-storage.rst \
372 109e07c2 Guido Trotter
	doc/design-monitoring-agent.rst \
373 6b898285 Iustin Pop
	doc/design-virtual-clusters.rst \
374 dad26941 Iustin Pop
	doc/design-x509-ca.rst \
375 62947ebb Michael Hanselmann
	doc/devnotes.rst \
376 e2078d28 Iustin Pop
	doc/glossary.rst \
377 4d6443f4 Iustin Pop
	doc/hooks.rst \
378 876860a3 Iustin Pop
	doc/iallocator.rst \
379 d17e74b4 Iustin Pop
	doc/index.rst \
380 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
381 28e15341 Iustin Pop
	doc/install.rst \
382 9725b53d Michael Hanselmann
	doc/locking.rst \
383 6bf273d5 Michael Hanselmann
	doc/move-instance.rst \
384 c71a1a3d Iustin Pop
	doc/news.rst \
385 a47dc554 René Nussbaumer
	doc/ovfconverter.rst \
386 6d81475c Iustin Pop
	doc/rapi.rst \
387 b76aac08 Michael Hanselmann
	doc/security.rst \
388 35dd762d Michael Hanselmann
	doc/upgrade.rst \
389 ab171697 Michael Hanselmann
	doc/virtual-cluster.rst \
390 c71a1a3d Iustin Pop
	doc/walkthrough.rst
391 f05c99f3 Michael Hanselmann
392 0985325d Iustin Pop
HS_PROGS = htools/htools
393 22e513e7 Agata Murawska
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
394 ada0e680 Iustin Pop
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
395 d6159933 Iustin Pop
396 19e21a6c Iustin Pop
HS_ALL_PROGS = \
397 19e21a6c Iustin Pop
	$(HS_PROGS) \
398 19e21a6c Iustin Pop
	htest/hpc-htools \
399 19e21a6c Iustin Pop
	htest/test \
400 19e21a6c Iustin Pop
	htools/hconfd \
401 19e21a6c Iustin Pop
	htools/rpc-test
402 19e21a6c Iustin Pop
403 c3f67183 Iustin Pop
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
404 189b51fa Iustin Pop
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
405 3096524e Iustin Pop
406 39f0eea5 Iustin Pop
HFLAGS = \
407 39f0eea5 Iustin Pop
	-O -Wall -Werror -ihtools \
408 39f0eea5 Iustin Pop
	-fwarn-monomorphism-restriction \
409 39f0eea5 Iustin Pop
	-fwarn-tabs \
410 39f0eea5 Iustin Pop
	$(GHC_BYVERSION_FLAGS)
411 39f0eea5 Iustin Pop
412 74e60746 Iustin Pop
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
413 d6159933 Iustin Pop
HEXTRA =
414 f0f3a6df Iustin Pop
# internal extra flags (used for htest/test mainly)
415 c7ec3025 Iustin Pop
HEXTRA_INT =
416 b91e9518 Iustin Pop
# exclude options for coverage reports
417 9822b1dd Iustin Pop
HPCEXCL = --exclude Main \
418 98b33d0e Iustin Pop
	--exclude Ganeti.Constants \
419 9822b1dd Iustin Pop
	--exclude Ganeti.HTools.QC \
420 dad26941 Iustin Pop
	--exclude Ganeti.THH \
421 2997cb0a Iustin Pop
	--exclude Ganeti.Version \
422 2733df51 Iustin Pop
	--exclude Test.Ganeti.TestCommon \
423 e1ee7d5a Iustin Pop
	--exclude Test.Ganeti.TestHTools \
424 e1ee7d5a Iustin Pop
	--exclude Test.Ganeti.TestHelper \
425 b88fcdd0 Iustin Pop
	--exclude Test.Ganeti.TestImports \
426 51309138 Iustin Pop
	$(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
427 d6159933 Iustin Pop
428 c3f67183 Iustin Pop
HS_LIB_SRCS = \
429 dad26941 Iustin Pop
	htools/Ganeti/BasicTypes.hs \
430 dad26941 Iustin Pop
	htools/Ganeti/Common.hs \
431 dad26941 Iustin Pop
	htools/Ganeti/Compat.hs \
432 dad26941 Iustin Pop
	htools/Ganeti/Confd/Server.hs \
433 cdc2392b Iustin Pop
	htools/Ganeti/Confd/Types.hs \
434 dad26941 Iustin Pop
	htools/Ganeti/Confd/Utils.hs \
435 dad26941 Iustin Pop
	htools/Ganeti/Config.hs \
436 dad26941 Iustin Pop
	htools/Ganeti/Daemon.hs \
437 ef3ad027 Iustin Pop
	htools/Ganeti/Errors.hs \
438 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend/IAlloc.hs \
439 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend/Luxi.hs \
440 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend/Rapi.hs \
441 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend/Simu.hs \
442 879d9290 Iustin Pop
	htools/Ganeti/HTools/Backend/Text.hs \
443 d6159933 Iustin Pop
	htools/Ganeti/HTools/CLI.hs \
444 d6159933 Iustin Pop
	htools/Ganeti/HTools/Cluster.hs \
445 d6159933 Iustin Pop
	htools/Ganeti/HTools/Container.hs \
446 d6159933 Iustin Pop
	htools/Ganeti/HTools/ExtLoader.hs \
447 d6159933 Iustin Pop
	htools/Ganeti/HTools/Group.hs \
448 d6159933 Iustin Pop
	htools/Ganeti/HTools/Instance.hs \
449 d6159933 Iustin Pop
	htools/Ganeti/HTools/Loader.hs \
450 d6159933 Iustin Pop
	htools/Ganeti/HTools/Node.hs \
451 d6159933 Iustin Pop
	htools/Ganeti/HTools/PeerMap.hs \
452 9f13be88 Iustin Pop
	htools/Ganeti/HTools/Program.hs \
453 458a286a Iustin Pop
	htools/Ganeti/HTools/Program/Hail.hs \
454 201b6c34 Iustin Pop
	htools/Ganeti/HTools/Program/Hbal.hs \
455 22e513e7 Agata Murawska
	htools/Ganeti/HTools/Program/Hcheck.hs \
456 2922d2c5 René Nussbaumer
	htools/Ganeti/HTools/Program/Hinfo.hs \
457 7b695a0d Iustin Pop
	htools/Ganeti/HTools/Program/Hscan.hs \
458 1494a4cc Iustin Pop
	htools/Ganeti/HTools/Program/Hspace.hs \
459 dad26941 Iustin Pop
	htools/Ganeti/HTools/Types.hs \
460 21dc8694 Iustin Pop
	htools/Ganeti/Hash.hs \
461 f3baf5ef Iustin Pop
	htools/Ganeti/JSON.hs \
462 dad26941 Iustin Pop
	htools/Ganeti/Jobs.hs \
463 ba4e38e8 Iustin Pop
	htools/Ganeti/Logging.hs \
464 d6159933 Iustin Pop
	htools/Ganeti/Luxi.hs \
465 b1e81520 Iustin Pop
	htools/Ganeti/Objects.hs \
466 e9aaa3c6 Iustin Pop
	htools/Ganeti/OpCodes.hs \
467 9eeb0aa5 Michael Hanselmann
	htools/Ganeti/Path.hs \
468 046fe3f5 Iustin Pop
	htools/Ganeti/Query/Common.hs \
469 8a65c02b Iustin Pop
	htools/Ganeti/Query/Filter.hs \
470 40246fa0 Agata Murawska
	htools/Ganeti/Query/Group.hs \
471 4cab6703 Iustin Pop
	htools/Ganeti/Query/Language.hs \
472 046fe3f5 Iustin Pop
	htools/Ganeti/Query/Node.hs \
473 4cbe9bda Iustin Pop
	htools/Ganeti/Query/Query.hs \
474 4cab6703 Iustin Pop
	htools/Ganeti/Query/Server.hs \
475 046fe3f5 Iustin Pop
	htools/Ganeti/Query/Types.hs \
476 4cab6703 Iustin Pop
	htools/Ganeti/Rpc.hs \
477 7946c25d Iustin Pop
	htools/Ganeti/Runtime.hs \
478 aa3adf35 Iustin Pop
	htools/Ganeti/Ssconf.hs \
479 26d62e4c Iustin Pop
	htools/Ganeti/THH.hs \
480 26d62e4c Iustin Pop
	htools/Ganeti/Utils.hs
481 51309138 Iustin Pop
482 51309138 Iustin Pop
HS_TEST_SRCS = \
483 43b3b5c1 Michele Tartara
	htest/Test/Ganeti/Attoparsec.hs \
484 1493a93b Iustin Pop
	htest/Test/Ganeti/BasicTypes.hs \
485 51000365 Iustin Pop
	htest/Test/Ganeti/Common.hs \
486 305e174c Iustin Pop
	htest/Test/Ganeti/Confd/Utils.hs \
487 dad26941 Iustin Pop
	htest/Test/Ganeti/Daemon.hs \
488 ef3ad027 Iustin Pop
	htest/Test/Ganeti/Errors.hs \
489 879d9290 Iustin Pop
	htest/Test/Ganeti/HTools/Backend/Simu.hs \
490 879d9290 Iustin Pop
	htest/Test/Ganeti/HTools/Backend/Text.hs \
491 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/CLI.hs \
492 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Cluster.hs \
493 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Container.hs \
494 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Instance.hs \
495 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Loader.hs \
496 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Node.hs \
497 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/PeerMap.hs \
498 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/HTools/Types.hs \
499 2d87bd0a Iustin Pop
	htest/Test/Ganeti/JSON.hs \
500 2d87bd0a Iustin Pop
	htest/Test/Ganeti/Jobs.hs \
501 aed2325f Iustin Pop
	htest/Test/Ganeti/Luxi.hs \
502 2733df51 Iustin Pop
	htest/Test/Ganeti/Objects.hs \
503 aed2325f Iustin Pop
	htest/Test/Ganeti/OpCodes.hs \
504 90171729 Iustin Pop
	htest/Test/Ganeti/Query/Filter.hs \
505 aed2325f Iustin Pop
	htest/Test/Ganeti/Query/Language.hs \
506 b9bdc10e Iustin Pop
	htest/Test/Ganeti/Query/Query.hs \
507 aed2325f Iustin Pop
	htest/Test/Ganeti/Rpc.hs \
508 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/Ssconf.hs \
509 f51eacf3 Iustin Pop
	htest/Test/Ganeti/THH.hs \
510 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/TestCommon.hs \
511 e1ee7d5a Iustin Pop
	htest/Test/Ganeti/TestHTools.hs \
512 26d62e4c Iustin Pop
	htest/Test/Ganeti/TestHelper.hs \
513 26d62e4c Iustin Pop
	htest/Test/Ganeti/Utils.hs
514 e4cc4c11 Iustin Pop
515 51309138 Iustin Pop
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
516 d6159933 Iustin Pop
517 b88fcdd0 Iustin Pop
HS_BUILT_SRCS = \
518 b88fcdd0 Iustin Pop
	htest/Test/Ganeti/TestImports.hs \
519 b88fcdd0 Iustin Pop
	htools/Ganeti/Constants.hs \
520 2997cb0a Iustin Pop
	htools/Ganeti/Version.hs
521 c3f67183 Iustin Pop
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
522 d6159933 Iustin Pop
523 3735787e Iustin Pop
$(RUN_IN_TEMPDIR): | stamp-directories
524 c964d962 Michael Hanselmann
525 a2d917f3 Iustin Pop
# Note: we use here an order-only prerequisite, as the contents of
526 a2d917f3 Iustin Pop
# _autoconf.py are not actually influencing the html build output: it
527 a2d917f3 Iustin Pop
# has to exist in order for the sphinx module to be loaded
528 a2d917f3 Iustin Pop
# successfully, but we certainly don't want the docs to be rebuilt if
529 a2d917f3 Iustin Pop
# it changes
530 c964d962 Michael Hanselmann
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
531 7142485a Iustin Pop
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
532 7142485a Iustin Pop
	lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
533 08366664 Michael Hanselmann
	| $(BUILT_PYTHON_SOURCES)
534 d17e74b4 Iustin Pop
	@test -n "$(SPHINX)" || \
535 d17e74b4 Iustin Pop
	    { echo 'sphinx-build' not found during configure; exit 1; }
536 2750b299 Michael Hanselmann
	@mkdir_p@ $(dir $@)
537 e7f6524c Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
538 13de7d59 Michael Hanselmann
	    -d . \
539 d17e74b4 Iustin Pop
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
540 d17e74b4 Iustin Pop
	    -D release="$(PACKAGE_VERSION)" \
541 13de7d59 Michael Hanselmann
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
542 13de7d59 Michael Hanselmann
	rm -f doc/html/.buildinfo doc/html/objects.inv
543 13de7d59 Michael Hanselmann
	touch $@
544 13de7d59 Michael Hanselmann
545 c964d962 Michael Hanselmann
doc/html: doc/html/index.html
546 2ab2b9f5 Iustin Pop
547 cbf3d64b Michael Hanselmann
doc/install-quick.rst: INSTALL
548 b76aac08 Michael Hanselmann
doc/news.rst: NEWS
549 7a03d293 Michael Hanselmann
doc/upgrade.rst: UPGRADE
550 b76aac08 Michael Hanselmann
551 e8deef56 Michael Hanselmann
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
552 cbf3d64b Michael Hanselmann
	set -e; \
553 cbf3d64b Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
554 cbf3d64b Michael Hanselmann
	  echo '.. Do not edit.'; \
555 cbf3d64b Michael Hanselmann
	  echo; \
556 cbf3d64b Michael Hanselmann
	  cat $<; \
557 cbf3d64b Michael Hanselmann
	} > $@
558 cbf3d64b Michael Hanselmann
559 b8195800 Iustin Pop
docdot = \
560 ca9ccea8 Michael Hanselmann
	doc/arch-2.0.dot \
561 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-acquire.dot \
562 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-release.dot
563 b8195800 Iustin Pop
564 d17e74b4 Iustin Pop
docpng = $(patsubst %.dot,%.png,$(docdot))
565 e8230860 Michael Hanselmann
566 7e1ccbe0 Michael Hanselmann
# Things to build but not to install (add it to EXTRA_DIST if it should be
567 7e1ccbe0 Michael Hanselmann
# distributed)
568 7e1ccbe0 Michael Hanselmann
noinst_DATA = \
569 7e1ccbe0 Michael Hanselmann
	doc/html \
570 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES) \
571 7e1ccbe0 Michael Hanselmann
	doc/examples/bash_completion \
572 e80aeb89 Michael Hanselmann
	doc/examples/bash_completion-debug \
573 7e1ccbe0 Michael Hanselmann
	$(manhtml)
574 f29266b4 Iustin Pop
575 4f3d5b76 Michael Hanselmann
gnt_scripts = \
576 e8230860 Michael Hanselmann
	scripts/gnt-backup \
577 e8230860 Michael Hanselmann
	scripts/gnt-cluster \
578 e8230860 Michael Hanselmann
	scripts/gnt-debug \
579 667dbd6b Adeodato Simo
	scripts/gnt-group \
580 e8230860 Michael Hanselmann
	scripts/gnt-instance \
581 e8230860 Michael Hanselmann
	scripts/gnt-job \
582 e8230860 Michael Hanselmann
	scripts/gnt-node \
583 e8230860 Michael Hanselmann
	scripts/gnt-os
584 e8230860 Michael Hanselmann
585 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP_SBIN = \
586 29d91329 Michael Hanselmann
	daemons/ganeti-masterd \
587 5119f2ec Michael Hanselmann
	daemons/ganeti-noded \
588 d9c82a4e Michael Hanselmann
	daemons/ganeti-rapi \
589 dad26941 Iustin Pop
	daemons/ganeti-watcher \
590 656a7fdf Iustin Pop
	$(gnt_scripts)
591 2d48a3a2 Michael Hanselmann
592 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP = \
593 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
594 d12b9f66 Michael Hanselmann
	tools/ensure-dirs \
595 d12b9f66 Michael Hanselmann
	tools/prepare-node-join
596 0d2bf835 René Nussbaumer
597 a8c68e44 Michael Hanselmann
qa_scripts = \
598 a0c3e726 Michael Hanselmann
	qa/__init__.py \
599 a8c68e44 Michael Hanselmann
	qa/ganeti-qa.py \
600 a8c68e44 Michael Hanselmann
	qa/qa_cluster.py \
601 a8c68e44 Michael Hanselmann
	qa/qa_config.py \
602 a8c68e44 Michael Hanselmann
	qa/qa_daemon.py \
603 a8c68e44 Michael Hanselmann
	qa/qa_env.py \
604 a8c68e44 Michael Hanselmann
	qa/qa_error.py \
605 21bf2e2e Andrea Spadaccini
	qa/qa_group.py \
606 a8c68e44 Michael Hanselmann
	qa/qa_instance.py \
607 09470dd8 Michael Hanselmann
	qa/qa_job.py \
608 a8c68e44 Michael Hanselmann
	qa/qa_node.py \
609 a8c68e44 Michael Hanselmann
	qa/qa_os.py \
610 a8c68e44 Michael Hanselmann
	qa/qa_rapi.py \
611 a8c68e44 Michael Hanselmann
	qa/qa_tags.py \
612 a8c68e44 Michael Hanselmann
	qa/qa_utils.py
613 a8c68e44 Michael Hanselmann
614 d6159933 Iustin Pop
bin_SCRIPTS =
615 d6159933 Iustin Pop
if WANT_HTOOLS
616 c3f67183 Iustin Pop
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
617 458a286a Iustin Pop
install-exec-hook:
618 458a286a Iustin Pop
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
619 7fa52acd Iustin Pop
# FIXME: this is a hardcoded logic, instead of auto-resolving
620 7fa52acd Iustin Pop
	$(LN_S) -f ../../../bin/htools \
621 458a286a Iustin Pop
		   $(DESTDIR)$(iallocatorsdir)/hail
622 201b6c34 Iustin Pop
	for role in $(HS_BIN_ROLES); do \
623 7fa52acd Iustin Pop
		$(LN_S) -f htools \
624 201b6c34 Iustin Pop
			   $(DESTDIR)$(bindir)/$$role ; \
625 201b6c34 Iustin Pop
	done
626 d6159933 Iustin Pop
endif
627 d6159933 Iustin Pop
628 51309138 Iustin Pop
$(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
629 21a5e56c Iustin Pop
	@if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
630 21a5e56c Iustin Pop
	  echo "Error: cannot run unittests without the development" \
631 21a5e56c Iustin Pop
	       " libraries (see devnotes.rst)" 1>&2; \
632 fd0bc853 Iustin Pop
	  exit 1; \
633 49e11c49 Iustin Pop
	fi
634 f0f3a6df Iustin Pop
	@rm -f $(notdir $@).tix
635 f0f3a6df Iustin Pop
	$(GHC) --make \
636 ef958f2a Iustin Pop
	  $(HFLAGS) \
637 21a5e56c Iustin Pop
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
638 f0f3a6df Iustin Pop
	  -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
639 c7ec3025 Iustin Pop
	  $(HEXTRA) $(HEXTRA_INT) $@
640 70b6c284 Iustin Pop
	@touch "$@"
641 70b6c284 Iustin Pop
642 f0f3a6df Iustin Pop
# for the htest/test binary, we need to enable profiling/coverage
643 f0f3a6df Iustin Pop
htest/test: HEXTRA_INT=-fhpc -ihtest
644 b91e9518 Iustin Pop
645 896b2850 Iustin Pop
# we compile the hpc-htools binary with the program coverage
646 f0f3a6df Iustin Pop
htest/hpc-htools: HEXTRA_INT=-fhpc
647 25cdf177 Iustin Pop
648 04d15e63 Iustin Pop
# test dependency
649 f0f3a6df Iustin Pop
htest/offline-tests.sh: htest/hpc-htools
650 04d15e63 Iustin Pop
651 c7ec3025 Iustin Pop
# rules for building profiling-enabled versions of the haskell
652 c7ec3025 Iustin Pop
# programs: hs-prof does the full two-step build, whereas
653 c7ec3025 Iustin Pop
# hs-prof-quick does only the final rebuild (hs-prof must have been
654 c7ec3025 Iustin Pop
# run before)
655 c7ec3025 Iustin Pop
.PHONY: hs-prof hs-prof-quick
656 c7ec3025 Iustin Pop
hs-prof:
657 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) clean
658 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
659 c7ec3025 Iustin Pop
	rm -f $(HS_ALL_PROGS)
660 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
661 c7ec3025 Iustin Pop
662 c7ec3025 Iustin Pop
hs-prof-quick:
663 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
664 c7ec3025 Iustin Pop
665 da7e44ee Michael Hanselmann
dist_sbin_SCRIPTS = \
666 da7e44ee Michael Hanselmann
	tools/ganeti-listrunner
667 4f3d5b76 Michael Hanselmann
668 fc3fd894 Michael Hanselmann
nodist_sbin_SCRIPTS = \
669 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
670 46118ed2 Iustin Pop
	daemons/ganeti-cleaner
671 fc3fd894 Michael Hanselmann
672 04520998 Iustin Pop
if ENABLE_CONFD
673 b0dcdc10 Iustin Pop
htools/ganeti-confd: htools/hconfd
674 b0dcdc10 Iustin Pop
	cp -f $< $@
675 b0dcdc10 Iustin Pop
676 b0dcdc10 Iustin Pop
nodist_sbin_SCRIPTS += htools/ganeti-confd
677 73b0fa69 Iustin Pop
endif
678 73b0fa69 Iustin Pop
679 cc120286 Bernardo Dal Seno
python_scripts = \
680 e8230860 Michael Hanselmann
	tools/burnin \
681 e8230860 Michael Hanselmann
	tools/cfgshell \
682 e8230860 Michael Hanselmann
	tools/cfgupgrade \
683 b5672ea0 Iustin Pop
	tools/cfgupgrade12 \
684 1f7d3f7d René Nussbaumer
	tools/cluster-merge \
685 4ef0399b Iustin Pop
	tools/confd-client \
686 d62cbd3a Michael Hanselmann
	tools/fmtjson \
687 ea5fd476 Iustin Pop
	tools/lvmstrap \
688 6bf273d5 Michael Hanselmann
	tools/move-instance \
689 ced78a66 Agata Murawska
	tools/ovfconverter \
690 8a670753 Michael Hanselmann
	tools/sanitize-config
691 e8230860 Michael Hanselmann
692 61631293 Stephen Shirley
dist_tools_SCRIPTS = \
693 cc120286 Bernardo Dal Seno
	$(python_scripts) \
694 2f4c951e Stephen Shirley
	tools/kvm-console-wrapper \
695 dad26941 Iustin Pop
	tools/master-ip-setup \
696 b9612abb Iustin Pop
	tools/xen-console-wrapper
697 61631293 Stephen Shirley
698 29386d3e Michael Hanselmann
nodist_tools_SCRIPTS = \
699 29386d3e Michael Hanselmann
	tools/vcluster-setup
700 29386d3e Michael Hanselmann
701 2d76b580 Michael Hanselmann
pkglib_python_scripts = \
702 c6ccba7e Michael Hanselmann
	daemons/import-export \
703 c6ccba7e Michael Hanselmann
	tools/check-cert-expired
704 2d76b580 Michael Hanselmann
705 0d2bf835 René Nussbaumer
nodist_pkglib_python_scripts = \
706 d12b9f66 Michael Hanselmann
	tools/ensure-dirs \
707 d12b9f66 Michael Hanselmann
	tools/prepare-node-join
708 0d2bf835 René Nussbaumer
709 b8fe7ca6 Iustin Pop
myexeclib_SCRIPTS = \
710 2d76b580 Michael Hanselmann
	daemons/daemon-util \
711 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
712 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts)
713 f154a7a3 Michael Hanselmann
714 b8fe7ca6 Iustin Pop
nodist_myexeclib_SCRIPTS = \
715 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts)
716 0d2bf835 René Nussbaumer
717 e8230860 Michael Hanselmann
EXTRA_DIST = \
718 e8230860 Michael Hanselmann
	NEWS \
719 7a03d293 Michael Hanselmann
	UPGRADE \
720 f774bd03 Michael Hanselmann
	epydoc.conf.in \
721 70c771f6 Michael Hanselmann
	pylintrc \
722 bb46a96c Michael Hanselmann
	autotools/build-bash-completion \
723 d5a2a550 Michael Hanselmann
	autotools/build-rpc \
724 5d3c30df Michael Hanselmann
	autotools/check-header \
725 f6cbcc06 Michael Hanselmann
	autotools/check-imports \
726 c55cc346 Iustin Pop
	autotools/check-man-dashes \
727 73d0e218 Iustin Pop
	autotools/check-man-warnings \
728 c81ed2b2 Michael Hanselmann
	autotools/check-news \
729 dad26941 Iustin Pop
	autotools/check-python-code \
730 e627fe09 Michael Hanselmann
	autotools/check-tar \
731 96602be4 Michael Hanselmann
	autotools/check-version \
732 d99d1e36 Iustin Pop
	autotools/convert-constants \
733 95eb4188 Michael Hanselmann
	autotools/docpp \
734 27e336af Michael Hanselmann
	autotools/gen-coverage \
735 df69e0a0 Bernardo Dal Seno
	autotools/testrunner \
736 387863a5 Iustin Pop
	autotools/wrong-hardcoded-paths \
737 f3313af5 Guido Trotter
	$(RUN_IN_TEMPDIR) \
738 f154a7a3 Michael Hanselmann
	daemons/daemon-util.in \
739 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner.in \
740 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
741 f9435bdc Iustin Pop
	devel/upload \
742 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup.in \
743 29386d3e Michael Hanselmann
	tools/vcluster-setup.in \
744 b8195800 Iustin Pop
	$(docdot) \
745 f727d134 Michael Hanselmann
	$(docpng) \
746 d17e74b4 Iustin Pop
	$(docrst) \
747 d17e74b4 Iustin Pop
	doc/conf.py \
748 d17e74b4 Iustin Pop
	doc/html \
749 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES:%=%.in) \
750 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default \
751 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default-debug \
752 d6d9ce45 Guido Trotter
	doc/examples/hooks/ethers \
753 89c04c2d Guido Trotter
	doc/examples/gnt-debug/README \
754 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay0.json \
755 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay50.json \
756 e4d452b4 Michael Hanselmann
	test/lockperf.py \
757 e8230860 Michael Hanselmann
	test/testutils.py \
758 e8230860 Michael Hanselmann
	test/mocks.py \
759 e8230860 Michael Hanselmann
	$(dist_TESTS) \
760 e8230860 Michael Hanselmann
	$(TEST_FILES) \
761 6be8e2bf Iustin Pop
	man/footer.rst \
762 6be8e2bf Iustin Pop
	$(manrst) \
763 f727d134 Michael Hanselmann
	$(maninput) \
764 39e0d19e Michael Hanselmann
	qa/qa-sample.json \
765 d6159933 Iustin Pop
	$(qa_scripts) \
766 51309138 Iustin Pop
	$(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
767 5a1e31b4 Iustin Pop
	$(HS_PROG_SRCS) \
768 04d15e63 Iustin Pop
	htools/lint-hints.hs \
769 f0f3a6df Iustin Pop
	htest/cli-tests-defs.sh \
770 7a07475f Iustin Pop
	htest/offline-test.sh \
771 7a07475f Iustin Pop
	.ghci
772 e8230860 Michael Hanselmann
773 e8230860 Michael Hanselmann
man_MANS = \
774 bae7e531 Michael Hanselmann
	man/ganeti-cleaner.8 \
775 b7b7cda6 Guido Trotter
	man/ganeti-confd.8 \
776 da7e44ee Michael Hanselmann
	man/ganeti-listrunner.8 \
777 320d986d Iustin Pop
	man/ganeti-masterd.8 \
778 e8230860 Michael Hanselmann
	man/ganeti-noded.8 \
779 e8230860 Michael Hanselmann
	man/ganeti-os-interface.7 \
780 320d986d Iustin Pop
	man/ganeti-rapi.8 \
781 e8230860 Michael Hanselmann
	man/ganeti-watcher.8 \
782 dad26941 Iustin Pop
	man/ganeti.7 \
783 e8230860 Michael Hanselmann
	man/gnt-backup.8 \
784 e8230860 Michael Hanselmann
	man/gnt-cluster.8 \
785 d3b4cf9f Iustin Pop
	man/gnt-debug.8 \
786 667dbd6b Adeodato Simo
	man/gnt-group.8 \
787 e8230860 Michael Hanselmann
	man/gnt-instance.8 \
788 d3b4cf9f Iustin Pop
	man/gnt-job.8 \
789 e8230860 Michael Hanselmann
	man/gnt-node.8 \
790 5a19bd35 Iustin Pop
	man/gnt-os.8 \
791 5a19bd35 Iustin Pop
	man/hail.1 \
792 5a19bd35 Iustin Pop
	man/hbal.1 \
793 f18e4168 Iustin Pop
	man/hcheck.1 \
794 e2bdaf25 René Nussbaumer
	man/hinfo.1 \
795 5a19bd35 Iustin Pop
	man/hscan.1 \
796 d26d808a Iustin Pop
	man/hspace.1 \
797 d26d808a Iustin Pop
	man/htools.1
798 e8230860 Michael Hanselmann
799 5a19bd35 Iustin Pop
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
800 6be8e2bf Iustin Pop
manhtml = $(patsubst %.rst,%.html,$(manrst))
801 fcdb582d Michael Hanselmann
mangen = $(patsubst %.rst,%.gen,$(manrst))
802 25c92bc5 Michael Hanselmann
maninput = \
803 5a19bd35 Iustin Pop
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
804 de8eea3e Iustin Pop
	$(patsubst %.html,%.html.in,$(manhtml)) \
805 fcdb582d Michael Hanselmann
	man/footer.man man/footer.html $(mangen)
806 e8230860 Michael Hanselmann
807 e8230860 Michael Hanselmann
TEST_FILES = \
808 dad26941 Iustin Pop
	htest/data/common-suffix.data \
809 dad26941 Iustin Pop
	htest/data/hail-alloc-drbd.json \
810 dad26941 Iustin Pop
	htest/data/hail-change-group.json \
811 dad26941 Iustin Pop
	htest/data/hail-invalid-reloc.json \
812 dad26941 Iustin Pop
	htest/data/hail-node-evac.json \
813 dad26941 Iustin Pop
	htest/data/hail-reloc-drbd.json \
814 659d769d Dato Simó
	htest/data/hbal-excl-tags.data \
815 dad26941 Iustin Pop
	htest/data/hbal-split-insts.data \
816 dad26941 Iustin Pop
	htest/data/invalid-node.data \
817 dad26941 Iustin Pop
	htest/data/missing-resources.data \
818 dad26941 Iustin Pop
	htest/data/rapi/groups.json \
819 dad26941 Iustin Pop
	htest/data/rapi/info.json \
820 dad26941 Iustin Pop
	htest/data/rapi/instances.json \
821 dad26941 Iustin Pop
	htest/data/rapi/nodes.json \
822 dad26941 Iustin Pop
	htest/shelltests/htools-balancing.test \
823 dad26941 Iustin Pop
	htest/shelltests/htools-basic.test \
824 dad26941 Iustin Pop
	htest/shelltests/htools-dynutil.test \
825 dad26941 Iustin Pop
	htest/shelltests/htools-excl.test \
826 dad26941 Iustin Pop
	htest/shelltests/htools-hail.test \
827 dad26941 Iustin Pop
	htest/shelltests/htools-hspace.test \
828 dad26941 Iustin Pop
	htest/shelltests/htools-invalid.test \
829 dad26941 Iustin Pop
	htest/shelltests/htools-multi-group.test \
830 dad26941 Iustin Pop
	htest/shelltests/htools-no-backend.test \
831 dad26941 Iustin Pop
	htest/shelltests/htools-rapi.test \
832 dad26941 Iustin Pop
	htest/shelltests/htools-single-group.test \
833 dad26941 Iustin Pop
	htest/shelltests/htools-text-backend.test \
834 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.0.txt \
835 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.3.txt \
836 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-disk.txt \
837 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip4.txt \
838 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip6.txt \
839 27e46076 Michael Hanselmann
	test/data/cert1.pem \
840 d12b9f66 Michael Hanselmann
	test/data/cert2.pem \
841 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-dummy0.txt \
842 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-ipv4.txt \
843 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-ipv6.txt \
844 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
845 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
846 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline.txt \
847 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo.txt \
848 585c8187 Guido Trotter
	test/data/kvm_0.12.5_help.txt \
849 dad26941 Iustin Pop
	test/data/kvm_0.15.90_help.txt \
850 585c8187 Guido Trotter
	test/data/kvm_0.9.1_help.txt \
851 dad26941 Iustin Pop
	test/data/kvm_1.0_help.txt \
852 1e6fab60 Agata Murawska
	test/data/ovfdata/compr_disk.vmdk.gz \
853 d92518d3 Agata Murawska
	test/data/ovfdata/config.ini \
854 1e6fab60 Agata Murawska
	test/data/ovfdata/corrupted_resources.ovf \
855 d92518d3 Agata Murawska
	test/data/ovfdata/empty.ini \
856 1e6fab60 Agata Murawska
	test/data/ovfdata/empty.ovf \
857 1e6fab60 Agata Murawska
	test/data/ovfdata/ganeti.mf \
858 1e6fab60 Agata Murawska
	test/data/ovfdata/ganeti.ovf \
859 1e6fab60 Agata Murawska
	test/data/ovfdata/gzip_disk.ovf \
860 1e6fab60 Agata Murawska
	test/data/ovfdata/new_disk.vmdk \
861 d92518d3 Agata Murawska
	test/data/ovfdata/no_disk.ini \
862 1e6fab60 Agata Murawska
	test/data/ovfdata/no_disk_in_ref.ovf \
863 d92518d3 Agata Murawska
	test/data/ovfdata/no_os.ini \
864 1e6fab60 Agata Murawska
	test/data/ovfdata/no_ovf.ova \
865 dad26941 Iustin Pop
	test/data/ovfdata/other/rawdisk.raw \
866 1e6fab60 Agata Murawska
	test/data/ovfdata/ova.ova \
867 d92518d3 Agata Murawska
	test/data/ovfdata/rawdisk.raw \
868 dad26941 Iustin Pop
	test/data/ovfdata/second_disk.vmdk \
869 d92518d3 Agata Murawska
	test/data/ovfdata/unsafe_path.ini \
870 1e6fab60 Agata Murawska
	test/data/ovfdata/virtualbox.ovf \
871 d92518d3 Agata Murawska
	test/data/ovfdata/wrong_config.ini \
872 dad26941 Iustin Pop
	test/data/ovfdata/wrong_extension.ovd \
873 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_manifest.mf \
874 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_manifest.ovf \
875 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_ova.ova \
876 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_xml.ovf \
877 dad26941 Iustin Pop
	test/data/proc_drbd8.txt \
878 dad26941 Iustin Pop
	test/data/proc_drbd80-emptyline.txt \
879 dad26941 Iustin Pop
	test/data/proc_drbd83.txt \
880 dad26941 Iustin Pop
	test/data/proc_drbd83_sync.txt \
881 dad26941 Iustin Pop
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
882 dad26941 Iustin Pop
	test/data/sys_drbd_usermode_helper.txt \
883 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.02.txt \
884 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
885 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
886 1a1e7ab3 Iustin Pop
	test/data/vgs-missing-pvs-2.02.02.txt \
887 1a1e7ab3 Iustin Pop
	test/data/vgs-missing-pvs-2.02.66.txt \
888 30f2802f Iustin Pop
	test/ganeti-cli.test \
889 dad26941 Iustin Pop
	test/gnt-cli.test \
890 dad26941 Iustin Pop
	test/import-export_unittest-helper
891 e8230860 Michael Hanselmann
892 e8c8cf1a Michael Hanselmann
python_tests = \
893 3ade0e0e Michael Hanselmann
	doc/examples/rapi_testutils.py \
894 dad26941 Iustin Pop
	test/cfgupgrade_unittest.py \
895 dad26941 Iustin Pop
	test/docs_unittest.py \
896 17496050 Guido Trotter
	test/ganeti.asyncnotifier_unittest.py \
897 1a2eb2dc Michael Hanselmann
	test/ganeti.backend_unittest-runasroot.py \
898 f942a838 Michael Hanselmann
	test/ganeti.backend_unittest.py \
899 6de7c41d Iustin Pop
	test/ganeti.bdev_unittest.py \
900 6de7c41d Iustin Pop
	test/ganeti.cli_unittest.py \
901 66d1f035 René Nussbaumer
	test/ganeti.client.gnt_cluster_unittest.py \
902 25ce3ec4 Michael Hanselmann
	test/ganeti.client.gnt_instance_unittest.py \
903 e1c701e7 Michael Hanselmann
	test/ganeti.client.gnt_job_unittest.py \
904 6de7c41d Iustin Pop
	test/ganeti.cmdlib_unittest.py \
905 cea881e5 Michael Hanselmann
	test/ganeti.compat_unittest.py \
906 edf7d66e Iustin Pop
	test/ganeti.confd.client_unittest.py \
907 e8230860 Michael Hanselmann
	test/ganeti.config_unittest.py \
908 6de7c41d Iustin Pop
	test/ganeti.constants_unittest.py \
909 dad26941 Iustin Pop
	test/ganeti.daemon_unittest.py \
910 3bd19c66 Michael Hanselmann
	test/ganeti.errors_unittest.py \
911 e8230860 Michael Hanselmann
	test/ganeti.hooks_unittest.py \
912 ecdf0398 Michael Hanselmann
	test/ganeti.ht_unittest.py \
913 6de7c41d Iustin Pop
	test/ganeti.http_unittest.py \
914 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_chroot_unittest.py \
915 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_fake_unittest.py \
916 748e4b5a Michael Hanselmann
	test/ganeti.hypervisor.hv_kvm_unittest.py \
917 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_lxc_unittest.py \
918 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_xen_unittest.py \
919 dad26941 Iustin Pop
	test/ganeti.hypervisor_unittest.py \
920 bb44b1ae Michael Hanselmann
	test/ganeti.impexpd_unittest.py \
921 989a8bee Michael Hanselmann
	test/ganeti.jqueue_unittest.py \
922 6f1aa78d Michael Hanselmann
	test/ganeti.jstore_unittest.py \
923 e8230860 Michael Hanselmann
	test/ganeti.locking_unittest.py \
924 231db3a5 Michael Hanselmann
	test/ganeti.luxi_unittest.py \
925 33b4fa9f René Nussbaumer
	test/ganeti.masterd.iallocator_unittest.py \
926 033a1d00 Michael Hanselmann
	test/ganeti.masterd.instance_unittest.py \
927 407339d0 Michael Hanselmann
	test/ganeti.mcpu_unittest.py \
928 a744b676 Manuel Franceschini
	test/ganeti.netutils_unittest.py \
929 4c14965f Guido Trotter
	test/ganeti.objects_unittest.py \
930 32683096 René Nussbaumer
	test/ganeti.objectutils_unittest.py \
931 c32b908e Michael Hanselmann
	test/ganeti.opcodes_unittest.py \
932 1e6fab60 Agata Murawska
	test/ganeti.ovf_unittest.py \
933 a123dc19 Michael Hanselmann
	test/ganeti.qlang_unittest.py \
934 4ca96421 Michael Hanselmann
	test/ganeti.query_unittest.py \
935 cfaeaaf7 Michael Hanselmann
	test/ganeti.rapi.baserlib_unittest.py \
936 95ab4de9 David Knowles
	test/ganeti.rapi.client_unittest.py \
937 4cbd4462 Oleksiy Mishchenko
	test/ganeti.rapi.resources_unittest.py \
938 6395cebb Michael Hanselmann
	test/ganeti.rapi.rlib2_unittest.py \
939 a85f23fa Michael Hanselmann
	test/ganeti.rapi.testutils_unittest.py \
940 33231500 Michael Hanselmann
	test/ganeti.rpc_unittest.py \
941 f12e1736 René Nussbaumer
	test/ganeti.runtime_unittest.py \
942 6de7c41d Iustin Pop
	test/ganeti.serializer_unittest.py \
943 105f0d47 Michael Hanselmann
	test/ganeti.server.rapi_unittest.py \
944 6de7c41d Iustin Pop
	test/ganeti.ssh_unittest.py \
945 048eeb2b Iustin Pop
	test/ganeti.storage_unittest.py \
946 0d2bf835 René Nussbaumer
	test/ganeti.tools.ensure_dirs_unittest.py \
947 d12b9f66 Michael Hanselmann
	test/ganeti.tools.prepare_node_join_unittest.py \
948 93be53da Balazs Lecz
	test/ganeti.uidpool_unittest.py \
949 4fd029cf Michael Hanselmann
	test/ganeti.utils.algo_unittest.py \
950 9d1b963f Michael Hanselmann
	test/ganeti.utils.filelock_unittest.py \
951 f21bb4b7 Michael Hanselmann
	test/ganeti.utils.hash_unittest.py \
952 7ebadeb3 Bernardo Dal Seno
	test/ganeti.utils.io_unittest-runasroot.py \
953 dad26941 Iustin Pop
	test/ganeti.utils.io_unittest.py \
954 b6fa9a44 Michael Hanselmann
	test/ganeti.utils.log_unittest.py \
955 8dc76d54 Guido Trotter
	test/ganeti.utils.mlock_unittest.py \
956 17b97ab3 Michael Hanselmann
	test/ganeti.utils.nodesetup_unittest.py \
957 a4ccecf6 Michael Hanselmann
	test/ganeti.utils.process_unittest.py \
958 79d22269 Michael Hanselmann
	test/ganeti.utils.retry_unittest.py \
959 7fcffe27 Michael Hanselmann
	test/ganeti.utils.text_unittest.py \
960 7831fc5f Michael Hanselmann
	test/ganeti.utils.wrapper_unittest.py \
961 c50645c0 Michael Hanselmann
	test/ganeti.utils.x509_unittest.py \
962 4fd029cf Michael Hanselmann
	test/ganeti.utils_unittest.py \
963 05e733b4 Michael Hanselmann
	test/ganeti.vcluster_unittest.py \
964 3f991867 Michael Hanselmann
	test/ganeti.workerpool_unittest.py \
965 4fd2660d Michael Hanselmann
	test/pycurl_reset_unittest.py \
966 dad26941 Iustin Pop
	test/qa.qa_config_unittest.py \
967 055f822b Michael Hanselmann
	test/tempfile_fork_unittest.py
968 e8230860 Michael Hanselmann
969 f0f3a6df Iustin Pop
haskell_tests = htest/test
970 b91e9518 Iustin Pop
971 e8c8cf1a Michael Hanselmann
dist_TESTS = \
972 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
973 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
974 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
975 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
976 30f2802f Iustin Pop
	test/cli-test.bash \
977 92886204 Michael Hanselmann
	test/bash_completion.bash \
978 e8c8cf1a Michael Hanselmann
	$(python_tests)
979 e8c8cf1a Michael Hanselmann
980 e8230860 Michael Hanselmann
nodist_TESTS =
981 d3cd5a3f Iustin Pop
check_SCRIPTS =
982 d3cd5a3f Iustin Pop
983 e5f6768c Iustin Pop
if WANT_HTOOLSTESTS
984 b91e9518 Iustin Pop
nodist_TESTS += $(haskell_tests)
985 f0f3a6df Iustin Pop
dist_TESTS += htest/offline-test.sh
986 f0f3a6df Iustin Pop
check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
987 b91e9518 Iustin Pop
endif
988 e8230860 Michael Hanselmann
989 e8230860 Michael Hanselmann
TESTS = $(dist_TESTS) $(nodist_TESTS)
990 e8230860 Michael Hanselmann
991 27e336af Michael Hanselmann
# Environment for all tests
992 27e336af Michael Hanselmann
PLAIN_TESTS_ENVIRONMENT = \
993 30f2802f Iustin Pop
	PYTHONPATH=. \
994 30f2802f Iustin Pop
	TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
995 30f2802f Iustin Pop
	PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
996 30f2802f Iustin Pop
	$(RUN_IN_TEMPDIR)
997 27e336af Michael Hanselmann
998 27e336af Michael Hanselmann
# Environment for tests run by automake
999 f848ac00 Michael Hanselmann
TESTS_ENVIRONMENT = \
1000 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1001 6e06b36c Iustin Pop
1002 eed5c5df Michael Hanselmann
all_python_code = \
1003 01a3a718 Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
1004 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1005 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
1006 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts) \
1007 e8c8cf1a Michael Hanselmann
	$(python_tests) \
1008 01a3a718 Michael Hanselmann
	$(pkgpython_PYTHON) \
1009 2d48a3a2 Michael Hanselmann
	$(client_PYTHON) \
1010 01a3a718 Michael Hanselmann
	$(hypervisor_PYTHON) \
1011 01a3a718 Michael Hanselmann
	$(rapi_PYTHON) \
1012 899c4d2c Michael Hanselmann
	$(server_PYTHON) \
1013 0d2bf835 René Nussbaumer
	$(pytools_PYTHON) \
1014 01a3a718 Michael Hanselmann
	$(http_PYTHON) \
1015 01a3a718 Michael Hanselmann
	$(confd_PYTHON) \
1016 dc101ecc Michael Hanselmann
	$(masterd_PYTHON) \
1017 bb44b1ae Michael Hanselmann
	$(impexpd_PYTHON) \
1018 c047a981 Michael Hanselmann
	$(utils_PYTHON) \
1019 9f4bb951 Michael Hanselmann
	$(watcher_PYTHON) \
1020 a8c68e44 Michael Hanselmann
	$(noinst_PYTHON) \
1021 a8c68e44 Michael Hanselmann
	$(qa_scripts)
1022 01a3a718 Michael Hanselmann
1023 eed5c5df Michael Hanselmann
srclink_files = \
1024 6be8e2bf Iustin Pop
	man/footer.rst \
1025 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
1026 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
1027 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
1028 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
1029 30f2802f Iustin Pop
	test/cli-test.bash \
1030 92886204 Michael Hanselmann
	test/bash_completion.bash \
1031 f0f3a6df Iustin Pop
	htest/offline-test.sh \
1032 f0f3a6df Iustin Pop
	htest/cli-tests-defs.sh \
1033 d6159933 Iustin Pop
	$(all_python_code) \
1034 51309138 Iustin Pop
	$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
1035 eed5c5df Michael Hanselmann
1036 eed5c5df Michael Hanselmann
check_python_code = \
1037 e4e7c7df Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
1038 f6cbcc06 Michael Hanselmann
	$(CHECK_IMPORTS) \
1039 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1040 95eb4188 Michael Hanselmann
	$(DOCPP) \
1041 eed5c5df Michael Hanselmann
	$(all_python_code)
1042 eed5c5df Michael Hanselmann
1043 e4e7c7df Michael Hanselmann
lint_python_code = \
1044 f60d352e Michael Hanselmann
	ganeti \
1045 f1763373 Iustin Pop
	ganeti/http/server.py \
1046 f60d352e Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
1047 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1048 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
1049 2cc8bdd0 Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
1050 f6cbcc06 Michael Hanselmann
	$(CHECK_IMPORTS) \
1051 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1052 95eb4188 Michael Hanselmann
	$(DOCPP) \
1053 2cc8bdd0 Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
1054 eed5c5df Michael Hanselmann
1055 f6cbcc06 Michael Hanselmann
standalone_python_modules = \
1056 f6cbcc06 Michael Hanselmann
	lib/rapi/client.py \
1057 f6cbcc06 Michael Hanselmann
	tools/ganeti-listrunner
1058 f6cbcc06 Michael Hanselmann
1059 21bf2e2e Andrea Spadaccini
pep8_python_code = \
1060 21bf2e2e Andrea Spadaccini
	ganeti \
1061 21bf2e2e Andrea Spadaccini
	ganeti/http/server.py \
1062 21bf2e2e Andrea Spadaccini
	$(dist_sbin_SCRIPTS) \
1063 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1064 21bf2e2e Andrea Spadaccini
	$(pkglib_python_scripts) \
1065 21bf2e2e Andrea Spadaccini
	$(BUILD_BASH_COMPLETION) \
1066 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1067 21bf2e2e Andrea Spadaccini
	$(DOCPP) \
1068 21bf2e2e Andrea Spadaccini
	$(PYTHON_BOOTSTRAP) \
1069 21bf2e2e Andrea Spadaccini
	qa
1070 21bf2e2e Andrea Spadaccini
1071 571b34f8 Michael Hanselmann
test/daemon-util_unittest.bash: daemons/daemon-util
1072 571b34f8 Michael Hanselmann
1073 46118ed2 Iustin Pop
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1074 7172f605 Michael Hanselmann
1075 92886204 Michael Hanselmann
test/bash_completion.bash: doc/examples/bash_completion-debug
1076 92886204 Michael Hanselmann
1077 26916aad Apollon Oikonomopoulos
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1078 26916aad Apollon Oikonomopoulos
	sed -f $(REPLACE_VARS_SED) < $< > $@
1079 26916aad Apollon Oikonomopoulos
	chmod +x $@
1080 26916aad Apollon Oikonomopoulos
1081 29386d3e Michael Hanselmann
tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1082 29386d3e Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1083 29386d3e Michael Hanselmann
	chmod +x $@
1084 29386d3e Michael Hanselmann
1085 490bec02 Iustin Pop
daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1086 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1087 5c566e17 Michael Hanselmann
	chmod +x $@
1088 e8230860 Michael Hanselmann
1089 490bec02 Iustin Pop
doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1090 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1091 e8230860 Michael Hanselmann
1092 e80aeb89 Michael Hanselmann
doc/examples/bash_completion: BC_ARGS = --compact
1093 e80aeb89 Michael Hanselmann
doc/examples/bash_completion-debug: BC_ARGS =
1094 e80aeb89 Michael Hanselmann
1095 e80aeb89 Michael Hanselmann
doc/examples/bash_completion doc/examples/bash_completion-debug: \
1096 e80aeb89 Michael Hanselmann
	$(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1097 4c3d5fb6 Iustin Pop
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1098 46118ed2 Iustin Pop
	daemons/ganeti-cleaner \
1099 ada0e680 Iustin Pop
	$(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1100 e80aeb89 Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1101 e80aeb89 Michael Hanselmann
	  $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1102 4f3d5b76 Michael Hanselmann
1103 f86e82ef Iustin Pop
doc/%.png: doc/%.dot
1104 2ab2b9f5 Iustin Pop
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1105 f86e82ef Iustin Pop
	$(DOT) -Tpng -o $@ $<
1106 f86e82ef Iustin Pop
1107 de8eea3e Iustin Pop
man/footer.man: man/footer.rst
1108 de8eea3e Iustin Pop
	@test -n "$(PANDOC)" || \
1109 de8eea3e Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1110 de8eea3e Iustin Pop
	$(PANDOC) -f rst -t man -o $@ $<
1111 de8eea3e Iustin Pop
1112 6be8e2bf Iustin Pop
man/footer.html: man/footer.rst
1113 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
1114 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1115 6be8e2bf Iustin Pop
	$(PANDOC) -f rst -t html -o $@ $<
1116 6be8e2bf Iustin Pop
1117 7142485a Iustin Pop
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1118 d7772efa Iustin Pop
	lib/build/shell_example_lexer.py \
1119 a13d6911 Iustin Pop
	| $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1120 387863a5 Iustin Pop
	@echo "Checking $< for hardcoded paths..."
1121 387863a5 Iustin Pop
	@if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1122 387863a5 Iustin Pop
	  echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1123 387863a5 Iustin Pop
	  exit 1; \
1124 387863a5 Iustin Pop
	fi
1125 a13d6911 Iustin Pop
	set -e ; \
1126 a13d6911 Iustin Pop
	trap 'echo auto-removing $@; rm $@' EXIT; \
1127 a13d6911 Iustin Pop
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1128 a13d6911 Iustin Pop
	trap - EXIT
1129 fcdb582d Michael Hanselmann
1130 5a19bd35 Iustin Pop
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1131 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
1132 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1133 a01dd3c6 Iustin Pop
	set -o pipefail ; \
1134 9c45babb Iustin Pop
	trap 'echo auto-removing $@; rm $@' EXIT; \
1135 6be8e2bf Iustin Pop
	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1136 9c45babb Iustin Pop
	  sed -e 's/\\@/@/g' > $@; \
1137 73d0e218 Iustin Pop
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1138 c55cc346 Iustin Pop
	$(CHECK_MAN_DASHES) $@; \
1139 9c45babb Iustin Pop
	trap - EXIT
1140 9c45babb Iustin Pop
1141 2ab2b9f5 Iustin Pop
1142 fcdb582d Michael Hanselmann
man/%.html.in: man/%.gen man/footer.html
1143 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
1144 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1145 a01dd3c6 Iustin Pop
	set -o pipefail ; \
1146 6be8e2bf Iustin Pop
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1147 6be8e2bf Iustin Pop
	  sed -e 's/\\@/@/g' > $@
1148 6be8e2bf Iustin Pop
1149 55398706 Iustin Pop
man/%: man/%.in  $(REPLACE_VARS_SED)
1150 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
1151 f29266b4 Iustin Pop
1152 fc1282b8 Iustin Pop
epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1153 fc1282b8 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
1154 f774bd03 Michael Hanselmann
1155 84a12e40 Iustin Pop
vcs-version:
1156 84a12e40 Iustin Pop
	if test -d .git; then \
1157 84a12e40 Iustin Pop
	  git describe > $@; \
1158 84a12e40 Iustin Pop
	elif test ! -f $@ ; then \
1159 84a12e40 Iustin Pop
	  echo "Cannot auto-generate $@ file"; exit 1; \
1160 84a12e40 Iustin Pop
	fi
1161 84a12e40 Iustin Pop
1162 316dc1ff Iustin Pop
.PHONY: clean-vcs-version
1163 316dc1ff Iustin Pop
clean-vcs-version:
1164 316dc1ff Iustin Pop
	rm -f vcs-version
1165 316dc1ff Iustin Pop
1166 84a12e40 Iustin Pop
.PHONY: regen-vcs-version
1167 84a12e40 Iustin Pop
regen-vcs-version:
1168 6376dcc0 Iustin Pop
	@set -e; \
1169 84a12e40 Iustin Pop
	cd $(srcdir); \
1170 84a12e40 Iustin Pop
	if test -d .git; then \
1171 6376dcc0 Iustin Pop
	  T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1172 6376dcc0 Iustin Pop
	  git describe > $$T; \
1173 6376dcc0 Iustin Pop
	  if ! cmp --quiet $$T vcs-version; then \
1174 6376dcc0 Iustin Pop
	    mv $$T vcs-version; \
1175 6376dcc0 Iustin Pop
	  fi; \
1176 84a12e40 Iustin Pop
	fi
1177 84a12e40 Iustin Pop
1178 2997cb0a Iustin Pop
htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1179 4c3d5fb6 Iustin Pop
	vcs-version $(built_base_sources)
1180 d6159933 Iustin Pop
	set -e; \
1181 d6159933 Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1182 d6159933 Iustin Pop
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
1183 d6159933 Iustin Pop
1184 d99d1e36 Iustin Pop
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1185 f11e524b Iustin Pop
	lib/constants.py lib/_autoconf.py lib/luxi.py \
1186 4c3d5fb6 Iustin Pop
	$(CONVERT_CONSTANTS) $(built_base_sources) \
1187 ef958f2a Iustin Pop
	| lib/_vcsversion.py
1188 11fd5a86 Iustin Pop
	set -e; \
1189 876f6a5e Iustin Pop
	{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1190 d99d1e36 Iustin Pop
1191 b88fcdd0 Iustin Pop
htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1192 b88fcdd0 Iustin Pop
	$(built_base_sources)
1193 b88fcdd0 Iustin Pop
	set -e; \
1194 b88fcdd0 Iustin Pop
	{ cat $< ; \
1195 b88fcdd0 Iustin Pop
	  echo ; \
1196 b88fcdd0 Iustin Pop
	  for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1197 b88fcdd0 Iustin Pop
	    echo "import $$name ()" ; \
1198 b88fcdd0 Iustin Pop
	  done ; \
1199 b88fcdd0 Iustin Pop
	} > $@
1200 b88fcdd0 Iustin Pop
1201 3735787e Iustin Pop
lib/_autoconf.py: Makefile | stamp-directories
1202 84a12e40 Iustin Pop
	set -e; \
1203 e8230860 Michael Hanselmann
	{ echo '# This file is automatically generated, do not edit!'; \
1204 e8230860 Michael Hanselmann
	  echo '#'; \
1205 67047322 Iustin Pop
	  echo ''; \
1206 67047322 Iustin Pop
	  echo '"""Build-time configuration for Ganeti.'; \
1207 67047322 Iustin Pop
	  echo '';\
1208 67047322 Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
1209 67047322 Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
1210 67047322 Iustin Pop
	  echo 'not edit by hand).'; \
1211 67047322 Iustin Pop
	  echo ''; \
1212 67047322 Iustin Pop
	  echo '"""'; \
1213 67047322 Iustin Pop
	  echo ''; \
1214 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0301,C0324'; \
1215 0a4e7f24 Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
1216 0a4e7f24 Iustin Pop
	  echo '# style warnings' ; \
1217 0a4e7f24 Iustin Pop
	  echo ''; \
1218 e8230860 Michael Hanselmann
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1219 e8230860 Michael Hanselmann
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1220 e8230860 Michael Hanselmann
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1221 e8230860 Michael Hanselmann
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1222 e8230860 Michael Hanselmann
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1223 e8230860 Michael Hanselmann
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1224 e8230860 Michael Hanselmann
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1225 e8230860 Michael Hanselmann
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
1226 553bd93f Vitaly Kuznetsov
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1227 052783ff Michael Hanselmann
	  echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1228 052783ff Michael Hanselmann
	  echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1229 e8230860 Michael Hanselmann
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1230 e8230860 Michael Hanselmann
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1231 2f2dbb4b Jun Futagawa
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1232 e8230860 Michael Hanselmann
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1233 e8230860 Michael Hanselmann
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1234 b8203e1e Iustin Pop
	  echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1235 e8230860 Michael Hanselmann
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1236 cb7c0198 Iustin Pop
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1237 4b97f902 Apollon Oikonomopoulos
	  echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1238 4b97f902 Apollon Oikonomopoulos
	  echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1239 e8230860 Michael Hanselmann
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1240 7e2c5b9e Guido Trotter
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
1241 c4dfb0b6 Andrea Spadaccini
	  echo "IP_PATH = '$(IP_PATH)'"; \
1242 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
1243 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1244 e90739d6 Michael Hanselmann
	  echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1245 bea60381 Michael Hanselmann
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1246 bea60381 Michael Hanselmann
	  echo "TOOLSDIR = '$(toolsdir)'"; \
1247 4f3d5b76 Michael Hanselmann
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1248 ada0e680 Iustin Pop
	  echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1249 f154a7a3 Michael Hanselmann
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
1250 8a69b3a8 Andrea Spadaccini
	  echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1251 8a69b3a8 Andrea Spadaccini
	  echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1252 551b6283 Iustin Pop
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1253 8b72b05c René Nussbaumer
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1254 f12e1736 René Nussbaumer
	  echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1255 8b72b05c René Nussbaumer
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1256 f12e1736 René Nussbaumer
	  echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1257 8b72b05c René Nussbaumer
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
1258 f12e1736 René Nussbaumer
	  echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1259 f12e1736 René Nussbaumer
	  echo "CONFD_USER = '$(CONFD_USER)'"; \
1260 f12e1736 René Nussbaumer
	  echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1261 f12e1736 René Nussbaumer
	  echo "NODED_USER = '$(NODED_USER)'"; \
1262 03881cb0 René Nussbaumer
	  echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1263 3536c792 Iustin Pop
	  echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1264 a002ed79 Agata Murawska
	  echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1265 21a5e56c Iustin Pop
	  echo "HTOOLS = True"; \
1266 cd8b0072 Iustin Pop
	  echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1267 1eb37421 René Nussbaumer
	  echo "XEN_CMD = '$(XEN_CMD)'"; \
1268 42ab9ac4 Iustin Pop
	  echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1269 9108958f Michael Hanselmann
	  echo "ENABLE_REMOTE_COMMANDS = $(ENABLE_REMOTE_COMMANDS)"; \
1270 e8230860 Michael Hanselmann
	} > $@
1271 e8230860 Michael Hanselmann
1272 3735787e Iustin Pop
lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1273 13aeae6a Iustin Pop
	set -e; \
1274 13aeae6a Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1275 13aeae6a Iustin Pop
	{ echo '# This file is automatically generated, do not edit!'; \
1276 13aeae6a Iustin Pop
	  echo '#'; \
1277 13aeae6a Iustin Pop
	  echo ''; \
1278 13aeae6a Iustin Pop
	  echo '"""Build-time VCS version number for Ganeti.'; \
1279 13aeae6a Iustin Pop
	  echo '';\
1280 13aeae6a Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
1281 13aeae6a Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
1282 13aeae6a Iustin Pop
	  echo 'not edit by hand).'; \
1283 13aeae6a Iustin Pop
	  echo ''; \
1284 13aeae6a Iustin Pop
	  echo '"""'; \
1285 13aeae6a Iustin Pop
	  echo ''; \
1286 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0301,C0324'; \
1287 13aeae6a Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
1288 13aeae6a Iustin Pop
	  echo '# style warnings' ; \
1289 13aeae6a Iustin Pop
	  echo ''; \
1290 13aeae6a Iustin Pop
	  echo "VCS_VERSION = '$$VCSVER'"; \
1291 13aeae6a Iustin Pop
	} > $@
1292 13aeae6a Iustin Pop
1293 96a7481d Michael Hanselmann
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1294 96a7481d Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1295 d5a2a550 Michael Hanselmann
1296 6e3bf290 Michael Hanselmann
$(SHELL_ENV_INIT): Makefile stamp-directories
1297 6e3bf290 Michael Hanselmann
	set -e; \
1298 6e3bf290 Michael Hanselmann
	{ echo '# Allow overriding for tests'; \
1299 6e3bf290 Michael Hanselmann
	  echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1300 6e3bf290 Michael Hanselmann
	  echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1301 6e3bf290 Michael Hanselmann
	  echo; \
1302 6e3bf290 Michael Hanselmann
	  echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1303 6e3bf290 Michael Hanselmann
	  echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1304 6e3bf290 Michael Hanselmann
	  echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1305 6e3bf290 Michael Hanselmann
	  echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1306 6e3bf290 Michael Hanselmann
	  echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1307 6e3bf290 Michael Hanselmann
	} > $@
1308 6e3bf290 Michael Hanselmann
1309 6e3bf290 Michael Hanselmann
$(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1310 e8230860 Michael Hanselmann
	set -e; \
1311 e8230860 Michael Hanselmann
	{ echo 's#@PREFIX@#$(prefix)#g'; \
1312 e8230860 Michael Hanselmann
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1313 e8230860 Michael Hanselmann
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1314 7a2ba406 Luca Bigliardi
	  echo 's#@BINDIR@#$(bindir)#g'; \
1315 e8230860 Michael Hanselmann
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
1316 335ba60d Guido Trotter
	  echo 's#@LIBDIR@#$(libdir)#g'; \
1317 e8230860 Michael Hanselmann
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1318 2f2dbb4b Jun Futagawa
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1319 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1320 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1321 56956bcb Iustin Pop
	  echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1322 56956bcb Iustin Pop
	  echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1323 d3b4cf9f Iustin Pop
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1324 7e1fac25 Michael Hanselmann
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1325 c5159571 Iustin Pop
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1326 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1327 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1328 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1329 0d150c50 René Nussbaumer
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1330 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1331 0d150c50 René Nussbaumer
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1332 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1333 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1334 46a8da3b René Nussbaumer
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1335 cd8b0072 Iustin Pop
	  echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1336 fc1282b8 Iustin Pop
	  echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1337 42ab9ac4 Iustin Pop
	  echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1338 6e3bf290 Michael Hanselmann
	  echo; \
1339 6e3bf290 Michael Hanselmann
	  echo '/^@SHELL_ENV_INIT@$$/ {'; \
1340 6e3bf290 Michael Hanselmann
	  echo '  r $(SHELL_ENV_INIT)'; \
1341 6e3bf290 Michael Hanselmann
	  echo '  d'; \
1342 6e3bf290 Michael Hanselmann
	  echo '}'; \
1343 e8230860 Michael Hanselmann
	} > $@
1344 e8230860 Michael Hanselmann
1345 67313146 Michael Hanselmann
# Using deferred evaluation
1346 899c4d2c Michael Hanselmann
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1347 9f4bb951 Michael Hanselmann
daemons/ganeti-watcher: MODULE = ganeti.watcher
1348 67313146 Michael Hanselmann
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1349 0d2bf835 René Nussbaumer
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1350 d12b9f66 Michael Hanselmann
tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1351 189b51fa Iustin Pop
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1352 67313146 Michael Hanselmann
1353 3735787e Iustin Pop
$(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1354 67313146 Michael Hanselmann
	test -n "$(MODULE)" || { echo Missing module; exit 1; }
1355 2d48a3a2 Michael Hanselmann
	set -e; \
1356 d75e738e Michael Hanselmann
	{ echo '#!/usr/bin/python'; \
1357 2d48a3a2 Michael Hanselmann
	  echo '# This file is automatically generated, do not edit!'; \
1358 67313146 Michael Hanselmann
	  echo "# Edit $(MODULE) instead."; \
1359 2d48a3a2 Michael Hanselmann
	  echo; \
1360 67313146 Michael Hanselmann
	  echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1361 2d48a3a2 Michael Hanselmann
	  echo; \
1362 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0103'; \
1363 2d48a3a2 Michael Hanselmann
	  echo '# C0103: Invalid name'; \
1364 2d48a3a2 Michael Hanselmann
	  echo; \
1365 2d48a3a2 Michael Hanselmann
	  echo 'import sys'; \
1366 67313146 Michael Hanselmann
	  echo 'import $(MODULE) as main'; \
1367 2d48a3a2 Michael Hanselmann
	  echo; \
1368 2d48a3a2 Michael Hanselmann
	  echo '# Temporarily alias commands until bash completion'; \
1369 2d48a3a2 Michael Hanselmann
	  echo '# generator is changed'; \
1370 67313146 Michael Hanselmann
	  echo 'if hasattr(main, "commands"):'; \
1371 55766d34 Andrea Spadaccini
	  echo '  commands = main.commands # pylint: disable=E1101'; \
1372 3f42b4f6 Michael Hanselmann
	  echo 'if hasattr(main, "aliases"):'; \
1373 55766d34 Andrea Spadaccini
	  echo '  aliases = main.aliases # pylint: disable=E1101'; \
1374 2d48a3a2 Michael Hanselmann
	  echo; \
1375 2d48a3a2 Michael Hanselmann
	  echo 'if __name__ == "__main__":'; \
1376 67313146 Michael Hanselmann
	  echo '  sys.exit(main.Main())'; \
1377 2d48a3a2 Michael Hanselmann
	} > $@
1378 2d48a3a2 Michael Hanselmann
	chmod u+x $@
1379 2d48a3a2 Michael Hanselmann
1380 3096524e Iustin Pop
$(HS_BUILT_TEST_HELPERS): Makefile
1381 3096524e Iustin Pop
	@test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1382 3096524e Iustin Pop
	set -e; \
1383 3096524e Iustin Pop
	{ echo '#!/bin/sh'; \
1384 3096524e Iustin Pop
	  echo '# This file is automatically generated, do not edit!'; \
1385 3096524e Iustin Pop
	  echo "# Edit Makefile.am instead."; \
1386 3096524e Iustin Pop
	  echo; \
1387 f0f3a6df Iustin Pop
	  echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1388 3096524e Iustin Pop
	} > $@
1389 3096524e Iustin Pop
	chmod u+x $@
1390 3096524e Iustin Pop
1391 3735787e Iustin Pop
stamp-directories: Makefile
1392 924ecd85 Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) ganeti
1393 3735787e Iustin Pop
	@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1394 3735787e Iustin Pop
	touch $@
1395 3735787e Iustin Pop
1396 e8230860 Michael Hanselmann
# We need to create symlinks because "make distcheck" will not install Python
1397 e8230860 Michael Hanselmann
# files when building.
1398 3735787e Iustin Pop
stamp-srclinks: Makefile | stamp-directories
1399 e8230860 Michael Hanselmann
	set -e; \
1400 01a3a718 Michael Hanselmann
	for i in $(srclink_files); do \
1401 e8230860 Michael Hanselmann
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1402 e8230860 Michael Hanselmann
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
1403 e8230860 Michael Hanselmann
		fi; \
1404 e8230860 Michael Hanselmann
	done
1405 dd1dfd9a Michael Hanselmann
	touch $@
1406 97a37b3f Michael Hanselmann
1407 9ff7e35c Michael Hanselmann
.PHONY: ganeti
1408 9ff7e35c Michael Hanselmann
ganeti:
1409 01f3e7b1 Iustin Pop
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1410 9ff7e35c Michael Hanselmann
1411 6b997854 Michael Hanselmann
.PHONY: check-dirs
1412 4c3d5fb6 Iustin Pop
check-dirs: $(GENERATED_FILES)
1413 0c1103d6 Iustin Pop
	@set -e; \
1414 6b997854 Michael Hanselmann
	find . -type d \( \( -name . \) -o \( \
1415 6b997854 Michael Hanselmann
		-name .git -o \
1416 6b997854 Michael Hanselmann
		-name autom4te.cache \
1417 6b997854 Michael Hanselmann
		\) -prune -o -print \) | { \
1418 6b997854 Michael Hanselmann
		error=; \
1419 6b997854 Michael Hanselmann
		while read dir; do \
1420 6b997854 Michael Hanselmann
			case "$$dir" in \
1421 6b997854 Michael Hanselmann
				$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1422 6b997854 Michael Hanselmann
				*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1423 6b997854 Michael Hanselmann
			esac; \
1424 6b997854 Michael Hanselmann
		done; \
1425 6b997854 Michael Hanselmann
		for dir in $(DIRS); do \
1426 6b997854 Michael Hanselmann
			if ! test -d "$$dir"; then \
1427 6b997854 Michael Hanselmann
				echo "Directory $$dir listed in DIRS does not exist" >&2; \
1428 6b997854 Michael Hanselmann
				error=1; \
1429 6b997854 Michael Hanselmann
			fi \
1430 6b997854 Michael Hanselmann
		done; \
1431 6b997854 Michael Hanselmann
		if test -n "$$error"; then exit 1; else exit 0; fi; \
1432 6b997854 Michael Hanselmann
	}
1433 6b997854 Michael Hanselmann
1434 f6cbcc06 Michael Hanselmann
.PHONY: check-local
1435 4c3d5fb6 Iustin Pop
check-local: check-dirs $(GENERATED_FILES)
1436 eed5c5df Michael Hanselmann
	$(CHECK_PYTHON_CODE) $(check_python_code)
1437 5d3c30df Michael Hanselmann
	PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1438 35576615 Michael Hanselmann
	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1439 7385c51d Michael Hanselmann
	$(CHECK_NEWS) < $(top_srcdir)/NEWS
1440 83ea5145 Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1441 dad26941 Iustin Pop
	@expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1442 154d7ba5 Michael Hanselmann
	if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1443 9488fd1d Michael Hanselmann
		echo "Incorrect version in README, expected $$expver"; \
1444 9488fd1d Michael Hanselmann
		exit 1; \
1445 7ecb3d0e Michael Hanselmann
	fi; \
1446 04c998a5 Michael Hanselmann
	for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1447 04c998a5 Michael Hanselmann
			doc/security.rst; do \
1448 d5114fa1 Michael Hanselmann
		if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1449 9822b1dd Iustin Pop
			"Documents Ganeti version $$expver"; then \
1450 d5114fa1 Michael Hanselmann
			echo "Incorrect version in $$file, expected $$expver"; \
1451 d5114fa1 Michael Hanselmann
			exit 1; \
1452 d5114fa1 Michael Hanselmann
		fi; \
1453 7a962ecc Michael Hanselmann
	done; \
1454 fc07a14e Michael Hanselmann
	if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1455 fc07a14e Michael Hanselmann
		echo "File $(top_srcdir)/doc/design-$$expver.rst not found"; \
1456 7a962ecc Michael Hanselmann
		exit 1; \
1457 7a962ecc Michael Hanselmann
	fi
1458 eed5c5df Michael Hanselmann
1459 49e11c49 Iustin Pop
.PHONY: hs-check
1460 f0f3a6df Iustin Pop
hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1461 49e11c49 Iustin Pop
	@rm -f test.tix
1462 f0f3a6df Iustin Pop
	./htest/test
1463 f0f3a6df Iustin Pop
	HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1464 49e11c49 Iustin Pop
1465 08366664 Michael Hanselmann
# E111: indentation is not a multiple of four
1466 5ae4945a Iustin Pop
# E121: continuation line indentation is not a multiple of four
1467 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1468 5ae4945a Iustin Pop
# E125: continuation line does not distinguish itself from next logical line
1469 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1470 5ae4945a Iustin Pop
# E127: continuation line over-indented for visual indent
1471 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1472 5ae4945a Iustin Pop
# note: do NOT add E128 here; it's a valid style error in most cases!
1473 5ae4945a Iustin Pop
# I've seen real errors, but also some cases were we indent wrongly
1474 5ae4945a Iustin Pop
# due to line length; try to rework the cases where it is triggered,
1475 5ae4945a Iustin Pop
# instead of silencing it
1476 08366664 Michael Hanselmann
# E261: at least two spaces before inline comment
1477 08366664 Michael Hanselmann
# E501: line too long (80 characters)
1478 5ae4945a Iustin Pop
PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1479 08366664 Michael Hanselmann
1480 08366664 Michael Hanselmann
# For excluding pep8 expects filenames only, not whole paths
1481 08366664 Michael Hanselmann
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1482 08366664 Michael Hanselmann
1483 6e4c8f68 Iustin Pop
LINT_TARGETS = pylint pylint-qa
1484 6e4c8f68 Iustin Pop
if HAS_PEP8
1485 6e4c8f68 Iustin Pop
LINT_TARGETS += pep8
1486 6e4c8f68 Iustin Pop
endif
1487 6e4c8f68 Iustin Pop
if HAS_HLINT
1488 6e4c8f68 Iustin Pop
LINT_TARGETS += hlint
1489 6e4c8f68 Iustin Pop
endif
1490 6e4c8f68 Iustin Pop
1491 e0098923 Iustin Pop
.PHONY: lint
1492 6e4c8f68 Iustin Pop
lint: $(LINT_TARGETS)
1493 6e4c8f68 Iustin Pop
1494 6e4c8f68 Iustin Pop
.PHONY: pylint
1495 4c3d5fb6 Iustin Pop
pylint: $(GENERATED_FILES)
1496 6d7cc5ff Michael Hanselmann
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1497 6d7cc5ff Michael Hanselmann
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1498 6e4c8f68 Iustin Pop
1499 6e4c8f68 Iustin Pop
.PHONY: pylint-qa
1500 4c3d5fb6 Iustin Pop
pylint-qa: $(GENERATED_FILES)
1501 6e4c8f68 Iustin Pop
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1502 3582eef6 Iustin Pop
	cd $(top_srcdir)/qa && \
1503 3582eef6 Iustin Pop
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1504 3582eef6 Iustin Pop
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1505 e0098923 Iustin Pop
1506 6e4c8f68 Iustin Pop
.PHONY: pep8
1507 4c3d5fb6 Iustin Pop
pep8: $(GENERATED_FILES)
1508 6e4c8f68 Iustin Pop
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1509 6e4c8f68 Iustin Pop
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1510 6e4c8f68 Iustin Pop
		--repeat $(pep8_python_code)
1511 6e4c8f68 Iustin Pop
1512 2cdaf225 Iustin Pop
# FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1513 191ff68c Iustin Pop
.PHONY: hlint
1514 5a1e31b4 Iustin Pop
hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1515 6e4c8f68 Iustin Pop
	@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1516 191ff68c Iustin Pop
	if tty -s; then C="-c"; else C=""; fi; \
1517 488a5b2e Michele Tartara
	$(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1518 3603605a Iustin Pop
	  --ignore "Use first" \
1519 3603605a Iustin Pop
	  --ignore "Use comparing" \
1520 3603605a Iustin Pop
	  --ignore "Use on" \
1521 3603605a Iustin Pop
	  --ignore "Reduce duplication" \
1522 2cdaf225 Iustin Pop
	  --ignore "Use &&&" \
1523 2cdaf225 Iustin Pop
	  --ignore "Use void" \
1524 5a1e31b4 Iustin Pop
	  --hint htools/lint-hints \
1525 4ab40ed5 Iustin Pop
	  $(filter-out htools/Ganeti/THH.hs,$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1526 191ff68c Iustin Pop
1527 84a12e40 Iustin Pop
# a dist hook rule for updating the vcs-version file; this is
1528 84a12e40 Iustin Pop
# hardcoded due to where it needs to build the file...
1529 84a12e40 Iustin Pop
dist-hook:
1530 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1531 316dc1ff Iustin Pop
	rm -f $(top_distdir)/vcs-version
1532 84a12e40 Iustin Pop
	cp -p $(srcdir)/vcs-version $(top_distdir)
1533 84a12e40 Iustin Pop
1534 84a12e40 Iustin Pop
# a distcheck hook rule for catching revision control directories
1535 b6f2e47f Iustin Pop
distcheck-hook:
1536 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1537 c6aa0c42 Michael Hanselmann
		echo "Found revision control files in final archive." 1>&2; \
1538 c6aa0c42 Michael Hanselmann
		exit 1; \
1539 c6aa0c42 Michael Hanselmann
	fi
1540 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
1541 c6aa0c42 Michael Hanselmann
		echo "Found Python byte code in final archive." 1>&2; \
1542 c6aa0c42 Michael Hanselmann
		exit 1; \
1543 c6aa0c42 Michael Hanselmann
	fi
1544 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*~' | grep .; then \
1545 c6aa0c42 Michael Hanselmann
		echo "Found backup files in final archive." 1>&2; \
1546 b6f2e47f Iustin Pop
		exit 1; \
1547 b6f2e47f Iustin Pop
	fi
1548 bf0b21da Michael Hanselmann
# Empty files or directories should not be distributed. They can cause
1549 bf0b21da Michael Hanselmann
# unnecessary warnings for packagers. Directories used by automake during
1550 bf0b21da Michael Hanselmann
# distcheck must be excluded.
1551 bf0b21da Michael Hanselmann
	if find $(top_distdir) -empty -and -not \( \
1552 bf0b21da Michael Hanselmann
			-path $(top_distdir)/_build -or \
1553 bf0b21da Michael Hanselmann
			-path $(top_distdir)/_inst \) | grep .; then \
1554 bf0b21da Michael Hanselmann
		echo "Found empty files or directories in final archive." 1>&2; \
1555 bf0b21da Michael Hanselmann
		exit 1; \
1556 bf0b21da Michael Hanselmann
	fi
1557 c7b86f6c Michael Hanselmann
	if test -n "$(BUILD_RELEASE)" && \
1558 c7b86f6c Michael Hanselmann
	   grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1559 c7b86f6c Michael Hanselmann
		echo "Found unreleased version in NEWS." >&2; \
1560 c7b86f6c Michael Hanselmann
		exit 1; \
1561 c7b86f6c Michael Hanselmann
	fi
1562 c7b86f6c Michael Hanselmann
1563 c7b86f6c Michael Hanselmann
# When building a release, stricter checks should be used
1564 e627fe09 Michael Hanselmann
distcheck-release dist-release: export BUILD_RELEASE = 1
1565 c7b86f6c Michael Hanselmann
distcheck-release: distcheck
1566 b6f2e47f Iustin Pop
1567 7213dded René Nussbaumer
distrebuildcheck: dist
1568 7213dded René Nussbaumer
	set -e; \
1569 7213dded René Nussbaumer
	builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1570 7213dded René Nussbaumer
	trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1571 7213dded René Nussbaumer
	cd $$builddir; \
1572 7213dded René Nussbaumer
	tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1573 7213dded René Nussbaumer
	cd $(distdir); \
1574 7213dded René Nussbaumer
	./configure; \
1575 7213dded René Nussbaumer
	$(MAKE) maintainer-clean; \
1576 7213dded René Nussbaumer
	cp $(abs_srcdir)/vcs-version .; \
1577 7213dded René Nussbaumer
	./configure; \
1578 7213dded René Nussbaumer
	$(MAKE) $(AM_MAKEFLAGS)
1579 7213dded René Nussbaumer
1580 e627fe09 Michael Hanselmann
dist-release: dist
1581 e627fe09 Michael Hanselmann
	set -e; \
1582 e627fe09 Michael Hanselmann
	for i in $(DIST_ARCHIVES); do \
1583 e627fe09 Michael Hanselmann
		echo -n "Checking $$i ... "; \
1584 e627fe09 Michael Hanselmann
		autotools/check-tar < $$i; \
1585 e627fe09 Michael Hanselmann
		echo OK; \
1586 e627fe09 Michael Hanselmann
	done
1587 e627fe09 Michael Hanselmann
1588 8925faaa Iustin Pop
install-exec-local:
1589 0d93b082 Michael Hanselmann
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1590 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
1591 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1592 e8230860 Michael Hanselmann
1593 d128fdb6 Iustin Pop
.PHONY: apidoc
1594 a38bfce5 Iustin Pop
if WANT_HTOOLSAPIDOC
1595 a38bfce5 Iustin Pop
apidoc: py-apidoc hs-apidoc
1596 a38bfce5 Iustin Pop
else
1597 a38bfce5 Iustin Pop
apidoc: py-apidoc
1598 a38bfce5 Iustin Pop
endif
1599 a38bfce5 Iustin Pop
1600 a38bfce5 Iustin Pop
.PHONY: py-apidoc
1601 4c3d5fb6 Iustin Pop
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1602 b959138f Michael Hanselmann
	$(RUN_IN_TEMPDIR) epydoc -v \
1603 b959138f Michael Hanselmann
		--conf $(CURDIR)/epydoc.conf \
1604 22c5390d Iustin Pop
		--output $(CURDIR)/$(APIDOC_PY_DIR)
1605 a38bfce5 Iustin Pop
1606 a38bfce5 Iustin Pop
.PHONY: hs-apidoc
1607 c3f67183 Iustin Pop
hs-apidoc: $(HS_BUILT_SRCS)
1608 a38bfce5 Iustin Pop
	@test -n "$(HSCOLOUR)" || \
1609 a38bfce5 Iustin Pop
	    { echo 'HsColour' not found during configure; exit 1; }
1610 a38bfce5 Iustin Pop
	@test -n "$(HADDOCK)" || \
1611 a38bfce5 Iustin Pop
	    { echo 'haddock' not found during configure; exit 1; }
1612 22c5390d Iustin Pop
	rm -rf $(APIDOC_HS_DIR)/*
1613 879d9290 Iustin Pop
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Backend
1614 458a286a Iustin Pop
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1615 358a0a8f Iustin Pop
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1616 4cbe9bda Iustin Pop
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1617 22c5390d Iustin Pop
	$(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1618 82888134 Michael Hanselmann
	$(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1619 358a0a8f Iustin Pop
	$(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1620 a38bfce5 Iustin Pop
	set -e ; \
1621 a38bfce5 Iustin Pop
	cd htools; \
1622 c478f837 Iustin Pop
	if [ "$(HTOOLS_NOCURL)" ]; \
1623 c478f837 Iustin Pop
	then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1624 c478f837 Iustin Pop
	else OPTGHC=""; \
1625 c478f837 Iustin Pop
	fi; \
1626 1adec4be Iustin Pop
	if [ "$(HTOOLS_PARALLEL3)" ]; \
1627 1adec4be Iustin Pop
	then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1628 1adec4be Iustin Pop
	fi; \
1629 21a5e56c Iustin Pop
	if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1630 21a5e56c Iustin Pop
	then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1631 21a5e56c Iustin Pop
	fi; \
1632 b88fcdd0 Iustin Pop
	RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1633 a38bfce5 Iustin Pop
	for file in $$RELSRCS; do \
1634 a38bfce5 Iustin Pop
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1635 22c5390d Iustin Pop
		$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1636 a38bfce5 Iustin Pop
	done ; \
1637 22c5390d Iustin Pop
	$(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1638 18049dad Iustin Pop
		-t ganeti -p haddock-prologue \
1639 a38bfce5 Iustin Pop
		--source-module="%{MODULE/.//}.html" \
1640 a38bfce5 Iustin Pop
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
1641 c478f837 Iustin Pop
		$$OPTGHC \
1642 c3f67183 Iustin Pop
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1643 d128fdb6 Iustin Pop
1644 13e720f1 Iustin Pop
.PHONY: TAGS
1645 4c3d5fb6 Iustin Pop
TAGS: $(GENERATED_FILES)
1646 13e720f1 Iustin Pop
	rm -f TAGS
1647 6b84f036 Iustin Pop
	$(GHC) -e ":etags" -v0 \
1648 6b84f036 Iustin Pop
	  $(filter-out -O -Werror,$(HFLAGS)) \
1649 21a5e56c Iustin Pop
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1650 6b84f036 Iustin Pop
	  $(HS_LIBTEST_SRCS)
1651 74fa8200 Iustin Pop
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1652 74fa8200 Iustin Pop
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
1653 74fa8200 Iustin Pop
	  -path './qa/*.py' | \
1654 2db53645 Iustin Pop
	  etags -l python -a -
1655 13e720f1 Iustin Pop
1656 27e336af Michael Hanselmann
.PHONY: coverage
1657 b91e9518 Iustin Pop
if WANT_HTOOLS
1658 b91e9518 Iustin Pop
coverage: py-coverage hs-coverage
1659 b91e9518 Iustin Pop
else
1660 b91e9518 Iustin Pop
coverage: py-coverage
1661 b91e9518 Iustin Pop
endif
1662 b91e9518 Iustin Pop
1663 b91e9518 Iustin Pop
.PHONY: py-coverage
1664 4c3d5fb6 Iustin Pop
py-coverage: $(GENERATED_FILES) $(python_tests)
1665 141c8421 Michael Hanselmann
	@test -n "$(PYCOVERAGE)" || \
1666 141c8421 Michael Hanselmann
	    { echo 'python-coverage' not found during configure; exit 1; }
1667 27e336af Michael Hanselmann
	set -e; \
1668 141c8421 Michael Hanselmann
	COVERAGE=$(PYCOVERAGE) \
1669 22c5390d Iustin Pop
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1670 22c5390d Iustin Pop
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1671 22c5390d Iustin Pop
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1672 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1673 e8c8cf1a Michael Hanselmann
	$(python_tests)
1674 27e336af Michael Hanselmann
1675 b91e9518 Iustin Pop
.PHONY: hs-coverage
1676 f0f3a6df Iustin Pop
hs-coverage: $(haskell_tests) htest/hpc-htools
1677 316dc1ff Iustin Pop
	rm -f *.tix
1678 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) hs-check
1679 48f12e73 Iustin Pop
	@mkdir_p@ $(COVERAGE_HS_DIR)
1680 96eccc1f Iustin Pop
	hpc combine --union $(HPCEXCL) \
1681 96eccc1f Iustin Pop
	  test.tix hpc-htools.tix > coverage-htools.tix
1682 896b2850 Iustin Pop
	hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1683 896b2850 Iustin Pop
	hpc report coverage-htools.tix
1684 82888134 Michael Hanselmann
	$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1685 b91e9518 Iustin Pop
1686 ec8379bd Iustin Pop
# Special "kind-of-QA" target for htools, needs special setup (all
1687 ec8379bd Iustin Pop
# tools compiled with -fhpc)
1688 ec8379bd Iustin Pop
.PHONY: live-test
1689 ec8379bd Iustin Pop
live-test: all
1690 ec8379bd Iustin Pop
	set -e ; \
1691 ec8379bd Iustin Pop
	cd htools; \
1692 82888134 Michael Hanselmann
	rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1693 ec8379bd Iustin Pop
	rm -f *.tix *.mix; \
1694 ec8379bd Iustin Pop
	./live-test.sh; \
1695 c3f67183 Iustin Pop
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1696 ec8379bd Iustin Pop
	  --output=live-test.tix ; \
1697 22c5390d Iustin Pop
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1698 22c5390d Iustin Pop
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1699 ec8379bd Iustin Pop
		--srcdir=.. $(HPCEXCL) ; \
1700 ec8379bd Iustin Pop
	hpc report --srcdir=.. live-test $(HPCEXCL)
1701 b91e9518 Iustin Pop
1702 b341b9ca Guido Trotter
commit-check: distcheck lint apidoc
1703 b341b9ca Guido Trotter
1704 6438e259 Iustin Pop
.PHONY: gitignore-check
1705 6438e259 Iustin Pop
gitignore-check:
1706 6438e259 Iustin Pop
	@if [ -n "`git status --short`" ]; then \
1707 6438e259 Iustin Pop
	  echo "Git status is not clean!" 1>&2 ; \
1708 6438e259 Iustin Pop
	  git status --short; \
1709 6438e259 Iustin Pop
	  exit 1; \
1710 6438e259 Iustin Pop
	fi
1711 6438e259 Iustin Pop
1712 37519c09 Iustin Pop
# Target that builds all binaries (including those that are not
1713 37519c09 Iustin Pop
# rebuilt except when running the tests)
1714 37519c09 Iustin Pop
.PHONY: really-all
1715 37519c09 Iustin Pop
really-all: all $(check_SCRIPTS) $(haskell_tests)
1716 37519c09 Iustin Pop
1717 1d45f7a0 Iustin Pop
# we don't need the ancient implicit rules:
1718 1d45f7a0 Iustin Pop
%: %,v
1719 1d45f7a0 Iustin Pop
%: RCS/%,v
1720 1d45f7a0 Iustin Pop
%: RCS/%
1721 1d45f7a0 Iustin Pop
%: s.%
1722 1d45f7a0 Iustin Pop
%: SCCS/s.%
1723 1d45f7a0 Iustin Pop
1724 3baa809c Michael Hanselmann
-include ./Makefile.local
1725 3baa809c Michael Hanselmann
1726 e8230860 Michael Hanselmann
# vim: set noet :