Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ c1912a48

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