Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 1ca709c1

History | View | Annotate | Download (57.2 kB)

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