Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 84a12e40

History | View | Annotate | Download (18 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 6e06b36c Iustin Pop
ACLOCAL_AMFLAGS = -I autotools
13 e8230860 Michael Hanselmann
DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
14 4f3d5b76 Michael Hanselmann
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
15 b959138f Michael Hanselmann
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
16 eed5c5df Michael Hanselmann
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
17 a4f12da4 Michael Hanselmann
CHECK_MAN = $(top_srcdir)/autotools/check-man
18 e8230860 Michael Hanselmann
REPLACE_VARS_SED = autotools/replace_vars.sed
19 e8230860 Michael Hanselmann
20 e8230860 Michael Hanselmann
hypervisordir = $(pkgpythondir)/hypervisor
21 ff9efc03 Michael Hanselmann
httpdir = $(pkgpythondir)/http
22 dc101ecc Michael Hanselmann
masterddir = $(pkgpythondir)/masterd
23 12426ae1 Guido Trotter
confddir = $(pkgpythondir)/confd
24 8c229cc7 Oleksiy Mishchenko
rapidir = $(pkgpythondir)/rapi
25 bb44b1ae Michael Hanselmann
impexpddir = $(pkgpythondir)/impexpd
26 e8230860 Michael Hanselmann
toolsdir = $(pkglibdir)/tools
27 e8230860 Michael Hanselmann
docdir = $(datadir)/doc/$(PACKAGE)
28 e8230860 Michael Hanselmann
29 a4f12da4 Michael Hanselmann
# Delete output file if an error occurred while building it
30 a4f12da4 Michael Hanselmann
.DELETE_ON_ERROR:
31 a4f12da4 Michael Hanselmann
32 e8230860 Michael Hanselmann
DIRS = \
33 e8230860 Michael Hanselmann
	autotools \
34 e8230860 Michael Hanselmann
	daemons \
35 e8230860 Michael Hanselmann
	devel \
36 e8230860 Michael Hanselmann
	doc \
37 e8230860 Michael Hanselmann
	doc/examples \
38 d6d9ce45 Guido Trotter
	doc/examples/hooks \
39 c51580b3 Guido Trotter
	doc/examples/gnt-debug \
40 e8230860 Michael Hanselmann
	lib \
41 f9897b6d Michael Hanselmann
	lib/build \
42 2f16ea8f Michael Hanselmann
	lib/confd \
43 ff9efc03 Michael Hanselmann
	lib/http \
44 e8230860 Michael Hanselmann
	lib/hypervisor \
45 bb44b1ae Michael Hanselmann
	lib/impexpd \
46 dc101ecc Michael Hanselmann
	lib/masterd \
47 8c229cc7 Oleksiy Mishchenko
	lib/rapi \
48 e8230860 Michael Hanselmann
	man \
49 e8230860 Michael Hanselmann
	qa \
50 e8230860 Michael Hanselmann
	scripts \
51 e8230860 Michael Hanselmann
	test \
52 e8230860 Michael Hanselmann
	test/data \
53 e8230860 Michael Hanselmann
	tools
54 e8230860 Michael Hanselmann
55 6b997854 Michael Hanselmann
BUILDTIME_DIRS = \
56 6b997854 Michael Hanselmann
	doc/api \
57 6b997854 Michael Hanselmann
	doc/coverage \
58 6b997854 Michael Hanselmann
	doc/html
59 6b997854 Michael Hanselmann
60 6b997854 Michael Hanselmann
DIRCHECK_EXCLUDE = \
61 6b997854 Michael Hanselmann
	$(BUILDTIME_DIRS) \
62 6b997854 Michael Hanselmann
	ganeti-[0-9]*.[0-9]*.[0-9]* \
63 6b997854 Michael Hanselmann
	doc/html/_*
64 6b997854 Michael Hanselmann
65 2ab2b9f5 Iustin Pop
MAINTAINERCLEANFILES = \
66 d17e74b4 Iustin Pop
	$(docpng) \
67 b76aac08 Michael Hanselmann
	$(maninput) \
68 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
69 84a12e40 Iustin Pop
	doc/news.rst \
70 84a12e40 Iustin Pop
	vcs-version
71 2ab2b9f5 Iustin Pop
72 d17e74b4 Iustin Pop
maintainer-clean-local:
73 6b997854 Michael Hanselmann
	rm -rf $(BUILDTIME_DIRS)
74 d17e74b4 Iustin Pop
75 e8230860 Michael Hanselmann
CLEANFILES = \
76 2f16ea8f Michael Hanselmann
	$(addsuffix /*.py[co],$(DIRS)) \
77 e8230860 Michael Hanselmann
	autotools/replace_vars.sed \
78 f154a7a3 Michael Hanselmann
	daemons/daemon-util \
79 46a8da3b René Nussbaumer
	daemons/ensure-dirs \
80 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner \
81 e8230860 Michael Hanselmann
	devel/upload \
82 f72f8622 Iustin Pop
	doc/examples/bash_completion \
83 e8230860 Michael Hanselmann
	doc/examples/ganeti.initd \
84 e8230860 Michael Hanselmann
	doc/examples/ganeti.cron \
85 679008e7 Iustin Pop
	doc/examples/gnt-config-backup \
86 a2442bf9 Luca Bigliardi
	doc/examples/hooks/ipsec \
87 2ab2b9f5 Iustin Pop
	$(man_MANS) \
88 2ab2b9f5 Iustin Pop
	$(manhtml) \
89 e8230860 Michael Hanselmann
	stamp-directories \
90 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
91 e8230860 Michael Hanselmann
	$(nodist_pkgpython_PYTHON)
92 e8230860 Michael Hanselmann
93 dc7d2c49 Michael Hanselmann
BUILT_SOURCES = \
94 dc7d2c49 Michael Hanselmann
	ganeti \
95 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
96 dbefcc7e Michael Hanselmann
	stamp-directories \
97 dc7d2c49 Michael Hanselmann
	lib/_autoconf.py
98 dc7d2c49 Michael Hanselmann
99 e8230860 Michael Hanselmann
nodist_pkgpython_PYTHON = \
100 e8230860 Michael Hanselmann
	lib/_autoconf.py
101 e8230860 Michael Hanselmann
102 f9897b6d Michael Hanselmann
noinst_PYTHON = \
103 f9897b6d Michael Hanselmann
	lib/build/__init__.py
104 f9897b6d Michael Hanselmann
105 e8230860 Michael Hanselmann
pkgpython_PYTHON = \
106 e8230860 Michael Hanselmann
	lib/__init__.py \
107 a8a76bc2 Guido Trotter
	lib/asyncnotifier.py \
108 e8230860 Michael Hanselmann
	lib/backend.py \
109 e8230860 Michael Hanselmann
	lib/bdev.py \
110 e8230860 Michael Hanselmann
	lib/bootstrap.py \
111 e8230860 Michael Hanselmann
	lib/cli.py \
112 e8230860 Michael Hanselmann
	lib/cmdlib.py \
113 cea881e5 Michael Hanselmann
	lib/compat.py \
114 e8230860 Michael Hanselmann
	lib/config.py \
115 e8230860 Michael Hanselmann
	lib/constants.py \
116 821d9e43 Michael Hanselmann
	lib/daemon.py \
117 e8230860 Michael Hanselmann
	lib/errors.py \
118 e8230860 Michael Hanselmann
	lib/jqueue.py \
119 8b537bb0 Michael Hanselmann
	lib/jstore.py \
120 e8230860 Michael Hanselmann
	lib/locking.py \
121 e8230860 Michael Hanselmann
	lib/luxi.py \
122 e8230860 Michael Hanselmann
	lib/mcpu.py \
123 a744b676 Manuel Franceschini
	lib/netutils.py \
124 e8230860 Michael Hanselmann
	lib/objects.py \
125 e8230860 Michael Hanselmann
	lib/opcodes.py \
126 e8230860 Michael Hanselmann
	lib/rpc.py \
127 e8230860 Michael Hanselmann
	lib/serializer.py \
128 e8230860 Michael Hanselmann
	lib/ssconf.py \
129 e8230860 Michael Hanselmann
	lib/ssh.py \
130 ac2d0fe4 Michael Hanselmann
	lib/storage.py \
131 76094e37 Michael Hanselmann
	lib/utils.py \
132 1338f2b4 Balazs Lecz
	lib/uidpool.py \
133 76094e37 Michael Hanselmann
	lib/workerpool.py
134 e8230860 Michael Hanselmann
135 e8230860 Michael Hanselmann
hypervisor_PYTHON = \
136 e8230860 Michael Hanselmann
	lib/hypervisor/__init__.py \
137 e8230860 Michael Hanselmann
	lib/hypervisor/hv_base.py \
138 48297fa2 Iustin Pop
	lib/hypervisor/hv_chroot.py \
139 e8230860 Michael Hanselmann
	lib/hypervisor/hv_fake.py \
140 eb58f9b1 Guido Trotter
	lib/hypervisor/hv_kvm.py \
141 4b5e40a5 Iustin Pop
	lib/hypervisor/hv_lxc.py \
142 e8230860 Michael Hanselmann
	lib/hypervisor/hv_xen.py
143 e8230860 Michael Hanselmann
144 8c229cc7 Oleksiy Mishchenko
rapi_PYTHON = \
145 8c229cc7 Oleksiy Mishchenko
	lib/rapi/__init__.py \
146 10b207d4 Oleksiy Mishchenko
	lib/rapi/baserlib.py \
147 95ab4de9 David Knowles
	lib/rapi/client.py \
148 20b509de Michael Hanselmann
	lib/rapi/client_utils.py \
149 10b207d4 Oleksiy Mishchenko
	lib/rapi/connector.py \
150 10b207d4 Oleksiy Mishchenko
	lib/rapi/rlib2.py
151 8c229cc7 Oleksiy Mishchenko
152 ff9efc03 Michael Hanselmann
http_PYTHON = \
153 02cab3e7 Michael Hanselmann
	lib/http/__init__.py \
154 be500c29 Michael Hanselmann
	lib/http/auth.py \
155 02cab3e7 Michael Hanselmann
	lib/http/client.py \
156 02cab3e7 Michael Hanselmann
	lib/http/server.py
157 ff9efc03 Michael Hanselmann
158 12426ae1 Guido Trotter
confd_PYTHON = \
159 71f27d19 Guido Trotter
	lib/confd/__init__.py \
160 e4ccf6cd Guido Trotter
	lib/confd/client.py \
161 2f16ea8f Michael Hanselmann
	lib/confd/querylib.py \
162 2f16ea8f Michael Hanselmann
	lib/confd/server.py
163 8c229cc7 Oleksiy Mishchenko
164 dc101ecc Michael Hanselmann
masterd_PYTHON = \
165 033a1d00 Michael Hanselmann
	lib/masterd/__init__.py \
166 033a1d00 Michael Hanselmann
	lib/masterd/instance.py
167 dc101ecc Michael Hanselmann
168 bb44b1ae Michael Hanselmann
impexpd_PYTHON = \
169 bb44b1ae Michael Hanselmann
	lib/impexpd/__init__.py
170 bb44b1ae Michael Hanselmann
171 f05c99f3 Michael Hanselmann
docrst = \
172 ffa6869f Iustin Pop
	doc/admin.rst \
173 5c0c1eeb Iustin Pop
	doc/design-2.0.rst \
174 4f366caf Michael Hanselmann
	doc/design-2.1.rst \
175 e56bb0e8 Guido Trotter
	doc/design-2.2.rst \
176 d9bdffc3 René Nussbaumer
	doc/cluster-merge.rst \
177 62947ebb Michael Hanselmann
	doc/devnotes.rst \
178 e2078d28 Iustin Pop
	doc/glossary.rst \
179 4d6443f4 Iustin Pop
	doc/hooks.rst \
180 876860a3 Iustin Pop
	doc/iallocator.rst \
181 d17e74b4 Iustin Pop
	doc/index.rst \
182 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
183 28e15341 Iustin Pop
	doc/install.rst \
184 9725b53d Michael Hanselmann
	doc/locking.rst \
185 6bf273d5 Michael Hanselmann
	doc/move-instance.rst \
186 c71a1a3d Iustin Pop
	doc/news.rst \
187 6d81475c Iustin Pop
	doc/rapi.rst \
188 b76aac08 Michael Hanselmann
	doc/security.rst \
189 c71a1a3d Iustin Pop
	doc/walkthrough.rst
190 f05c99f3 Michael Hanselmann
191 13de7d59 Michael Hanselmann
doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
192 d17e74b4 Iustin Pop
	@test -n "$(SPHINX)" || \
193 d17e74b4 Iustin Pop
	    { echo 'sphinx-build' not found during configure; exit 1; }
194 e7f6524c Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
195 13de7d59 Michael Hanselmann
	    -d . \
196 d17e74b4 Iustin Pop
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
197 d17e74b4 Iustin Pop
	    -D release="$(PACKAGE_VERSION)" \
198 13de7d59 Michael Hanselmann
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
199 13de7d59 Michael Hanselmann
	rm -f doc/html/.buildinfo doc/html/objects.inv
200 13de7d59 Michael Hanselmann
	touch $@
201 13de7d59 Michael Hanselmann
202 13de7d59 Michael Hanselmann
doc/html: doc/html/.stamp
203 2ab2b9f5 Iustin Pop
204 b76aac08 Michael Hanselmann
doc/news.rst: NEWS
205 b76aac08 Michael Hanselmann
	set -e; \
206 b76aac08 Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
207 b76aac08 Michael Hanselmann
	  echo '.. Do not edit.'; \
208 b76aac08 Michael Hanselmann
	  echo; \
209 b76aac08 Michael Hanselmann
	  cat $<; \
210 b76aac08 Michael Hanselmann
	} > $@
211 b76aac08 Michael Hanselmann
212 cbf3d64b Michael Hanselmann
doc/install-quick.rst: INSTALL
213 cbf3d64b Michael Hanselmann
	set -e; \
214 cbf3d64b Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
215 cbf3d64b Michael Hanselmann
	  echo '.. Do not edit.'; \
216 cbf3d64b Michael Hanselmann
	  echo; \
217 cbf3d64b Michael Hanselmann
	  cat $<; \
218 cbf3d64b Michael Hanselmann
	} > $@
219 cbf3d64b Michael Hanselmann
220 b8195800 Iustin Pop
docdot = \
221 ca9ccea8 Michael Hanselmann
	doc/arch-2.0.dot \
222 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-acquire.dot \
223 ca9ccea8 Michael Hanselmann
	doc/design-2.1-lock-release.dot
224 b8195800 Iustin Pop
225 d17e74b4 Iustin Pop
docpng = $(patsubst %.dot,%.png,$(docdot))
226 e8230860 Michael Hanselmann
227 7e1ccbe0 Michael Hanselmann
# Things to build but not to install (add it to EXTRA_DIST if it should be
228 7e1ccbe0 Michael Hanselmann
# distributed)
229 7e1ccbe0 Michael Hanselmann
noinst_DATA = \
230 7e1ccbe0 Michael Hanselmann
	devel/upload \
231 7e1ccbe0 Michael Hanselmann
	doc/html \
232 7e1ccbe0 Michael Hanselmann
	doc/examples/bash_completion \
233 7e1ccbe0 Michael Hanselmann
	doc/examples/ganeti.cron \
234 7e1ccbe0 Michael Hanselmann
	doc/examples/ganeti.initd \
235 679008e7 Iustin Pop
	doc/examples/gnt-config-backup \
236 7e1ccbe0 Michael Hanselmann
	doc/examples/hooks/ipsec \
237 7e1ccbe0 Michael Hanselmann
	$(manhtml)
238 f29266b4 Iustin Pop
239 4f3d5b76 Michael Hanselmann
gnt_scripts = \
240 e8230860 Michael Hanselmann
	scripts/gnt-backup \
241 e8230860 Michael Hanselmann
	scripts/gnt-cluster \
242 e8230860 Michael Hanselmann
	scripts/gnt-debug \
243 e8230860 Michael Hanselmann
	scripts/gnt-instance \
244 e8230860 Michael Hanselmann
	scripts/gnt-job \
245 e8230860 Michael Hanselmann
	scripts/gnt-node \
246 e8230860 Michael Hanselmann
	scripts/gnt-os
247 e8230860 Michael Hanselmann
248 4f3d5b76 Michael Hanselmann
dist_sbin_SCRIPTS = \
249 4f3d5b76 Michael Hanselmann
	daemons/ganeti-noded \
250 4f3d5b76 Michael Hanselmann
	daemons/ganeti-watcher \
251 4f3d5b76 Michael Hanselmann
	daemons/ganeti-masterd \
252 4f3d5b76 Michael Hanselmann
	daemons/ganeti-confd \
253 4f3d5b76 Michael Hanselmann
	daemons/ganeti-rapi \
254 4f3d5b76 Michael Hanselmann
	$(gnt_scripts)
255 4f3d5b76 Michael Hanselmann
256 fc3fd894 Michael Hanselmann
nodist_sbin_SCRIPTS = \
257 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner
258 fc3fd894 Michael Hanselmann
259 e8230860 Michael Hanselmann
dist_tools_SCRIPTS = \
260 e8230860 Michael Hanselmann
	tools/burnin \
261 e8230860 Michael Hanselmann
	tools/cfgshell \
262 e8230860 Michael Hanselmann
	tools/cfgupgrade \
263 b5672ea0 Iustin Pop
	tools/cfgupgrade12 \
264 1f7d3f7d René Nussbaumer
	tools/cluster-merge \
265 ea5fd476 Iustin Pop
	tools/lvmstrap \
266 6bf273d5 Michael Hanselmann
	tools/move-instance \
267 ea5fd476 Iustin Pop
	tools/sanitize-config
268 e8230860 Michael Hanselmann
269 2d76b580 Michael Hanselmann
pkglib_python_scripts = \
270 c6ccba7e Michael Hanselmann
	daemons/import-export \
271 c6ccba7e Michael Hanselmann
	tools/check-cert-expired
272 2d76b580 Michael Hanselmann
273 f154a7a3 Michael Hanselmann
pkglib_SCRIPTS = \
274 2d76b580 Michael Hanselmann
	daemons/daemon-util \
275 46a8da3b René Nussbaumer
	daemons/ensure-dirs \
276 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts)
277 f154a7a3 Michael Hanselmann
278 e8230860 Michael Hanselmann
EXTRA_DIST = \
279 e8230860 Michael Hanselmann
	NEWS \
280 70c771f6 Michael Hanselmann
	pylintrc \
281 bb46a96c Michael Hanselmann
	autotools/build-bash-completion \
282 eed5c5df Michael Hanselmann
	autotools/check-python-code \
283 a4f12da4 Michael Hanselmann
	autotools/check-man \
284 e8230860 Michael Hanselmann
	autotools/docbook-wrapper \
285 27e336af Michael Hanselmann
	autotools/gen-coverage \
286 e8c8cf1a Michael Hanselmann
	autotools/testrunner \
287 f3313af5 Guido Trotter
	$(RUN_IN_TEMPDIR) \
288 f154a7a3 Michael Hanselmann
	daemons/daemon-util.in \
289 46a8da3b René Nussbaumer
	daemons/ensure-dirs.in \
290 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner.in \
291 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
292 e8230860 Michael Hanselmann
	devel/upload.in \
293 b8195800 Iustin Pop
	$(docdot) \
294 f727d134 Michael Hanselmann
	$(docpng) \
295 d17e74b4 Iustin Pop
	$(docrst) \
296 d17e74b4 Iustin Pop
	doc/conf.py \
297 d17e74b4 Iustin Pop
	doc/html \
298 e8230860 Michael Hanselmann
	doc/examples/ganeti.initd.in \
299 e8230860 Michael Hanselmann
	doc/examples/ganeti.cron.in \
300 679008e7 Iustin Pop
	doc/examples/gnt-config-backup.in \
301 e8230860 Michael Hanselmann
	doc/examples/dumb-allocator \
302 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default \
303 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default-debug \
304 d6d9ce45 Guido Trotter
	doc/examples/hooks/ethers \
305 a2442bf9 Luca Bigliardi
	doc/examples/hooks/ipsec.in \
306 89c04c2d Guido Trotter
	doc/examples/gnt-debug/README \
307 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay0.json \
308 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay50.json \
309 e8230860 Michael Hanselmann
	test/testutils.py \
310 e8230860 Michael Hanselmann
	test/mocks.py \
311 e8230860 Michael Hanselmann
	$(dist_TESTS) \
312 e8230860 Michael Hanselmann
	$(TEST_FILES) \
313 e8230860 Michael Hanselmann
	man/footer.sgml \
314 f727d134 Michael Hanselmann
	$(mansgml) \
315 f727d134 Michael Hanselmann
	$(maninput) \
316 e8230860 Michael Hanselmann
	qa/ganeti-qa.py \
317 39e0d19e Michael Hanselmann
	qa/qa-sample.json \
318 e8230860 Michael Hanselmann
	qa/qa_cluster.py \
319 e8230860 Michael Hanselmann
	qa/qa_config.py \
320 e8230860 Michael Hanselmann
	qa/qa_daemon.py \
321 e8230860 Michael Hanselmann
	qa/qa_env.py \
322 e8230860 Michael Hanselmann
	qa/qa_error.py \
323 e8230860 Michael Hanselmann
	qa/qa_instance.py \
324 e8230860 Michael Hanselmann
	qa/qa_node.py \
325 e8230860 Michael Hanselmann
	qa/qa_os.py \
326 a47f574c Oleksiy Mishchenko
	qa/qa_rapi.py \
327 e8230860 Michael Hanselmann
	qa/qa_tags.py \
328 e8230860 Michael Hanselmann
	qa/qa_utils.py
329 e8230860 Michael Hanselmann
330 e8230860 Michael Hanselmann
man_MANS = \
331 e8230860 Michael Hanselmann
	man/ganeti.7 \
332 bae7e531 Michael Hanselmann
	man/ganeti-cleaner.8 \
333 b7b7cda6 Guido Trotter
	man/ganeti-confd.8 \
334 320d986d Iustin Pop
	man/ganeti-masterd.8 \
335 e8230860 Michael Hanselmann
	man/ganeti-noded.8 \
336 e8230860 Michael Hanselmann
	man/ganeti-os-interface.7 \
337 320d986d Iustin Pop
	man/ganeti-rapi.8 \
338 e8230860 Michael Hanselmann
	man/ganeti-watcher.8 \
339 e8230860 Michael Hanselmann
	man/gnt-backup.8 \
340 e8230860 Michael Hanselmann
	man/gnt-cluster.8 \
341 d3b4cf9f Iustin Pop
	man/gnt-debug.8 \
342 e8230860 Michael Hanselmann
	man/gnt-instance.8 \
343 d3b4cf9f Iustin Pop
	man/gnt-job.8 \
344 e8230860 Michael Hanselmann
	man/gnt-node.8 \
345 e8230860 Michael Hanselmann
	man/gnt-os.8
346 e8230860 Michael Hanselmann
347 2ab2b9f5 Iustin Pop
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
348 2ab2b9f5 Iustin Pop
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
349 25c92bc5 Michael Hanselmann
maninput = \
350 25c92bc5 Michael Hanselmann
	$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
351 25c92bc5 Michael Hanselmann
	$(patsubst %.html,%.html.in,$(manhtml))
352 e8230860 Michael Hanselmann
353 e8230860 Michael Hanselmann
TEST_FILES = \
354 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.0.txt \
355 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.3.txt \
356 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-disk.txt \
357 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip4.txt \
358 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip6.txt \
359 27e46076 Michael Hanselmann
	test/data/cert1.pem \
360 d816408a Iustin Pop
	test/data/proc_drbd8.txt \
361 a6ac80db Iustin Pop
	test/data/proc_drbd80-emptyline.txt \
362 2d76b580 Michael Hanselmann
	test/data/proc_drbd83.txt \
363 549071a0 Luca Bigliardi
	test/data/sys_drbd_usermode_helper.txt \
364 2d76b580 Michael Hanselmann
	test/import-export_unittest-helper
365 e8230860 Michael Hanselmann
366 e8c8cf1a Michael Hanselmann
python_tests = \
367 17496050 Guido Trotter
	test/ganeti.asyncnotifier_unittest.py \
368 f942a838 Michael Hanselmann
	test/ganeti.backend_unittest.py \
369 6de7c41d Iustin Pop
	test/ganeti.bdev_unittest.py \
370 6de7c41d Iustin Pop
	test/ganeti.cli_unittest.py \
371 1118ec44 Guido Trotter
	test/ganeti.daemon_unittest.py \
372 6de7c41d Iustin Pop
	test/ganeti.cmdlib_unittest.py \
373 cea881e5 Michael Hanselmann
	test/ganeti.compat_unittest.py \
374 edf7d66e Iustin Pop
	test/ganeti.confd.client_unittest.py \
375 e8230860 Michael Hanselmann
	test/ganeti.config_unittest.py \
376 6de7c41d Iustin Pop
	test/ganeti.constants_unittest.py \
377 3bd19c66 Michael Hanselmann
	test/ganeti.errors_unittest.py \
378 e8230860 Michael Hanselmann
	test/ganeti.hooks_unittest.py \
379 6de7c41d Iustin Pop
	test/ganeti.http_unittest.py \
380 748e4b5a Michael Hanselmann
	test/ganeti.hypervisor.hv_kvm_unittest.py \
381 bb44b1ae Michael Hanselmann
	test/ganeti.impexpd_unittest.py \
382 989a8bee Michael Hanselmann
	test/ganeti.jqueue_unittest.py \
383 e8230860 Michael Hanselmann
	test/ganeti.locking_unittest.py \
384 231db3a5 Michael Hanselmann
	test/ganeti.luxi_unittest.py \
385 033a1d00 Michael Hanselmann
	test/ganeti.masterd.instance_unittest.py \
386 407339d0 Michael Hanselmann
	test/ganeti.mcpu_unittest.py \
387 a744b676 Manuel Franceschini
	test/ganeti.netutils_unittest.py \
388 4c14965f Guido Trotter
	test/ganeti.objects_unittest.py \
389 c32b908e Michael Hanselmann
	test/ganeti.opcodes_unittest.py \
390 95ab4de9 David Knowles
	test/ganeti.rapi.client_unittest.py \
391 4cbd4462 Oleksiy Mishchenko
	test/ganeti.rapi.resources_unittest.py \
392 6395cebb Michael Hanselmann
	test/ganeti.rapi.rlib2_unittest.py \
393 33231500 Michael Hanselmann
	test/ganeti.rpc_unittest.py \
394 6de7c41d Iustin Pop
	test/ganeti.serializer_unittest.py \
395 6de7c41d Iustin Pop
	test/ganeti.ssh_unittest.py \
396 93be53da Balazs Lecz
	test/ganeti.uidpool_unittest.py \
397 6de7c41d Iustin Pop
	test/ganeti.utils_unittest.py \
398 4b6fa0bf Luca Bigliardi
	test/ganeti.utils_mlockall_unittest.py \
399 3f991867 Michael Hanselmann
	test/ganeti.workerpool_unittest.py \
400 aefbe369 Michael Hanselmann
	test/cfgupgrade_unittest.py \
401 055f822b Michael Hanselmann
	test/docs_unittest.py \
402 055f822b Michael Hanselmann
	test/tempfile_fork_unittest.py
403 e8230860 Michael Hanselmann
404 e8c8cf1a Michael Hanselmann
dist_TESTS = \
405 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
406 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
407 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
408 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
409 e8c8cf1a Michael Hanselmann
	$(python_tests)
410 e8c8cf1a Michael Hanselmann
411 e8230860 Michael Hanselmann
nodist_TESTS =
412 e8230860 Michael Hanselmann
413 e8230860 Michael Hanselmann
TESTS = $(dist_TESTS) $(nodist_TESTS)
414 e8230860 Michael Hanselmann
415 27e336af Michael Hanselmann
# Environment for all tests
416 27e336af Michael Hanselmann
PLAIN_TESTS_ENVIRONMENT = \
417 27e336af Michael Hanselmann
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
418 27e336af Michael Hanselmann
419 27e336af Michael Hanselmann
# Environment for tests run by automake
420 f848ac00 Michael Hanselmann
TESTS_ENVIRONMENT = \
421 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
422 6e06b36c Iustin Pop
423 eed5c5df Michael Hanselmann
all_python_code = \
424 01a3a718 Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
425 01a3a718 Michael Hanselmann
	$(dist_tools_SCRIPTS) \
426 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
427 e8c8cf1a Michael Hanselmann
	$(python_tests) \
428 01a3a718 Michael Hanselmann
	$(pkgpython_PYTHON) \
429 01a3a718 Michael Hanselmann
	$(hypervisor_PYTHON) \
430 01a3a718 Michael Hanselmann
	$(rapi_PYTHON) \
431 01a3a718 Michael Hanselmann
	$(http_PYTHON) \
432 01a3a718 Michael Hanselmann
	$(confd_PYTHON) \
433 dc101ecc Michael Hanselmann
	$(masterd_PYTHON) \
434 bb44b1ae Michael Hanselmann
	$(impexpd_PYTHON) \
435 01a3a718 Michael Hanselmann
	$(noinst_PYTHON)
436 01a3a718 Michael Hanselmann
437 eed5c5df Michael Hanselmann
srclink_files = \
438 eed5c5df Michael Hanselmann
	man/footer.sgml \
439 7172f605 Michael Hanselmann
	test/check-cert-expired_unittest.bash \
440 571b34f8 Michael Hanselmann
	test/daemon-util_unittest.bash \
441 7172f605 Michael Hanselmann
	test/ganeti-cleaner_unittest.bash \
442 2d76b580 Michael Hanselmann
	test/import-export_unittest.bash \
443 eed5c5df Michael Hanselmann
	$(all_python_code)
444 eed5c5df Michael Hanselmann
445 eed5c5df Michael Hanselmann
check_python_code = \
446 e4e7c7df Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
447 eed5c5df Michael Hanselmann
	$(all_python_code)
448 eed5c5df Michael Hanselmann
449 e4e7c7df Michael Hanselmann
lint_python_code = \
450 f60d352e Michael Hanselmann
	ganeti \
451 f60d352e Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
452 f60d352e Michael Hanselmann
	$(dist_tools_SCRIPTS) \
453 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
454 f60d352e Michael Hanselmann
	$(BUILD_BASH_COMPLETION)
455 eed5c5df Michael Hanselmann
456 571b34f8 Michael Hanselmann
test/daemon-util_unittest.bash: daemons/daemon-util
457 571b34f8 Michael Hanselmann
458 7172f605 Michael Hanselmann
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
459 7172f605 Michael Hanselmann
460 dbefcc7e Michael Hanselmann
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
461 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
462 e8230860 Michael Hanselmann
	chmod u+x $@
463 e8230860 Michael Hanselmann
464 f154a7a3 Michael Hanselmann
daemons/%: daemons/%.in \
465 e8230860 Michael Hanselmann
		$(REPLACE_VARS_SED)
466 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
467 5c566e17 Michael Hanselmann
	chmod +x $@
468 e8230860 Michael Hanselmann
469 dbefcc7e Michael Hanselmann
doc/examples/%: doc/examples/%.in \
470 e8230860 Michael Hanselmann
		$(REPLACE_VARS_SED)
471 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
472 e8230860 Michael Hanselmann
473 dbefcc7e Michael Hanselmann
doc/examples/hooks/%: doc/examples/hooks/%.in \
474 a2442bf9 Luca Bigliardi
		$(REPLACE_VARS_SED)
475 a2442bf9 Luca Bigliardi
	sed -f $(REPLACE_VARS_SED) < $< > $@
476 a2442bf9 Luca Bigliardi
477 b959138f Michael Hanselmann
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
478 4f3d5b76 Michael Hanselmann
	lib/cli.py $(gnt_scripts) tools/burnin
479 b959138f Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
480 4f3d5b76 Michael Hanselmann
481 f86e82ef Iustin Pop
doc/%.png: doc/%.dot
482 2ab2b9f5 Iustin Pop
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
483 f86e82ef Iustin Pop
	$(DOT) -Tpng -o $@ $<
484 f86e82ef Iustin Pop
485 2ab2b9f5 Iustin Pop
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
486 25c92bc5 Michael Hanselmann
	@test -n "$(DOCBOOK2MAN)" || \
487 25c92bc5 Michael Hanselmann
	  { echo 'docbook2man' not found during configure; exit 1; }
488 434c34a5 Michael Hanselmann
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
489 5f55173b Iustin Pop
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
490 2ab2b9f5 Iustin Pop
491 2ab2b9f5 Iustin Pop
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
492 25c92bc5 Michael Hanselmann
	@test -n "$(DOCBOOK2HTML)" || \
493 25c92bc5 Michael Hanselmann
	  { echo 'docbook2html' not found during configure; exit 1; }
494 434c34a5 Michael Hanselmann
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
495 2ab2b9f5 Iustin Pop
496 dbefcc7e Michael Hanselmann
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
497 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
498 e8230860 Michael Hanselmann
499 dbefcc7e Michael Hanselmann
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
500 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
501 e8230860 Michael Hanselmann
502 dbefcc7e Michael Hanselmann
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
503 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
504 f29266b4 Iustin Pop
505 84a12e40 Iustin Pop
vcs-version:
506 84a12e40 Iustin Pop
	if test -d .git; then \
507 84a12e40 Iustin Pop
	  git describe > $@; \
508 84a12e40 Iustin Pop
	elif test ! -f $@ ; then \
509 84a12e40 Iustin Pop
	  echo "Cannot auto-generate $@ file"; exit 1; \
510 84a12e40 Iustin Pop
	fi
511 84a12e40 Iustin Pop
512 84a12e40 Iustin Pop
.PHONY: regen-vcs-version
513 84a12e40 Iustin Pop
regen-vcs-version:
514 e8230860 Michael Hanselmann
	set -e; \
515 84a12e40 Iustin Pop
	cd $(srcdir); \
516 84a12e40 Iustin Pop
	if test -d .git; then \
517 84a12e40 Iustin Pop
	  rm -f vcs-version; \
518 84a12e40 Iustin Pop
	  $(MAKE) vcs-version; \
519 84a12e40 Iustin Pop
	fi
520 84a12e40 Iustin Pop
521 84a12e40 Iustin Pop
lib/_autoconf.py: Makefile stamp-directories vcs-version
522 84a12e40 Iustin Pop
	set -e; \
523 84a12e40 Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
524 e8230860 Michael Hanselmann
	{ echo '# This file is automatically generated, do not edit!'; \
525 e8230860 Michael Hanselmann
	  echo '#'; \
526 67047322 Iustin Pop
	  echo ''; \
527 67047322 Iustin Pop
	  echo '"""Build-time configuration for Ganeti.'; \
528 67047322 Iustin Pop
	  echo '';\
529 67047322 Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
530 67047322 Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
531 67047322 Iustin Pop
	  echo 'not edit by hand).'; \
532 67047322 Iustin Pop
	  echo ''; \
533 67047322 Iustin Pop
	  echo '"""'; \
534 67047322 Iustin Pop
	  echo ''; \
535 0a4e7f24 Iustin Pop
	  echo '# pylint: disable-msg=C0301,C0324'; \
536 0a4e7f24 Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
537 0a4e7f24 Iustin Pop
	  echo '# style warnings' ; \
538 0a4e7f24 Iustin Pop
	  echo ''; \
539 e8230860 Michael Hanselmann
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
540 e8230860 Michael Hanselmann
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
541 e8230860 Michael Hanselmann
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
542 e8230860 Michael Hanselmann
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
543 e8230860 Michael Hanselmann
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
544 e8230860 Michael Hanselmann
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
545 e8230860 Michael Hanselmann
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
546 e8230860 Michael Hanselmann
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
547 553bd93f Vitaly Kuznetsov
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
548 e8230860 Michael Hanselmann
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
549 e8230860 Michael Hanselmann
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
550 2f2dbb4b Jun Futagawa
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
551 e8230860 Michael Hanselmann
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
552 e8230860 Michael Hanselmann
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
553 e8230860 Michael Hanselmann
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
554 cb7c0198 Iustin Pop
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
555 e8230860 Michael Hanselmann
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
556 7e2c5b9e Guido Trotter
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
557 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
558 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
559 bea60381 Michael Hanselmann
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
560 bea60381 Michael Hanselmann
	  echo "TOOLSDIR = '$(toolsdir)'"; \
561 4f3d5b76 Michael Hanselmann
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
562 f154a7a3 Michael Hanselmann
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
563 89b70f39 Iustin Pop
	  echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
564 551b6283 Iustin Pop
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
565 8b72b05c René Nussbaumer
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
566 8b72b05c René Nussbaumer
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
567 8b72b05c René Nussbaumer
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
568 84a12e40 Iustin Pop
	  echo "VCS_VERSION = '$$VCSVER'"; \
569 e8230860 Michael Hanselmann
	} > $@
570 e8230860 Michael Hanselmann
571 dbefcc7e Michael Hanselmann
$(REPLACE_VARS_SED): Makefile
572 e8230860 Michael Hanselmann
	set -e; \
573 e8230860 Michael Hanselmann
	{ echo 's#@PREFIX@#$(prefix)#g'; \
574 e8230860 Michael Hanselmann
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
575 e8230860 Michael Hanselmann
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
576 7a2ba406 Luca Bigliardi
	  echo 's#@BINDIR@#$(bindir)#g'; \
577 e8230860 Michael Hanselmann
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
578 e8230860 Michael Hanselmann
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
579 2f2dbb4b Jun Futagawa
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
580 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
581 e8230860 Michael Hanselmann
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
582 d3b4cf9f Iustin Pop
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
583 7e1fac25 Michael Hanselmann
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
584 c5159571 Iustin Pop
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
585 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
586 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
587 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
588 0d150c50 René Nussbaumer
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
589 0d150c50 René Nussbaumer
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
590 0d150c50 René Nussbaumer
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
591 0d150c50 René Nussbaumer
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
592 0d150c50 René Nussbaumer
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
593 46a8da3b René Nussbaumer
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
594 e8230860 Michael Hanselmann
	} > $@
595 e8230860 Michael Hanselmann
596 e8230860 Michael Hanselmann
# We need to create symlinks because "make distcheck" will not install Python
597 e8230860 Michael Hanselmann
# files when building.
598 dd1dfd9a Michael Hanselmann
stamp-srclinks: Makefile stamp-directories
599 e8230860 Michael Hanselmann
	set -e; \
600 01a3a718 Michael Hanselmann
	for i in $(srclink_files); do \
601 e8230860 Michael Hanselmann
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
602 e8230860 Michael Hanselmann
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
603 e8230860 Michael Hanselmann
		fi; \
604 e8230860 Michael Hanselmann
	done
605 dd1dfd9a Michael Hanselmann
	touch $@
606 97a37b3f Michael Hanselmann
607 9ff7e35c Michael Hanselmann
.PHONY: ganeti
608 9ff7e35c Michael Hanselmann
ganeti:
609 01f3e7b1 Iustin Pop
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
610 9ff7e35c Michael Hanselmann
611 6b997854 Michael Hanselmann
.PHONY: check-dirs
612 6b997854 Michael Hanselmann
check-dirs: $(BUILT_SOURCES)
613 0c1103d6 Iustin Pop
	@set -e; \
614 6b997854 Michael Hanselmann
	find . -type d \( \( -name . \) -o \( \
615 6b997854 Michael Hanselmann
		-name .git -o \
616 6b997854 Michael Hanselmann
		-name autom4te.cache \
617 6b997854 Michael Hanselmann
		\) -prune -o -print \) | { \
618 6b997854 Michael Hanselmann
		error=; \
619 6b997854 Michael Hanselmann
		while read dir; do \
620 6b997854 Michael Hanselmann
			case "$$dir" in \
621 6b997854 Michael Hanselmann
				$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
622 6b997854 Michael Hanselmann
				*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
623 6b997854 Michael Hanselmann
			esac; \
624 6b997854 Michael Hanselmann
		done; \
625 6b997854 Michael Hanselmann
		for dir in $(DIRS); do \
626 6b997854 Michael Hanselmann
			if ! test -d "$$dir"; then \
627 6b997854 Michael Hanselmann
				echo "Directory $$dir listed in DIRS does not exist" >&2; \
628 6b997854 Michael Hanselmann
				error=1; \
629 6b997854 Michael Hanselmann
			fi \
630 6b997854 Michael Hanselmann
		done; \
631 6b997854 Michael Hanselmann
		if test -n "$$error"; then exit 1; else exit 0; fi; \
632 6b997854 Michael Hanselmann
	}
633 6b997854 Michael Hanselmann
634 6b997854 Michael Hanselmann
check-local: check-dirs
635 eed5c5df Michael Hanselmann
	$(CHECK_PYTHON_CODE) $(check_python_code)
636 eed5c5df Michael Hanselmann
637 e0098923 Iustin Pop
.PHONY: lint
638 eb732fb5 Michael Hanselmann
lint: ganeti $(BUILT_SOURCES)
639 6d7cc5ff Michael Hanselmann
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
640 6d7cc5ff Michael Hanselmann
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
641 e0098923 Iustin Pop
642 84a12e40 Iustin Pop
# a dist hook rule for updating the vcs-version file; this is
643 84a12e40 Iustin Pop
# hardcoded due to where it needs to build the file...
644 84a12e40 Iustin Pop
dist-hook:
645 84a12e40 Iustin Pop
	$(MAKE) regen-vcs-version && \
646 84a12e40 Iustin Pop
	rm -f $(top_distdir)/vcs-version && \
647 84a12e40 Iustin Pop
	cp -p $(srcdir)/vcs-version $(top_distdir)
648 84a12e40 Iustin Pop
649 84a12e40 Iustin Pop
# a distcheck hook rule for catching revision control directories
650 b6f2e47f Iustin Pop
distcheck-hook:
651 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
652 c6aa0c42 Michael Hanselmann
		echo "Found revision control files in final archive." 1>&2; \
653 c6aa0c42 Michael Hanselmann
		exit 1; \
654 c6aa0c42 Michael Hanselmann
	fi
655 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
656 c6aa0c42 Michael Hanselmann
		echo "Found Python byte code in final archive." 1>&2; \
657 c6aa0c42 Michael Hanselmann
		exit 1; \
658 c6aa0c42 Michael Hanselmann
	fi
659 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*~' | grep .; then \
660 c6aa0c42 Michael Hanselmann
		echo "Found backup files in final archive." 1>&2; \
661 b6f2e47f Iustin Pop
		exit 1; \
662 b6f2e47f Iustin Pop
	fi
663 b6f2e47f Iustin Pop
664 8925faaa Iustin Pop
install-exec-local:
665 0d93b082 Michael Hanselmann
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
666 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
667 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/run/ganeti"
668 e8230860 Michael Hanselmann
669 e8230860 Michael Hanselmann
stamp-directories: Makefile
670 e8230860 Michael Hanselmann
	@mkdir_p@ $(DIRS)
671 e8230860 Michael Hanselmann
	touch $@
672 e8230860 Michael Hanselmann
673 d128fdb6 Iustin Pop
.PHONY: apidoc
674 eb732fb5 Michael Hanselmann
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
675 d128fdb6 Iustin Pop
	test -e doc/api || mkdir doc/api
676 b959138f Michael Hanselmann
	$(RUN_IN_TEMPDIR) epydoc -v \
677 b959138f Michael Hanselmann
		--conf $(CURDIR)/epydoc.conf \
678 b959138f Michael Hanselmann
		--output $(CURDIR)/doc/api
679 d128fdb6 Iustin Pop
680 13e720f1 Iustin Pop
.PHONY: TAGS
681 eb732fb5 Michael Hanselmann
TAGS: $(BUILT_SOURCES)
682 13e720f1 Iustin Pop
	rm -f TAGS
683 13e720f1 Iustin Pop
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
684 13e720f1 Iustin Pop
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
685 13e720f1 Iustin Pop
	  etags -
686 13e720f1 Iustin Pop
687 27e336af Michael Hanselmann
.PHONY: coverage
688 e8c8cf1a Michael Hanselmann
coverage: $(BUILT_SOURCES) $(python_tests)
689 27e336af Michael Hanselmann
	set -e; \
690 27e336af Michael Hanselmann
	mkdir -p doc/coverage; \
691 27e336af Michael Hanselmann
	COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
692 27e336af Michael Hanselmann
	TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
693 27e336af Michael Hanselmann
	HTML_COVERAGE=$(CURDIR)/doc/coverage \
694 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
695 e8c8cf1a Michael Hanselmann
	$(python_tests)
696 27e336af Michael Hanselmann
697 b341b9ca Guido Trotter
commit-check: distcheck lint apidoc
698 b341b9ca Guido Trotter
699 3baa809c Michael Hanselmann
-include ./Makefile.local
700 3baa809c Michael Hanselmann
701 e8230860 Michael Hanselmann
# vim: set noet :