Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 358a0a8f

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