Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 4ff32a35

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