Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 305e174c

History | View | Annotate | Download (44.6 kB)

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