Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ e5395072

History | View | Annotate | Download (31 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 a01dd3c6 Iustin Pop
# Use bash in order to be able to use pipefail
13 a01dd3c6 Iustin Pop
SHELL=/bin/bash
14 a01dd3c6 Iustin Pop
15 6e06b36c Iustin Pop
ACLOCAL_AMFLAGS = -I autotools
16 4f3d5b76 Michael Hanselmann
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
17 b959138f Michael Hanselmann
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
18 eed5c5df Michael Hanselmann
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
19 a4f12da4 Michael Hanselmann
CHECK_MAN = $(top_srcdir)/autotools/check-man
20 96602be4 Michael Hanselmann
CHECK_VERSION = $(top_srcdir)/autotools/check-version
21 7385c51d Michael Hanselmann
CHECK_NEWS = $(top_srcdir)/autotools/check-news
22 95eb4188 Michael Hanselmann
DOCPP = $(top_srcdir)/autotools/docpp
23 e8230860 Michael Hanselmann
REPLACE_VARS_SED = autotools/replace_vars.sed
24 e8230860 Michael Hanselmann
25 22c5390d Iustin Pop
# Note: these are automake-specific variables, and must be named after
26 22c5390d Iustin Pop
# the directory + 'dir' suffix
27 2d48a3a2 Michael Hanselmann
clientdir = $(pkgpythondir)/client
28 e8230860 Michael Hanselmann
hypervisordir = $(pkgpythondir)/hypervisor
29 ff9efc03 Michael Hanselmann
httpdir = $(pkgpythondir)/http
30 dc101ecc Michael Hanselmann
masterddir = $(pkgpythondir)/masterd
31 12426ae1 Guido Trotter
confddir = $(pkgpythondir)/confd
32 8c229cc7 Oleksiy Mishchenko
rapidir = $(pkgpythondir)/rapi
33 899c4d2c Michael Hanselmann
serverdir = $(pkgpythondir)/server
34 9f4bb951 Michael Hanselmann
watcherdir = $(pkgpythondir)/watcher
35 bb44b1ae Michael Hanselmann
impexpddir = $(pkgpythondir)/impexpd
36 c047a981 Michael Hanselmann
utilsdir = $(pkgpythondir)/utils
37 e8230860 Michael Hanselmann
toolsdir = $(pkglibdir)/tools
38 7617fd6b Iustin Pop
iallocatorsdir = $(pkglibdir)/iallocators
39 0d2bf835 René Nussbaumer
pytoolsdir = $(pkgpythondir)/tools
40 e8230860 Michael Hanselmann
docdir = $(datadir)/doc/$(PACKAGE)
41 e8230860 Michael Hanselmann
42 a4f12da4 Michael Hanselmann
# Delete output file if an error occurred while building it
43 a4f12da4 Michael Hanselmann
.DELETE_ON_ERROR:
44 a4f12da4 Michael Hanselmann
45 d5506465 Iustin Pop
HTOOLS_DIRS = \
46 d5506465 Iustin Pop
	htools \
47 d5506465 Iustin Pop
	htools/Ganeti \
48 d5506465 Iustin Pop
	htools/Ganeti/HTools
49 d5506465 Iustin Pop
50 e8230860 Michael Hanselmann
DIRS = \
51 e8230860 Michael Hanselmann
	autotools \
52 e8230860 Michael Hanselmann
	daemons \
53 e8230860 Michael Hanselmann
	devel \
54 e8230860 Michael Hanselmann
	doc \
55 e8230860 Michael Hanselmann
	doc/examples \
56 d6d9ce45 Guido Trotter
	doc/examples/hooks \
57 c51580b3 Guido Trotter
	doc/examples/gnt-debug \
58 d5506465 Iustin Pop
	$(HTOOLS_DIRS) \
59 e8230860 Michael Hanselmann
	lib \
60 2d48a3a2 Michael Hanselmann
	lib/client \
61 f9897b6d Michael Hanselmann
	lib/build \
62 2f16ea8f Michael Hanselmann
	lib/confd \
63 ff9efc03 Michael Hanselmann
	lib/http \
64 e8230860 Michael Hanselmann
	lib/hypervisor \
65 bb44b1ae Michael Hanselmann
	lib/impexpd \
66 dc101ecc Michael Hanselmann
	lib/masterd \
67 8c229cc7 Oleksiy Mishchenko
	lib/rapi \
68 899c4d2c Michael Hanselmann
	lib/server \
69 0d2bf835 René Nussbaumer
	lib/tools \
70 c047a981 Michael Hanselmann
	lib/utils \
71 9f4bb951 Michael Hanselmann
	lib/watcher \
72 e8230860 Michael Hanselmann
	man \
73 e8230860 Michael Hanselmann
	qa \
74 e8230860 Michael Hanselmann
	test \
75 e8230860 Michael Hanselmann
	test/data \
76 e8230860 Michael Hanselmann
	tools
77 e8230860 Michael Hanselmann
78 2750b299 Michael Hanselmann
BUILDTIME_DIR_AUTOCREATE = \
79 c964d962 Michael Hanselmann
	scripts \
80 22c5390d Iustin Pop
	$(APIDOC_DIR) \
81 22c5390d Iustin Pop
	$(APIDOC_PY_DIR) \
82 22c5390d Iustin Pop
	$(APIDOC_HS_DIR) \
83 22c5390d Iustin Pop
	$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
84 22c5390d Iustin Pop
	$(COVERAGE_DIR) \
85 22c5390d Iustin Pop
	$(COVERAGE_PY_DIR) \
86 22c5390d Iustin Pop
	$(COVERAGE_HS_DIR) \
87 b91e9518 Iustin Pop
	.hpc
88 2750b299 Michael Hanselmann
89 2750b299 Michael Hanselmann
BUILDTIME_DIRS = \
90 2750b299 Michael Hanselmann
	$(BUILDTIME_DIR_AUTOCREATE) \
91 6b997854 Michael Hanselmann
	doc/html
92 6b997854 Michael Hanselmann
93 6b997854 Michael Hanselmann
DIRCHECK_EXCLUDE = \
94 6b997854 Michael Hanselmann
	$(BUILDTIME_DIRS) \
95 6b997854 Michael Hanselmann
	ganeti-[0-9]*.[0-9]*.[0-9]* \
96 6b997854 Michael Hanselmann
	doc/html/_*
97 6b997854 Michael Hanselmann
98 2750b299 Michael Hanselmann
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
99 c964d962 Michael Hanselmann
100 22c5390d Iustin Pop
# some helper vars
101 22c5390d Iustin Pop
COVERAGE_DIR = doc/coverage
102 22c5390d Iustin Pop
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
103 22c5390d Iustin Pop
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
104 22c5390d Iustin Pop
APIDOC_DIR = doc/api
105 22c5390d Iustin Pop
APIDOC_PY_DIR = $(APIDOC_DIR)/py
106 22c5390d Iustin Pop
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
107 22c5390d Iustin Pop
108 2ab2b9f5 Iustin Pop
MAINTAINERCLEANFILES = \
109 d17e74b4 Iustin Pop
	$(docpng) \
110 b76aac08 Michael Hanselmann
	$(maninput) \
111 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
112 84a12e40 Iustin Pop
	doc/news.rst \
113 7a03d293 Michael Hanselmann
	doc/upgrade.rst \
114 84a12e40 Iustin Pop
	vcs-version
115 2ab2b9f5 Iustin Pop
116 d17e74b4 Iustin Pop
maintainer-clean-local:
117 6b997854 Michael Hanselmann
	rm -rf $(BUILDTIME_DIRS)
118 d17e74b4 Iustin Pop
119 e8230860 Michael Hanselmann
CLEANFILES = \
120 2f16ea8f Michael Hanselmann
	$(addsuffix /*.py[co],$(DIRS)) \
121 d5506465 Iustin Pop
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
122 d5506465 Iustin Pop
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
123 c964d962 Michael Hanselmann
	$(all_dirfiles) \
124 2d48a3a2 Michael Hanselmann
	$(PYTHON_BOOTSTRAP) \
125 f774bd03 Michael Hanselmann
	epydoc.conf \
126 e8230860 Michael Hanselmann
	autotools/replace_vars.sed \
127 f154a7a3 Michael Hanselmann
	daemons/daemon-util \
128 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner \
129 e8230860 Michael Hanselmann
	devel/upload \
130 f72f8622 Iustin Pop
	doc/examples/bash_completion \
131 e8230860 Michael Hanselmann
	doc/examples/ganeti.initd \
132 5d9e167a Miguel Di Ciurcio Filho
	doc/examples/ganeti-kvm-poweroff.initd \
133 e8230860 Michael Hanselmann
	doc/examples/ganeti.cron \
134 679008e7 Iustin Pop
	doc/examples/gnt-config-backup \
135 a2442bf9 Luca Bigliardi
	doc/examples/hooks/ipsec \
136 2ab2b9f5 Iustin Pop
	$(man_MANS) \
137 2ab2b9f5 Iustin Pop
	$(manhtml) \
138 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
139 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
140 d6159933 Iustin Pop
	$(nodist_pkgpython_PYTHON) \
141 c3f67183 Iustin Pop
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
142 191ff68c Iustin Pop
	.hpc/*.mix htools/*.tix \
143 191ff68c Iustin Pop
	doc/hs-lint.html
144 e8230860 Michael Hanselmann
145 c964d962 Michael Hanselmann
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
146 c964d962 Michael Hanselmann
# it'll cause the target to rebuild every time.
147 dc7d2c49 Michael Hanselmann
BUILT_SOURCES = \
148 dc7d2c49 Michael Hanselmann
	ganeti \
149 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
150 2d1f248e Michael Hanselmann
	lib/_autoconf.py \
151 c964d962 Michael Hanselmann
	$(all_dirfiles) \
152 2d1f248e Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
153 2d1f248e Michael Hanselmann
154 e8230860 Michael Hanselmann
nodist_pkgpython_PYTHON = \
155 e8230860 Michael Hanselmann
	lib/_autoconf.py
156 e8230860 Michael Hanselmann
157 f9897b6d Michael Hanselmann
noinst_PYTHON = \
158 5f43f393 Michael Hanselmann
	lib/build/__init__.py \
159 5f43f393 Michael Hanselmann
	lib/build/sphinx_ext.py
160 f9897b6d Michael Hanselmann
161 e8230860 Michael Hanselmann
pkgpython_PYTHON = \
162 e8230860 Michael Hanselmann
	lib/__init__.py \
163 a8a76bc2 Guido Trotter
	lib/asyncnotifier.py \
164 e8230860 Michael Hanselmann
	lib/backend.py \
165 e8230860 Michael Hanselmann
	lib/bdev.py \
166 e8230860 Michael Hanselmann
	lib/bootstrap.py \
167 e8230860 Michael Hanselmann
	lib/cli.py \
168 e8230860 Michael Hanselmann
	lib/cmdlib.py \
169 cea881e5 Michael Hanselmann
	lib/compat.py \
170 e8230860 Michael Hanselmann
	lib/config.py \
171 e8230860 Michael Hanselmann
	lib/constants.py \
172 821d9e43 Michael Hanselmann
	lib/daemon.py \
173 e8230860 Michael Hanselmann
	lib/errors.py \
174 62e0e880 Iustin Pop
	lib/ht.py \
175 e8230860 Michael Hanselmann
	lib/jqueue.py \
176 8b537bb0 Michael Hanselmann
	lib/jstore.py \
177 e8230860 Michael Hanselmann
	lib/locking.py \
178 e8230860 Michael Hanselmann
	lib/luxi.py \
179 e8230860 Michael Hanselmann
	lib/mcpu.py \
180 a744b676 Manuel Franceschini
	lib/netutils.py \
181 e8230860 Michael Hanselmann
	lib/objects.py \
182 e8230860 Michael Hanselmann
	lib/opcodes.py \
183 a123dc19 Michael Hanselmann
	lib/qlang.py \
184 4ca96421 Michael Hanselmann
	lib/query.py \
185 e8230860 Michael Hanselmann
	lib/rpc.py \
186 f12e1736 René Nussbaumer
	lib/runtime.py \
187 e8230860 Michael Hanselmann
	lib/serializer.py \
188 e8230860 Michael Hanselmann
	lib/ssconf.py \
189 e8230860 Michael Hanselmann
	lib/ssh.py \
190 ac2d0fe4 Michael Hanselmann
	lib/storage.py \
191 1338f2b4 Balazs Lecz
	lib/uidpool.py \
192 76094e37 Michael Hanselmann
	lib/workerpool.py
193 e8230860 Michael Hanselmann
194 2d48a3a2 Michael Hanselmann
client_PYTHON = \
195 c2855a12 Michael Hanselmann
	lib/client/__init__.py \
196 02266fe0 Michael Hanselmann
	lib/client/gnt_backup.py \
197 7b3e7d41 Michael Hanselmann
	lib/client/gnt_cluster.py \
198 6d50f5f9 Michael Hanselmann
	lib/client/gnt_debug.py \
199 667dbd6b Adeodato Simo
	lib/client/gnt_group.py \
200 e792102d Michael Hanselmann
	lib/client/gnt_instance.py \
201 a09b9e3d Michael Hanselmann
	lib/client/gnt_job.py \
202 37494fa4 Michael Hanselmann
	lib/client/gnt_node.py \
203 6d50f5f9 Michael Hanselmann
	lib/client/gnt_os.py
204 2d48a3a2 Michael Hanselmann
205 e8230860 Michael Hanselmann
hypervisor_PYTHON = \
206 e8230860 Michael Hanselmann
	lib/hypervisor/__init__.py \
207 e8230860 Michael Hanselmann
	lib/hypervisor/hv_base.py \
208 48297fa2 Iustin Pop
	lib/hypervisor/hv_chroot.py \
209 e8230860 Michael Hanselmann
	lib/hypervisor/hv_fake.py \
210 eb58f9b1 Guido Trotter
	lib/hypervisor/hv_kvm.py \
211 4b5e40a5 Iustin Pop
	lib/hypervisor/hv_lxc.py \
212 e8230860 Michael Hanselmann
	lib/hypervisor/hv_xen.py
213 e8230860 Michael Hanselmann
214 8c229cc7 Oleksiy Mishchenko
rapi_PYTHON = \
215 8c229cc7 Oleksiy Mishchenko
	lib/rapi/__init__.py \
216 10b207d4 Oleksiy Mishchenko
	lib/rapi/baserlib.py \
217 95ab4de9 David Knowles
	lib/rapi/client.py \
218 20b509de Michael Hanselmann
	lib/rapi/client_utils.py \
219 10b207d4 Oleksiy Mishchenko
	lib/rapi/connector.py \
220 10b207d4 Oleksiy Mishchenko
	lib/rapi/rlib2.py
221 8c229cc7 Oleksiy Mishchenko
222 ff9efc03 Michael Hanselmann
http_PYTHON = \
223 02cab3e7 Michael Hanselmann
	lib/http/__init__.py \
224 be500c29 Michael Hanselmann
	lib/http/auth.py \
225 02cab3e7 Michael Hanselmann
	lib/http/client.py \
226 02cab3e7 Michael Hanselmann
	lib/http/server.py
227 ff9efc03 Michael Hanselmann
228 12426ae1 Guido Trotter
confd_PYTHON = \
229 71f27d19 Guido Trotter
	lib/confd/__init__.py \
230 e4ccf6cd Guido Trotter
	lib/confd/client.py \
231 2f16ea8f Michael Hanselmann
	lib/confd/querylib.py \
232 2f16ea8f Michael Hanselmann
	lib/confd/server.py
233 8c229cc7 Oleksiy Mishchenko
234 dc101ecc Michael Hanselmann
masterd_PYTHON = \
235 033a1d00 Michael Hanselmann
	lib/masterd/__init__.py \
236 033a1d00 Michael Hanselmann
	lib/masterd/instance.py
237 dc101ecc Michael Hanselmann
238 bb44b1ae Michael Hanselmann
impexpd_PYTHON = \
239 bb44b1ae Michael Hanselmann
	lib/impexpd/__init__.py
240 bb44b1ae Michael Hanselmann
241 9f4bb951 Michael Hanselmann
watcher_PYTHON = \
242 9f4bb951 Michael Hanselmann
	lib/watcher/__init__.py
243 9f4bb951 Michael Hanselmann
244 899c4d2c Michael Hanselmann
server_PYTHON = \
245 29d91329 Michael Hanselmann
	lib/server/__init__.py \
246 5c9c0e0e Michael Hanselmann
	lib/server/confd.py \
247 5119f2ec Michael Hanselmann
	lib/server/masterd.py \
248 d9c82a4e Michael Hanselmann
	lib/server/noded.py \
249 d9c82a4e Michael Hanselmann
	lib/server/rapi.py
250 899c4d2c Michael Hanselmann
251 0d2bf835 René Nussbaumer
pytools_PYTHON = \
252 0d2bf835 René Nussbaumer
	lib/tools/__init__.py \
253 0d2bf835 René Nussbaumer
	lib/tools/ensure_dirs.py
254 0d2bf835 René Nussbaumer
255 c047a981 Michael Hanselmann
utils_PYTHON = \
256 4fd029cf Michael Hanselmann
	lib/utils/__init__.py \
257 79d22269 Michael Hanselmann
	lib/utils/algo.py \
258 9d1b963f Michael Hanselmann
	lib/utils/filelock.py \
259 f21bb4b7 Michael Hanselmann
	lib/utils/hash.py \
260 3865ca48 Michael Hanselmann
	lib/utils/io.py \
261 1ae4c5a1 Michael Hanselmann
	lib/utils/log.py \
262 36a4acd4 Michael Hanselmann
	lib/utils/mlock.py \
263 17b97ab3 Michael Hanselmann
	lib/utils/nodesetup.py \
264 a4ccecf6 Michael Hanselmann
	lib/utils/process.py \
265 7fcffe27 Michael Hanselmann
	lib/utils/retry.py \
266 7831fc5f Michael Hanselmann
	lib/utils/text.py \
267 c50645c0 Michael Hanselmann
	lib/utils/wrapper.py \
268 c50645c0 Michael Hanselmann
	lib/utils/x509.py
269 c047a981 Michael Hanselmann
270 f05c99f3 Michael Hanselmann
docrst = \
271 ffa6869f Iustin Pop
	doc/admin.rst \
272 5c0c1eeb Iustin Pop
	doc/design-2.0.rst \
273 4f366caf Michael Hanselmann
	doc/design-2.1.rst \
274 e56bb0e8 Guido Trotter
	doc/design-2.2.rst \
275 1eb85930 Guido Trotter
	doc/design-2.3.rst \
276 92902e91 Iustin Pop
	doc/design-htools-2.3.rst \
277 78b40c5e Michael Hanselmann
	doc/design-2.4.rst \
278 c95c0f71 Michael Hanselmann
	doc/design-draft.rst \
279 1e86ee97 Marc Schmitt
	doc/design-oob.rst \
280 e5a246df Michael Hanselmann
	doc/design-query2.rst \
281 539f195a Michael Hanselmann
	doc/design-x509-ca.rst \
282 278ddaa9 Michael Hanselmann
	doc/design-http-server.rst \
283 1375e1d9 Michael Hanselmann
	doc/design-impexp2.rst \
284 ed9fda24 Michael Hanselmann
	doc/design-lu-generated-jobs.rst \
285 4055b109 Adeodato Simo
	doc/design-multi-reloc.rst \
286 d9bdffc3 René Nussbaumer
	doc/cluster-merge.rst \
287 a997cec5 Apollon Oikonomopoulos
	doc/design-shared-storage.rst \
288 62947ebb Michael Hanselmann
	doc/devnotes.rst \
289 e2078d28 Iustin Pop
	doc/glossary.rst \
290 4d6443f4 Iustin Pop
	doc/hooks.rst \
291 876860a3 Iustin Pop
	doc/iallocator.rst \
292 d17e74b4 Iustin Pop
	doc/index.rst \
293 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
294 28e15341 Iustin Pop
	doc/install.rst \
295 9725b53d Michael Hanselmann
	doc/locking.rst \
296 6bf273d5 Michael Hanselmann
	doc/move-instance.rst \
297 c71a1a3d Iustin Pop
	doc/news.rst \
298 6d81475c Iustin Pop
	doc/rapi.rst \
299 b76aac08 Michael Hanselmann
	doc/security.rst \
300 35dd762d Michael Hanselmann
	doc/upgrade.rst \
301 c71a1a3d Iustin Pop
	doc/walkthrough.rst
302 f05c99f3 Michael Hanselmann
303 c3f67183 Iustin Pop
HS_PROGS = \
304 d6159933 Iustin Pop
	htools/hbal \
305 d6159933 Iustin Pop
	htools/hscan \
306 d6159933 Iustin Pop
	htools/hail \
307 d6159933 Iustin Pop
	htools/hspace
308 d6159933 Iustin Pop
309 c3f67183 Iustin Pop
HS_ALL_PROGS = $(HS_PROGS) htools/test
310 c3f67183 Iustin Pop
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
311 d6159933 Iustin Pop
# we don't add -Werror by default
312 d5506465 Iustin Pop
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
313 b91e9518 Iustin Pop
# extra flags that can be overriden on the command line
314 d6159933 Iustin Pop
HEXTRA =
315 b91e9518 Iustin Pop
# exclude options for coverage reports
316 b91e9518 Iustin Pop
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
317 d6159933 Iustin Pop
318 c3f67183 Iustin Pop
HS_LIB_SRCS = \
319 d6159933 Iustin Pop
	htools/Ganeti/HTools/CLI.hs \
320 d6159933 Iustin Pop
	htools/Ganeti/HTools/Cluster.hs \
321 d6159933 Iustin Pop
	htools/Ganeti/HTools/Container.hs \
322 d6159933 Iustin Pop
	htools/Ganeti/HTools/ExtLoader.hs \
323 d6159933 Iustin Pop
	htools/Ganeti/HTools/Group.hs \
324 d6159933 Iustin Pop
	htools/Ganeti/HTools/IAlloc.hs \
325 d6159933 Iustin Pop
	htools/Ganeti/HTools/Instance.hs \
326 d6159933 Iustin Pop
	htools/Ganeti/HTools/Loader.hs \
327 d6159933 Iustin Pop
	htools/Ganeti/HTools/Luxi.hs \
328 d6159933 Iustin Pop
	htools/Ganeti/HTools/Node.hs \
329 d6159933 Iustin Pop
	htools/Ganeti/HTools/PeerMap.hs \
330 d6159933 Iustin Pop
	htools/Ganeti/HTools/QC.hs \
331 d6159933 Iustin Pop
	htools/Ganeti/HTools/Rapi.hs \
332 d6159933 Iustin Pop
	htools/Ganeti/HTools/Simu.hs \
333 d6159933 Iustin Pop
	htools/Ganeti/HTools/Text.hs \
334 d6159933 Iustin Pop
	htools/Ganeti/HTools/Types.hs \
335 d6159933 Iustin Pop
	htools/Ganeti/HTools/Utils.hs \
336 d6159933 Iustin Pop
	htools/Ganeti/Jobs.hs \
337 d6159933 Iustin Pop
	htools/Ganeti/Luxi.hs \
338 d6159933 Iustin Pop
	htools/Ganeti/OpCodes.hs
339 d6159933 Iustin Pop
340 c3f67183 Iustin Pop
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
341 c3f67183 Iustin Pop
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
342 d6159933 Iustin Pop
343 c964d962 Michael Hanselmann
$(RUN_IN_TEMPDIR): | $(all_dirfiles)
344 c964d962 Michael Hanselmann
345 a2d917f3 Iustin Pop
# Note: we use here an order-only prerequisite, as the contents of
346 a2d917f3 Iustin Pop
# _autoconf.py are not actually influencing the html build output: it
347 a2d917f3 Iustin Pop
# has to exist in order for the sphinx module to be loaded
348 a2d917f3 Iustin Pop
# successfully, but we certainly don't want the docs to be rebuilt if
349 a2d917f3 Iustin Pop
# it changes
350 c964d962 Michael Hanselmann
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
351 a2d917f3 Iustin Pop
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
352 a2d917f3 Iustin Pop
	| lib/_autoconf.py
353 d17e74b4 Iustin Pop
	@test -n "$(SPHINX)" || \
354 d17e74b4 Iustin Pop
	    { echo 'sphinx-build' not found during configure; exit 1; }
355 2750b299 Michael Hanselmann
	@mkdir_p@ $(dir $@)
356 e7f6524c Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
357 13de7d59 Michael Hanselmann
	    -d . \
358 d17e74b4 Iustin Pop
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
359 d17e74b4 Iustin Pop
	    -D release="$(PACKAGE_VERSION)" \
360 13de7d59 Michael Hanselmann
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
361 13de7d59 Michael Hanselmann
	rm -f doc/html/.buildinfo doc/html/objects.inv
362 13de7d59 Michael Hanselmann
	touch $@
363 13de7d59 Michael Hanselmann
364 c964d962 Michael Hanselmann
doc/html: doc/html/index.html
365 2ab2b9f5 Iustin Pop
366 cbf3d64b Michael Hanselmann
doc/install-quick.rst: INSTALL
367 b76aac08 Michael Hanselmann
doc/news.rst: NEWS
368 7a03d293 Michael Hanselmann
doc/upgrade.rst: UPGRADE
369 b76aac08 Michael Hanselmann
370 e8deef56 Michael Hanselmann
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
371 cbf3d64b Michael Hanselmann
	set -e; \
372 cbf3d64b Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
373 cbf3d64b Michael Hanselmann
	  echo '.. Do not edit.'; \
374 cbf3d64b Michael Hanselmann
	  echo; \
375 cbf3d64b Michael Hanselmann
	  cat $<; \
376 cbf3d64b Michael Hanselmann
	} > $@
377 cbf3d64b Michael Hanselmann
378 b8195800 Iustin Pop
docdot = \
379 ca9ccea8 Michael Hanselmann
	doc/arch-2.0.dot \
380 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-acquire.dot \
381 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-release.dot
382 b8195800 Iustin Pop
383 d17e74b4 Iustin Pop
docpng = $(patsubst %.dot,%.png,$(docdot))
384 e8230860 Michael Hanselmann
385 7e1ccbe0 Michael Hanselmann
# Things to build but not to install (add it to EXTRA_DIST if it should be
386 7e1ccbe0 Michael Hanselmann
# distributed)
387 7e1ccbe0 Michael Hanselmann
noinst_DATA = \
388 7e1ccbe0 Michael Hanselmann
	devel/upload \
389 7e1ccbe0 Michael Hanselmann
	doc/html \
390 7e1ccbe0 Michael Hanselmann
	doc/examples/bash_completion \
391 7e1ccbe0 Michael Hanselmann
	doc/examples/ganeti.cron \
392 7e1ccbe0 Michael Hanselmann
	doc/examples/ganeti.initd \
393 5d9e167a Miguel Di Ciurcio Filho
	doc/examples/ganeti-kvm-poweroff.initd \
394 679008e7 Iustin Pop
	doc/examples/gnt-config-backup \
395 7e1ccbe0 Michael Hanselmann
	doc/examples/hooks/ipsec \
396 7e1ccbe0 Michael Hanselmann
	$(manhtml)
397 f29266b4 Iustin Pop
398 4f3d5b76 Michael Hanselmann
gnt_scripts = \
399 e8230860 Michael Hanselmann
	scripts/gnt-backup \
400 e8230860 Michael Hanselmann
	scripts/gnt-cluster \
401 e8230860 Michael Hanselmann
	scripts/gnt-debug \
402 667dbd6b Adeodato Simo
	scripts/gnt-group \
403 e8230860 Michael Hanselmann
	scripts/gnt-instance \
404 e8230860 Michael Hanselmann
	scripts/gnt-job \
405 e8230860 Michael Hanselmann
	scripts/gnt-node \
406 e8230860 Michael Hanselmann
	scripts/gnt-os
407 e8230860 Michael Hanselmann
408 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP_SBIN = \
409 5c9c0e0e Michael Hanselmann
	daemons/ganeti-confd \
410 29d91329 Michael Hanselmann
	daemons/ganeti-masterd \
411 5119f2ec Michael Hanselmann
	daemons/ganeti-noded \
412 9f4bb951 Michael Hanselmann
	daemons/ganeti-watcher \
413 d9c82a4e Michael Hanselmann
	daemons/ganeti-rapi \
414 02266fe0 Michael Hanselmann
	scripts/gnt-backup \
415 7b3e7d41 Michael Hanselmann
	scripts/gnt-cluster \
416 6d50f5f9 Michael Hanselmann
	scripts/gnt-debug \
417 667dbd6b Adeodato Simo
	scripts/gnt-group \
418 e792102d Michael Hanselmann
	scripts/gnt-instance \
419 a09b9e3d Michael Hanselmann
	scripts/gnt-job \
420 37494fa4 Michael Hanselmann
	scripts/gnt-node \
421 6d50f5f9 Michael Hanselmann
	scripts/gnt-os
422 2d48a3a2 Michael Hanselmann
423 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP = \
424 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
425 0d2bf835 René Nussbaumer
	tools/ensure-dirs
426 0d2bf835 René Nussbaumer
427 a8c68e44 Michael Hanselmann
qa_scripts = \
428 a8c68e44 Michael Hanselmann
	qa/ganeti-qa.py \
429 a8c68e44 Michael Hanselmann
	qa/qa_cluster.py \
430 a8c68e44 Michael Hanselmann
	qa/qa_config.py \
431 a8c68e44 Michael Hanselmann
	qa/qa_daemon.py \
432 a8c68e44 Michael Hanselmann
	qa/qa_env.py \
433 a8c68e44 Michael Hanselmann
	qa/qa_error.py \
434 a8c68e44 Michael Hanselmann
	qa/qa_instance.py \
435 a8c68e44 Michael Hanselmann
	qa/qa_node.py \
436 a8c68e44 Michael Hanselmann
	qa/qa_os.py \
437 a8c68e44 Michael Hanselmann
	qa/qa_rapi.py \
438 a8c68e44 Michael Hanselmann
	qa/qa_tags.py \
439 a8c68e44 Michael Hanselmann
	qa/qa_utils.py
440 a8c68e44 Michael Hanselmann
441 d6159933 Iustin Pop
bin_SCRIPTS =
442 7617fd6b Iustin Pop
iallocators_SCRIPTS =
443 d6159933 Iustin Pop
if WANT_HTOOLS
444 c3f67183 Iustin Pop
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
445 c3f67183 Iustin Pop
iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
446 d6159933 Iustin Pop
endif
447 d6159933 Iustin Pop
448 c3f67183 Iustin Pop
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
449 d5506465 Iustin Pop
	BINARY=$(@:htools/%=%); \
450 fd0bc853 Iustin Pop
	if [ "$$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
451 fd0bc853 Iustin Pop
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
452 fd0bc853 Iustin Pop
	  exit 1; \
453 fd0bc853 Iustin Pop
	fi; \
454 d5506465 Iustin Pop
	$(GHC) --make \
455 d5506465 Iustin Pop
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
456 d5506465 Iustin Pop
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
457 d5506465 Iustin Pop
	  $@
458 d6159933 Iustin Pop
459 b91e9518 Iustin Pop
# for the htools/test binary, we need to enable profiling/coverage
460 b91e9518 Iustin Pop
htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
461 b91e9518 Iustin Pop
	-fno-warn-monomorphism-restriction -fno-warn-orphans \
462 b91e9518 Iustin Pop
	-fno-warn-missing-methods -fno-warn-unused-imports
463 b91e9518 Iustin Pop
464 da7e44ee Michael Hanselmann
dist_sbin_SCRIPTS = \
465 da7e44ee Michael Hanselmann
	tools/ganeti-listrunner
466 4f3d5b76 Michael Hanselmann
467 fc3fd894 Michael Hanselmann
nodist_sbin_SCRIPTS = \
468 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
469 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner
470 fc3fd894 Michael Hanselmann
471 e8230860 Michael Hanselmann
dist_tools_SCRIPTS = \
472 e8230860 Michael Hanselmann
	tools/burnin \
473 e8230860 Michael Hanselmann
	tools/cfgshell \
474 e8230860 Michael Hanselmann
	tools/cfgupgrade \
475 b5672ea0 Iustin Pop
	tools/cfgupgrade12 \
476 1f7d3f7d René Nussbaumer
	tools/cluster-merge \
477 ea5fd476 Iustin Pop
	tools/lvmstrap \
478 6bf273d5 Michael Hanselmann
	tools/move-instance \
479 05cd934d René Nussbaumer
	tools/setup-ssh \
480 ea5fd476 Iustin Pop
	tools/sanitize-config
481 e8230860 Michael Hanselmann
482 2d76b580 Michael Hanselmann
pkglib_python_scripts = \
483 c6ccba7e Michael Hanselmann
	daemons/import-export \
484 c6ccba7e Michael Hanselmann
	tools/check-cert-expired
485 2d76b580 Michael Hanselmann
486 0d2bf835 René Nussbaumer
nodist_pkglib_python_scripts = \
487 0d2bf835 René Nussbaumer
	tools/ensure-dirs
488 0d2bf835 René Nussbaumer
489 f154a7a3 Michael Hanselmann
pkglib_SCRIPTS = \
490 2d76b580 Michael Hanselmann
	daemons/daemon-util \
491 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
492 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts)
493 f154a7a3 Michael Hanselmann
494 0d2bf835 René Nussbaumer
nodist_pkglib_SCRIPTS = \
495 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts)
496 0d2bf835 René Nussbaumer
497 e8230860 Michael Hanselmann
EXTRA_DIST = \
498 e8230860 Michael Hanselmann
	NEWS \
499 7a03d293 Michael Hanselmann
	UPGRADE \
500 f774bd03 Michael Hanselmann
	epydoc.conf.in \
501 70c771f6 Michael Hanselmann
	pylintrc \
502 bb46a96c Michael Hanselmann
	autotools/build-bash-completion \
503 eed5c5df Michael Hanselmann
	autotools/check-python-code \
504 a4f12da4 Michael Hanselmann
	autotools/check-man \
505 c81ed2b2 Michael Hanselmann
	autotools/check-news \
506 e627fe09 Michael Hanselmann
	autotools/check-tar \
507 96602be4 Michael Hanselmann
	autotools/check-version \
508 95eb4188 Michael Hanselmann
	autotools/docpp \
509 27e336af Michael Hanselmann
	autotools/gen-coverage \
510 e8c8cf1a Michael Hanselmann
	autotools/testrunner \
511 f3313af5 Guido Trotter
	$(RUN_IN_TEMPDIR) \
512 f154a7a3 Michael Hanselmann
	daemons/daemon-util.in \
513 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner.in \
514 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
515 e8230860 Michael Hanselmann
	devel/upload.in \
516 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup.in \
517 b8195800 Iustin Pop
	$(docdot) \
518 f727d134 Michael Hanselmann
	$(docpng) \
519 d17e74b4 Iustin Pop
	$(docrst) \
520 d17e74b4 Iustin Pop
	doc/conf.py \
521 d17e74b4 Iustin Pop
	doc/html \
522 e8230860 Michael Hanselmann
	doc/examples/ganeti.initd.in \
523 5d9e167a Miguel Di Ciurcio Filho
	doc/examples/ganeti-kvm-poweroff.initd.in \
524 e8230860 Michael Hanselmann
	doc/examples/ganeti.cron.in \
525 679008e7 Iustin Pop
	doc/examples/gnt-config-backup.in \
526 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default \
527 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default-debug \
528 d6d9ce45 Guido Trotter
	doc/examples/hooks/ethers \
529 a2442bf9 Luca Bigliardi
	doc/examples/hooks/ipsec.in \
530 89c04c2d Guido Trotter
	doc/examples/gnt-debug/README \
531 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay0.json \
532 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay50.json \
533 e8230860 Michael Hanselmann
	test/testutils.py \
534 e8230860 Michael Hanselmann
	test/mocks.py \
535 e8230860 Michael Hanselmann
	$(dist_TESTS) \
536 e8230860 Michael Hanselmann
	$(TEST_FILES) \
537 6be8e2bf Iustin Pop
	man/footer.rst \
538 6be8e2bf Iustin Pop
	$(manrst) \
539 f727d134 Michael Hanselmann
	$(maninput) \
540 39e0d19e Michael Hanselmann
	qa/qa-sample.json \
541 d6159933 Iustin Pop
	$(qa_scripts) \
542 c3f67183 Iustin Pop
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
543 c3f67183 Iustin Pop
	$(HS_PROG_SRCS)
544 e8230860 Michael Hanselmann
545 e8230860 Michael Hanselmann
man_MANS = \
546 e8230860 Michael Hanselmann
	man/ganeti.7 \
547 bae7e531 Michael Hanselmann
	man/ganeti-cleaner.8 \
548 b7b7cda6 Guido Trotter
	man/ganeti-confd.8 \
549 da7e44ee Michael Hanselmann
	man/ganeti-listrunner.8 \
550 320d986d Iustin Pop
	man/ganeti-masterd.8 \
551 e8230860 Michael Hanselmann
	man/ganeti-noded.8 \
552 e8230860 Michael Hanselmann
	man/ganeti-os-interface.7 \
553 320d986d Iustin Pop
	man/ganeti-rapi.8 \
554 e8230860 Michael Hanselmann
	man/ganeti-watcher.8 \
555 e8230860 Michael Hanselmann
	man/gnt-backup.8 \
556 e8230860 Michael Hanselmann
	man/gnt-cluster.8 \
557 d3b4cf9f Iustin Pop
	man/gnt-debug.8 \
558 667dbd6b Adeodato Simo
	man/gnt-group.8 \
559 e8230860 Michael Hanselmann
	man/gnt-instance.8 \
560 d3b4cf9f Iustin Pop
	man/gnt-job.8 \
561 e8230860 Michael Hanselmann
	man/gnt-node.8 \
562 5a19bd35 Iustin Pop
	man/gnt-os.8 \
563 5a19bd35 Iustin Pop
	man/hail.1 \
564 5a19bd35 Iustin Pop
	man/hbal.1 \
565 5a19bd35 Iustin Pop
	man/hscan.1 \
566 5a19bd35 Iustin Pop
	man/hspace.1
567 e8230860 Michael Hanselmann
568 5a19bd35 Iustin Pop
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
569 6be8e2bf Iustin Pop
manhtml = $(patsubst %.rst,%.html,$(manrst))
570 fcdb582d Michael Hanselmann
mangen = $(patsubst %.rst,%.gen,$(manrst))
571 25c92bc5 Michael Hanselmann
maninput = \
572 5a19bd35 Iustin Pop
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
573 de8eea3e Iustin Pop
	$(patsubst %.html,%.html.in,$(manhtml)) \
574 fcdb582d Michael Hanselmann
	man/footer.man man/footer.html $(mangen)
575 e8230860 Michael Hanselmann
576 e8230860 Michael Hanselmann
TEST_FILES = \
577 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.0.txt \
578 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.3.txt \
579 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-disk.txt \
580 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip4.txt \
581 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip6.txt \
582 27e46076 Michael Hanselmann
	test/data/cert1.pem \
583 d816408a Iustin Pop
	test/data/proc_drbd8.txt \
584 a6ac80db Iustin Pop
	test/data/proc_drbd80-emptyline.txt \
585 2d76b580 Michael Hanselmann
	test/data/proc_drbd83.txt \
586 549071a0 Luca Bigliardi
	test/data/sys_drbd_usermode_helper.txt \
587 2d76b580 Michael Hanselmann
	test/import-export_unittest-helper
588 e8230860 Michael Hanselmann
589 e8c8cf1a Michael Hanselmann
python_tests = \
590 17496050 Guido Trotter
	test/ganeti.asyncnotifier_unittest.py \
591 f942a838 Michael Hanselmann
	test/ganeti.backend_unittest.py \
592 6de7c41d Iustin Pop
	test/ganeti.bdev_unittest.py \
593 6de7c41d Iustin Pop
	test/ganeti.cli_unittest.py \
594 66d1f035 René Nussbaumer
	test/ganeti.client.gnt_cluster_unittest.py \
595 25ce3ec4 Michael Hanselmann
	test/ganeti.client.gnt_instance_unittest.py \
596 1118ec44 Guido Trotter
	test/ganeti.daemon_unittest.py \
597 6de7c41d Iustin Pop
	test/ganeti.cmdlib_unittest.py \
598 cea881e5 Michael Hanselmann
	test/ganeti.compat_unittest.py \
599 edf7d66e Iustin Pop
	test/ganeti.confd.client_unittest.py \
600 e8230860 Michael Hanselmann
	test/ganeti.config_unittest.py \
601 6de7c41d Iustin Pop
	test/ganeti.constants_unittest.py \
602 3bd19c66 Michael Hanselmann
	test/ganeti.errors_unittest.py \
603 e8230860 Michael Hanselmann
	test/ganeti.hooks_unittest.py \
604 ecdf0398 Michael Hanselmann
	test/ganeti.ht_unittest.py \
605 6de7c41d Iustin Pop
	test/ganeti.http_unittest.py \
606 b7d82e40 Iustin Pop
	test/ganeti.hypervisor_unittest.py \
607 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_chroot_unittest.py \
608 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_fake_unittest.py \
609 748e4b5a Michael Hanselmann
	test/ganeti.hypervisor.hv_kvm_unittest.py \
610 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_lxc_unittest.py \
611 55cc0a44 Michael Hanselmann
	test/ganeti.hypervisor.hv_xen_unittest.py \
612 bb44b1ae Michael Hanselmann
	test/ganeti.impexpd_unittest.py \
613 989a8bee Michael Hanselmann
	test/ganeti.jqueue_unittest.py \
614 e8230860 Michael Hanselmann
	test/ganeti.locking_unittest.py \
615 231db3a5 Michael Hanselmann
	test/ganeti.luxi_unittest.py \
616 033a1d00 Michael Hanselmann
	test/ganeti.masterd.instance_unittest.py \
617 407339d0 Michael Hanselmann
	test/ganeti.mcpu_unittest.py \
618 a744b676 Manuel Franceschini
	test/ganeti.netutils_unittest.py \
619 4c14965f Guido Trotter
	test/ganeti.objects_unittest.py \
620 c32b908e Michael Hanselmann
	test/ganeti.opcodes_unittest.py \
621 a123dc19 Michael Hanselmann
	test/ganeti.qlang_unittest.py \
622 4ca96421 Michael Hanselmann
	test/ganeti.query_unittest.py \
623 cfaeaaf7 Michael Hanselmann
	test/ganeti.rapi.baserlib_unittest.py \
624 95ab4de9 David Knowles
	test/ganeti.rapi.client_unittest.py \
625 4cbd4462 Oleksiy Mishchenko
	test/ganeti.rapi.resources_unittest.py \
626 6395cebb Michael Hanselmann
	test/ganeti.rapi.rlib2_unittest.py \
627 33231500 Michael Hanselmann
	test/ganeti.rpc_unittest.py \
628 f12e1736 René Nussbaumer
	test/ganeti.runtime_unittest.py \
629 6de7c41d Iustin Pop
	test/ganeti.serializer_unittest.py \
630 6de7c41d Iustin Pop
	test/ganeti.ssh_unittest.py \
631 0d2bf835 René Nussbaumer
	test/ganeti.tools.ensure_dirs_unittest.py \
632 93be53da Balazs Lecz
	test/ganeti.uidpool_unittest.py \
633 4fd029cf Michael Hanselmann
	test/ganeti.utils.algo_unittest.py \
634 9d1b963f Michael Hanselmann
	test/ganeti.utils.filelock_unittest.py \
635 f21bb4b7 Michael Hanselmann
	test/ganeti.utils.hash_unittest.py \
636 3865ca48 Michael Hanselmann
	test/ganeti.utils.io_unittest.py \
637 b6fa9a44 Michael Hanselmann
	test/ganeti.utils.log_unittest.py \
638 36a4acd4 Michael Hanselmann
	test/ganeti.utils.mlock_unittest.py \
639 17b97ab3 Michael Hanselmann
	test/ganeti.utils.nodesetup_unittest.py \
640 a4ccecf6 Michael Hanselmann
	test/ganeti.utils.process_unittest.py \
641 79d22269 Michael Hanselmann
	test/ganeti.utils.retry_unittest.py \
642 7fcffe27 Michael Hanselmann
	test/ganeti.utils.text_unittest.py \
643 7831fc5f Michael Hanselmann
	test/ganeti.utils.wrapper_unittest.py \
644 c50645c0 Michael Hanselmann
	test/ganeti.utils.x509_unittest.py \
645 4fd029cf Michael Hanselmann
	test/ganeti.utils_unittest.py \
646 3f991867 Michael Hanselmann
	test/ganeti.workerpool_unittest.py \
647 aefbe369 Michael Hanselmann
	test/cfgupgrade_unittest.py \
648 055f822b Michael Hanselmann
	test/docs_unittest.py \
649 055f822b Michael Hanselmann
	test/tempfile_fork_unittest.py
650 e8230860 Michael Hanselmann
651 b91e9518 Iustin Pop
haskell_tests = htools/test
652 b91e9518 Iustin Pop
653 e8c8cf1a Michael Hanselmann
dist_TESTS = \
654 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
655 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
656 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
657 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
658 e8c8cf1a Michael Hanselmann
	$(python_tests)
659 e8c8cf1a Michael Hanselmann
660 e8230860 Michael Hanselmann
nodist_TESTS =
661 b91e9518 Iustin Pop
if WANT_HTOOLS
662 b91e9518 Iustin Pop
nodist_TESTS += $(haskell_tests)
663 b91e9518 Iustin Pop
endif
664 e8230860 Michael Hanselmann
665 e8230860 Michael Hanselmann
TESTS = $(dist_TESTS) $(nodist_TESTS)
666 e8230860 Michael Hanselmann
667 27e336af Michael Hanselmann
# Environment for all tests
668 27e336af Michael Hanselmann
PLAIN_TESTS_ENVIRONMENT = \
669 27e336af Michael Hanselmann
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
670 27e336af Michael Hanselmann
671 27e336af Michael Hanselmann
# Environment for tests run by automake
672 f848ac00 Michael Hanselmann
TESTS_ENVIRONMENT = \
673 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
674 6e06b36c Iustin Pop
675 eed5c5df Michael Hanselmann
all_python_code = \
676 01a3a718 Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
677 01a3a718 Michael Hanselmann
	$(dist_tools_SCRIPTS) \
678 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
679 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts) \
680 e8c8cf1a Michael Hanselmann
	$(python_tests) \
681 01a3a718 Michael Hanselmann
	$(pkgpython_PYTHON) \
682 2d48a3a2 Michael Hanselmann
	$(client_PYTHON) \
683 01a3a718 Michael Hanselmann
	$(hypervisor_PYTHON) \
684 01a3a718 Michael Hanselmann
	$(rapi_PYTHON) \
685 899c4d2c Michael Hanselmann
	$(server_PYTHON) \
686 0d2bf835 René Nussbaumer
	$(pytools_PYTHON) \
687 01a3a718 Michael Hanselmann
	$(http_PYTHON) \
688 01a3a718 Michael Hanselmann
	$(confd_PYTHON) \
689 dc101ecc Michael Hanselmann
	$(masterd_PYTHON) \
690 bb44b1ae Michael Hanselmann
	$(impexpd_PYTHON) \
691 c047a981 Michael Hanselmann
	$(utils_PYTHON) \
692 9f4bb951 Michael Hanselmann
	$(watcher_PYTHON) \
693 a8c68e44 Michael Hanselmann
	$(noinst_PYTHON) \
694 a8c68e44 Michael Hanselmann
	$(qa_scripts)
695 01a3a718 Michael Hanselmann
696 eed5c5df Michael Hanselmann
srclink_files = \
697 6be8e2bf Iustin Pop
	man/footer.rst \
698 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
699 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
700 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
701 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
702 d6159933 Iustin Pop
	$(all_python_code) \
703 c3f67183 Iustin Pop
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
704 eed5c5df Michael Hanselmann
705 eed5c5df Michael Hanselmann
check_python_code = \
706 e4e7c7df Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
707 95eb4188 Michael Hanselmann
	$(DOCPP) \
708 eed5c5df Michael Hanselmann
	$(all_python_code)
709 eed5c5df Michael Hanselmann
710 e4e7c7df Michael Hanselmann
lint_python_code = \
711 f60d352e Michael Hanselmann
	ganeti \
712 f1763373 Iustin Pop
	ganeti/http/server.py \
713 f60d352e Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
714 f60d352e Michael Hanselmann
	$(dist_tools_SCRIPTS) \
715 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
716 2cc8bdd0 Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
717 95eb4188 Michael Hanselmann
	$(DOCPP) \
718 2cc8bdd0 Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
719 eed5c5df Michael Hanselmann
720 571b34f8 Michael Hanselmann
test/daemon-util_unittest.bash: daemons/daemon-util
721 571b34f8 Michael Hanselmann
722 7172f605 Michael Hanselmann
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
723 7172f605 Michael Hanselmann
724 26916aad Apollon Oikonomopoulos
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
725 26916aad Apollon Oikonomopoulos
	sed -f $(REPLACE_VARS_SED) < $< > $@
726 26916aad Apollon Oikonomopoulos
	chmod +x $@
727 26916aad Apollon Oikonomopoulos
728 dbefcc7e Michael Hanselmann
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
729 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
730 e8230860 Michael Hanselmann
	chmod u+x $@
731 e8230860 Michael Hanselmann
732 c964d962 Michael Hanselmann
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
733 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
734 5c566e17 Michael Hanselmann
	chmod +x $@
735 e8230860 Michael Hanselmann
736 c964d962 Michael Hanselmann
doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
737 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
738 e8230860 Michael Hanselmann
739 c964d962 Michael Hanselmann
doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
740 a2442bf9 Luca Bigliardi
	sed -f $(REPLACE_VARS_SED) < $< > $@
741 a2442bf9 Luca Bigliardi
742 b959138f Michael Hanselmann
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
743 88a6ca6f Michael Hanselmann
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
744 b959138f Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
745 4f3d5b76 Michael Hanselmann
746 f86e82ef Iustin Pop
doc/%.png: doc/%.dot
747 2ab2b9f5 Iustin Pop
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
748 f86e82ef Iustin Pop
	$(DOT) -Tpng -o $@ $<
749 f86e82ef Iustin Pop
750 de8eea3e Iustin Pop
man/footer.man: man/footer.rst
751 de8eea3e Iustin Pop
	@test -n "$(PANDOC)" || \
752 de8eea3e Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
753 de8eea3e Iustin Pop
	$(PANDOC) -f rst -t man -o $@ $<
754 de8eea3e Iustin Pop
755 6be8e2bf Iustin Pop
man/footer.html: man/footer.rst
756 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
757 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
758 6be8e2bf Iustin Pop
	$(PANDOC) -f rst -t html -o $@ $<
759 6be8e2bf Iustin Pop
760 fcdb582d Michael Hanselmann
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
761 fcdb582d Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
762 fcdb582d Michael Hanselmann
763 5a19bd35 Iustin Pop
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
764 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
765 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
766 a01dd3c6 Iustin Pop
	set -o pipefail ; \
767 6be8e2bf Iustin Pop
	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
768 6be8e2bf Iustin Pop
	  sed -e 's/\\@/@/g' > $@
769 5f55173b Iustin Pop
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
770 2ab2b9f5 Iustin Pop
771 fcdb582d Michael Hanselmann
man/%.html.in: man/%.gen man/footer.html
772 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
773 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
774 a01dd3c6 Iustin Pop
	set -o pipefail ; \
775 6be8e2bf Iustin Pop
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
776 6be8e2bf Iustin Pop
	  sed -e 's/\\@/@/g' > $@
777 6be8e2bf Iustin Pop
778 5a19bd35 Iustin Pop
man/%.1: man/%.1.in $(REPLACE_VARS_SED)
779 5a19bd35 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
780 5a19bd35 Iustin Pop
781 dbefcc7e Michael Hanselmann
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
782 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
783 e8230860 Michael Hanselmann
784 dbefcc7e Michael Hanselmann
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
785 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
786 e8230860 Michael Hanselmann
787 dbefcc7e Michael Hanselmann
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
788 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
789 f29266b4 Iustin Pop
790 75f76703 Michael Hanselmann
epydoc.conf: epydoc.conf.in Makefile
791 75f76703 Michael Hanselmann
	sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
792 f774bd03 Michael Hanselmann
793 84a12e40 Iustin Pop
vcs-version:
794 84a12e40 Iustin Pop
	if test -d .git; then \
795 84a12e40 Iustin Pop
	  git describe > $@; \
796 84a12e40 Iustin Pop
	elif test ! -f $@ ; then \
797 84a12e40 Iustin Pop
	  echo "Cannot auto-generate $@ file"; exit 1; \
798 84a12e40 Iustin Pop
	fi
799 84a12e40 Iustin Pop
800 84a12e40 Iustin Pop
.PHONY: regen-vcs-version
801 84a12e40 Iustin Pop
regen-vcs-version:
802 e8230860 Michael Hanselmann
	set -e; \
803 84a12e40 Iustin Pop
	cd $(srcdir); \
804 84a12e40 Iustin Pop
	if test -d .git; then \
805 84a12e40 Iustin Pop
	  rm -f vcs-version; \
806 84a12e40 Iustin Pop
	  $(MAKE) vcs-version; \
807 84a12e40 Iustin Pop
	fi
808 84a12e40 Iustin Pop
809 d6159933 Iustin Pop
htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
810 d6159933 Iustin Pop
	set -e; \
811 d6159933 Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
812 d6159933 Iustin Pop
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
813 d6159933 Iustin Pop
814 c964d962 Michael Hanselmann
lib/_autoconf.py: Makefile vcs-version | lib/.dir
815 84a12e40 Iustin Pop
	set -e; \
816 84a12e40 Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
817 e8230860 Michael Hanselmann
	{ echo '# This file is automatically generated, do not edit!'; \
818 e8230860 Michael Hanselmann
	  echo '#'; \
819 67047322 Iustin Pop
	  echo ''; \
820 67047322 Iustin Pop
	  echo '"""Build-time configuration for Ganeti.'; \
821 67047322 Iustin Pop
	  echo '';\
822 67047322 Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
823 67047322 Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
824 67047322 Iustin Pop
	  echo 'not edit by hand).'; \
825 67047322 Iustin Pop
	  echo ''; \
826 67047322 Iustin Pop
	  echo '"""'; \
827 67047322 Iustin Pop
	  echo ''; \
828 0a4e7f24 Iustin Pop
	  echo '# pylint: disable-msg=C0301,C0324'; \
829 0a4e7f24 Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
830 0a4e7f24 Iustin Pop
	  echo '# style warnings' ; \
831 0a4e7f24 Iustin Pop
	  echo ''; \
832 e8230860 Michael Hanselmann
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
833 e8230860 Michael Hanselmann
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
834 e8230860 Michael Hanselmann
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
835 e8230860 Michael Hanselmann
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
836 e8230860 Michael Hanselmann
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
837 e8230860 Michael Hanselmann
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
838 e8230860 Michael Hanselmann
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
839 e8230860 Michael Hanselmann
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
840 553bd93f Vitaly Kuznetsov
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
841 e8230860 Michael Hanselmann
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
842 e8230860 Michael Hanselmann
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
843 2f2dbb4b Jun Futagawa
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
844 e8230860 Michael Hanselmann
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
845 e8230860 Michael Hanselmann
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
846 e8230860 Michael Hanselmann
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
847 cb7c0198 Iustin Pop
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
848 4b97f902 Apollon Oikonomopoulos
	  echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
849 4b97f902 Apollon Oikonomopoulos
	  echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
850 e8230860 Michael Hanselmann
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
851 7e2c5b9e Guido Trotter
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
852 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
853 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
854 e90739d6 Michael Hanselmann
	  echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
855 bea60381 Michael Hanselmann
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
856 bea60381 Michael Hanselmann
	  echo "TOOLSDIR = '$(toolsdir)'"; \
857 4f3d5b76 Michael Hanselmann
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
858 f154a7a3 Michael Hanselmann
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
859 89b70f39 Iustin Pop
	  echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
860 551b6283 Iustin Pop
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
861 8b72b05c René Nussbaumer
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
862 f12e1736 René Nussbaumer
	  echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
863 8b72b05c René Nussbaumer
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
864 f12e1736 René Nussbaumer
	  echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
865 8b72b05c René Nussbaumer
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
866 f12e1736 René Nussbaumer
	  echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
867 f12e1736 René Nussbaumer
	  echo "CONFD_USER = '$(CONFD_USER)'"; \
868 f12e1736 René Nussbaumer
	  echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
869 f12e1736 René Nussbaumer
	  echo "NODED_USER = '$(NODED_USER)'"; \
870 84a12e40 Iustin Pop
	  echo "VCS_VERSION = '$$VCSVER'"; \
871 3536c792 Iustin Pop
	  echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
872 e5395072 Iustin Pop
	  if [ "$(HTOOLS)" ]; then \
873 e5395072 Iustin Pop
	    echo "HTOOLS = True"; \
874 e5395072 Iustin Pop
	  else \
875 e5395072 Iustin Pop
	    echo "HTOOLS = False"; \
876 e5395072 Iustin Pop
	  fi; \
877 e8230860 Michael Hanselmann
	} > $@
878 e8230860 Michael Hanselmann
879 dbefcc7e Michael Hanselmann
$(REPLACE_VARS_SED): Makefile
880 e8230860 Michael Hanselmann
	set -e; \
881 e8230860 Michael Hanselmann
	{ echo 's#@PREFIX@#$(prefix)#g'; \
882 e8230860 Michael Hanselmann
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
883 e8230860 Michael Hanselmann
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
884 7a2ba406 Luca Bigliardi
	  echo 's#@BINDIR@#$(bindir)#g'; \
885 e8230860 Michael Hanselmann
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
886 e8230860 Michael Hanselmann
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
887 2f2dbb4b Jun Futagawa
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
888 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
889 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
890 56956bcb Iustin Pop
	  echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
891 56956bcb Iustin Pop
	  echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
892 d3b4cf9f Iustin Pop
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
893 7e1fac25 Michael Hanselmann
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
894 c5159571 Iustin Pop
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
895 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
896 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
897 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
898 0d150c50 René Nussbaumer
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
899 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
900 0d150c50 René Nussbaumer
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
901 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
902 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
903 46a8da3b René Nussbaumer
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
904 e8230860 Michael Hanselmann
	} > $@
905 e8230860 Michael Hanselmann
906 67313146 Michael Hanselmann
# Using deferred evaluation
907 899c4d2c Michael Hanselmann
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
908 9f4bb951 Michael Hanselmann
daemons/ganeti-watcher: MODULE = ganeti.watcher
909 67313146 Michael Hanselmann
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
910 0d2bf835 René Nussbaumer
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
911 67313146 Michael Hanselmann
912 c964d962 Michael Hanselmann
$(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
913 67313146 Michael Hanselmann
	test -n "$(MODULE)" || { echo Missing module; exit 1; }
914 2d48a3a2 Michael Hanselmann
	set -e; \
915 d75e738e Michael Hanselmann
	{ echo '#!/usr/bin/python'; \
916 2d48a3a2 Michael Hanselmann
	  echo '# This file is automatically generated, do not edit!'; \
917 67313146 Michael Hanselmann
	  echo "# Edit $(MODULE) instead."; \
918 2d48a3a2 Michael Hanselmann
	  echo; \
919 67313146 Michael Hanselmann
	  echo '"""Bootstrap script for L{$(MODULE)}"""'; \
920 2d48a3a2 Michael Hanselmann
	  echo; \
921 2d48a3a2 Michael Hanselmann
	  echo '# pylint: disable-msg=C0103'; \
922 2d48a3a2 Michael Hanselmann
	  echo '# C0103: Invalid name'; \
923 2d48a3a2 Michael Hanselmann
	  echo; \
924 2d48a3a2 Michael Hanselmann
	  echo 'import sys'; \
925 67313146 Michael Hanselmann
	  echo 'import $(MODULE) as main'; \
926 2d48a3a2 Michael Hanselmann
	  echo; \
927 2d48a3a2 Michael Hanselmann
	  echo '# Temporarily alias commands until bash completion'; \
928 2d48a3a2 Michael Hanselmann
	  echo '# generator is changed'; \
929 67313146 Michael Hanselmann
	  echo 'if hasattr(main, "commands"):'; \
930 2cc8bdd0 Michael Hanselmann
		echo '  commands = main.commands # pylint: disable-msg=E1101'; \
931 2d48a3a2 Michael Hanselmann
	  echo; \
932 2d48a3a2 Michael Hanselmann
	  echo 'if __name__ == "__main__":'; \
933 67313146 Michael Hanselmann
	  echo '  sys.exit(main.Main())'; \
934 2d48a3a2 Michael Hanselmann
	} > $@
935 2d48a3a2 Michael Hanselmann
	chmod u+x $@
936 2d48a3a2 Michael Hanselmann
937 e8230860 Michael Hanselmann
# We need to create symlinks because "make distcheck" will not install Python
938 e8230860 Michael Hanselmann
# files when building.
939 c964d962 Michael Hanselmann
stamp-srclinks: Makefile | $(all_dirfiles)
940 e8230860 Michael Hanselmann
	set -e; \
941 01a3a718 Michael Hanselmann
	for i in $(srclink_files); do \
942 e8230860 Michael Hanselmann
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
943 e8230860 Michael Hanselmann
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
944 e8230860 Michael Hanselmann
		fi; \
945 e8230860 Michael Hanselmann
	done
946 dd1dfd9a Michael Hanselmann
	touch $@
947 97a37b3f Michael Hanselmann
948 9ff7e35c Michael Hanselmann
.PHONY: ganeti
949 9ff7e35c Michael Hanselmann
ganeti:
950 01f3e7b1 Iustin Pop
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
951 9ff7e35c Michael Hanselmann
952 6b997854 Michael Hanselmann
.PHONY: check-dirs
953 6b997854 Michael Hanselmann
check-dirs: $(BUILT_SOURCES)
954 0c1103d6 Iustin Pop
	@set -e; \
955 6b997854 Michael Hanselmann
	find . -type d \( \( -name . \) -o \( \
956 6b997854 Michael Hanselmann
		-name .git -o \
957 6b997854 Michael Hanselmann
		-name autom4te.cache \
958 6b997854 Michael Hanselmann
		\) -prune -o -print \) | { \
959 6b997854 Michael Hanselmann
		error=; \
960 6b997854 Michael Hanselmann
		while read dir; do \
961 6b997854 Michael Hanselmann
			case "$$dir" in \
962 6b997854 Michael Hanselmann
				$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
963 6b997854 Michael Hanselmann
				*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
964 6b997854 Michael Hanselmann
			esac; \
965 6b997854 Michael Hanselmann
		done; \
966 6b997854 Michael Hanselmann
		for dir in $(DIRS); do \
967 6b997854 Michael Hanselmann
			if ! test -d "$$dir"; then \
968 6b997854 Michael Hanselmann
				echo "Directory $$dir listed in DIRS does not exist" >&2; \
969 6b997854 Michael Hanselmann
				error=1; \
970 6b997854 Michael Hanselmann
			fi \
971 6b997854 Michael Hanselmann
		done; \
972 6b997854 Michael Hanselmann
		if test -n "$$error"; then exit 1; else exit 0; fi; \
973 6b997854 Michael Hanselmann
	}
974 6b997854 Michael Hanselmann
975 6b997854 Michael Hanselmann
check-local: check-dirs
976 eed5c5df Michael Hanselmann
	$(CHECK_PYTHON_CODE) $(check_python_code)
977 35576615 Michael Hanselmann
	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
978 7385c51d Michael Hanselmann
	$(CHECK_NEWS) < $(top_srcdir)/NEWS
979 eed5c5df Michael Hanselmann
980 e0098923 Iustin Pop
.PHONY: lint
981 c964d962 Michael Hanselmann
lint: $(BUILT_SOURCES)
982 6d7cc5ff Michael Hanselmann
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
983 6d7cc5ff Michael Hanselmann
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
984 3582eef6 Iustin Pop
	cd $(top_srcdir)/qa && \
985 3582eef6 Iustin Pop
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
986 3582eef6 Iustin Pop
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
987 e0098923 Iustin Pop
988 191ff68c Iustin Pop
.PHONY: hlint
989 c3f67183 Iustin Pop
hlint: $(HS_BUILT_SRCS)
990 191ff68c Iustin Pop
	if tty -s; then C="-c"; else C=""; fi; \
991 191ff68c Iustin Pop
	hlint --report=doc/hs-lint.html $$C htools
992 191ff68c Iustin Pop
993 84a12e40 Iustin Pop
# a dist hook rule for updating the vcs-version file; this is
994 84a12e40 Iustin Pop
# hardcoded due to where it needs to build the file...
995 84a12e40 Iustin Pop
dist-hook:
996 84a12e40 Iustin Pop
	$(MAKE) regen-vcs-version && \
997 84a12e40 Iustin Pop
	rm -f $(top_distdir)/vcs-version && \
998 84a12e40 Iustin Pop
	cp -p $(srcdir)/vcs-version $(top_distdir)
999 84a12e40 Iustin Pop
1000 84a12e40 Iustin Pop
# a distcheck hook rule for catching revision control directories
1001 b6f2e47f Iustin Pop
distcheck-hook:
1002 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1003 c6aa0c42 Michael Hanselmann
		echo "Found revision control files in final archive." 1>&2; \
1004 c6aa0c42 Michael Hanselmann
		exit 1; \
1005 c6aa0c42 Michael Hanselmann
	fi
1006 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
1007 c6aa0c42 Michael Hanselmann
		echo "Found Python byte code in final archive." 1>&2; \
1008 c6aa0c42 Michael Hanselmann
		exit 1; \
1009 c6aa0c42 Michael Hanselmann
	fi
1010 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*~' | grep .; then \
1011 c6aa0c42 Michael Hanselmann
		echo "Found backup files in final archive." 1>&2; \
1012 b6f2e47f Iustin Pop
		exit 1; \
1013 b6f2e47f Iustin Pop
	fi
1014 bf0b21da Michael Hanselmann
# Empty files or directories should not be distributed. They can cause
1015 bf0b21da Michael Hanselmann
# unnecessary warnings for packagers. Directories used by automake during
1016 bf0b21da Michael Hanselmann
# distcheck must be excluded.
1017 bf0b21da Michael Hanselmann
	if find $(top_distdir) -empty -and -not \( \
1018 bf0b21da Michael Hanselmann
			-path $(top_distdir)/_build -or \
1019 bf0b21da Michael Hanselmann
			-path $(top_distdir)/_inst \) | grep .; then \
1020 bf0b21da Michael Hanselmann
		echo "Found empty files or directories in final archive." 1>&2; \
1021 bf0b21da Michael Hanselmann
		exit 1; \
1022 bf0b21da Michael Hanselmann
	fi
1023 c7b86f6c Michael Hanselmann
	if test -n "$(BUILD_RELEASE)" && \
1024 c7b86f6c Michael Hanselmann
	   grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1025 c7b86f6c Michael Hanselmann
		echo "Found unreleased version in NEWS." >&2; \
1026 c7b86f6c Michael Hanselmann
		exit 1; \
1027 c7b86f6c Michael Hanselmann
	fi
1028 c7b86f6c Michael Hanselmann
1029 c7b86f6c Michael Hanselmann
# When building a release, stricter checks should be used
1030 e627fe09 Michael Hanselmann
distcheck-release dist-release: export BUILD_RELEASE = 1
1031 c7b86f6c Michael Hanselmann
distcheck-release: distcheck
1032 b6f2e47f Iustin Pop
1033 e627fe09 Michael Hanselmann
dist-release: dist
1034 e627fe09 Michael Hanselmann
	set -e; \
1035 e627fe09 Michael Hanselmann
	for i in $(DIST_ARCHIVES); do \
1036 e627fe09 Michael Hanselmann
		echo -n "Checking $$i ... "; \
1037 e627fe09 Michael Hanselmann
		autotools/check-tar < $$i; \
1038 e627fe09 Michael Hanselmann
		echo OK; \
1039 e627fe09 Michael Hanselmann
	done
1040 e627fe09 Michael Hanselmann
1041 8925faaa Iustin Pop
install-exec-local:
1042 0d93b082 Michael Hanselmann
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1043 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
1044 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1045 e8230860 Michael Hanselmann
1046 c964d962 Michael Hanselmann
# To avoid conflicts between directory names and other targets, a file inside
1047 c964d962 Michael Hanselmann
# the directory is used to ensure its existence.
1048 c964d962 Michael Hanselmann
%.dir:
1049 c964d962 Michael Hanselmann
	@mkdir_p@ $* && touch $@
1050 e8230860 Michael Hanselmann
1051 d128fdb6 Iustin Pop
.PHONY: apidoc
1052 a38bfce5 Iustin Pop
if WANT_HTOOLSAPIDOC
1053 a38bfce5 Iustin Pop
apidoc: py-apidoc hs-apidoc
1054 a38bfce5 Iustin Pop
else
1055 a38bfce5 Iustin Pop
apidoc: py-apidoc
1056 a38bfce5 Iustin Pop
endif
1057 a38bfce5 Iustin Pop
1058 a38bfce5 Iustin Pop
.PHONY: py-apidoc
1059 a38bfce5 Iustin Pop
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1060 b959138f Michael Hanselmann
	$(RUN_IN_TEMPDIR) epydoc -v \
1061 b959138f Michael Hanselmann
		--conf $(CURDIR)/epydoc.conf \
1062 22c5390d Iustin Pop
		--output $(CURDIR)/$(APIDOC_PY_DIR)
1063 a38bfce5 Iustin Pop
1064 a38bfce5 Iustin Pop
.PHONY: hs-apidoc
1065 c3f67183 Iustin Pop
hs-apidoc: $(HS_BUILT_SRCS)
1066 a38bfce5 Iustin Pop
	@test -n "$(HSCOLOUR)" || \
1067 a38bfce5 Iustin Pop
	    { echo 'HsColour' not found during configure; exit 1; }
1068 a38bfce5 Iustin Pop
	@test -n "$(HADDOCK)" || \
1069 a38bfce5 Iustin Pop
	    { echo 'haddock' not found during configure; exit 1; }
1070 22c5390d Iustin Pop
	rm -rf $(APIDOC_HS_DIR)/*
1071 22c5390d Iustin Pop
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools
1072 22c5390d Iustin Pop
	$(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1073 22c5390d Iustin Pop
	ln -s ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1074 a38bfce5 Iustin Pop
	set -e ; \
1075 a38bfce5 Iustin Pop
	cd htools; \
1076 c478f837 Iustin Pop
	if [ "$(HTOOLS_NOCURL)" ]; \
1077 c478f837 Iustin Pop
	then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1078 c478f837 Iustin Pop
	else OPTGHC=""; \
1079 c478f837 Iustin Pop
	fi; \
1080 c3f67183 Iustin Pop
	RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
1081 a38bfce5 Iustin Pop
	for file in $$RELSRCS; do \
1082 a38bfce5 Iustin Pop
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1083 22c5390d Iustin Pop
		$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1084 a38bfce5 Iustin Pop
	done ; \
1085 22c5390d Iustin Pop
	$(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1086 a38bfce5 Iustin Pop
		-t ganeti-htools -p haddock-prologue \
1087 a38bfce5 Iustin Pop
		--source-module="%{MODULE/.//}.html" \
1088 a38bfce5 Iustin Pop
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
1089 c478f837 Iustin Pop
		$$OPTGHC \
1090 c3f67183 Iustin Pop
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1091 d128fdb6 Iustin Pop
1092 13e720f1 Iustin Pop
.PHONY: TAGS
1093 eb732fb5 Michael Hanselmann
TAGS: $(BUILT_SOURCES)
1094 13e720f1 Iustin Pop
	rm -f TAGS
1095 74fa8200 Iustin Pop
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1096 74fa8200 Iustin Pop
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
1097 74fa8200 Iustin Pop
	  -path './qa/*.py' | \
1098 3bb5c580 Iustin Pop
	  etags -l python -
1099 13e720f1 Iustin Pop
1100 27e336af Michael Hanselmann
.PHONY: coverage
1101 b91e9518 Iustin Pop
if WANT_HTOOLS
1102 b91e9518 Iustin Pop
coverage: py-coverage hs-coverage
1103 b91e9518 Iustin Pop
else
1104 b91e9518 Iustin Pop
coverage: py-coverage
1105 b91e9518 Iustin Pop
endif
1106 b91e9518 Iustin Pop
1107 b91e9518 Iustin Pop
.PHONY: py-coverage
1108 b91e9518 Iustin Pop
py-coverage: $(BUILT_SOURCES) $(python_tests)
1109 27e336af Michael Hanselmann
	set -e; \
1110 22c5390d Iustin Pop
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1111 22c5390d Iustin Pop
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1112 22c5390d Iustin Pop
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1113 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1114 e8c8cf1a Michael Hanselmann
	$(python_tests)
1115 27e336af Michael Hanselmann
1116 b91e9518 Iustin Pop
.PHONY: hs-coverage
1117 b91e9518 Iustin Pop
hs-coverage: $(haskell_tests)
1118 b91e9518 Iustin Pop
	cd htools && rm -f *.tix *.mix && ./test
1119 22c5390d Iustin Pop
	mkdir -p $(COVERAGE_HS_DIR)
1120 22c5390d Iustin Pop
	hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL)
1121 b91e9518 Iustin Pop
	hpc report htools/test $(HPCEXCL)
1122 07dde0c1 Iustin Pop
	ln -s hpc_index.html $(COVERAGE_HS_DIR)/index.html
1123 b91e9518 Iustin Pop
1124 ec8379bd Iustin Pop
# Special "kind-of-QA" target for htools, needs special setup (all
1125 ec8379bd Iustin Pop
# tools compiled with -fhpc)
1126 ec8379bd Iustin Pop
.PHONY: live-test
1127 ec8379bd Iustin Pop
live-test: all
1128 ec8379bd Iustin Pop
	set -e ; \
1129 ec8379bd Iustin Pop
	cd htools; \
1130 ec8379bd Iustin Pop
	rm -f .hpc; ln -s ../.hpc .hpc; \
1131 ec8379bd Iustin Pop
	rm -f *.tix *.mix; \
1132 ec8379bd Iustin Pop
	./live-test.sh; \
1133 c3f67183 Iustin Pop
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1134 ec8379bd Iustin Pop
	  --output=live-test.tix ; \
1135 22c5390d Iustin Pop
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1136 22c5390d Iustin Pop
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1137 ec8379bd Iustin Pop
		--srcdir=.. $(HPCEXCL) ; \
1138 ec8379bd Iustin Pop
	hpc report --srcdir=.. live-test $(HPCEXCL)
1139 b91e9518 Iustin Pop
1140 b341b9ca Guido Trotter
commit-check: distcheck lint apidoc
1141 b341b9ca Guido Trotter
1142 3baa809c Michael Hanselmann
-include ./Makefile.local
1143 3baa809c Michael Hanselmann
1144 e8230860 Michael Hanselmann
# vim: set noet :