Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ a593113c

History | View | Annotate | Download (38.9 kB)

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