268436cae0a7de0ab26c2eb985b171d8f1343e4a
[ganeti-local] / Makefile.am
1 # Ganeti makefile
2 # - Indent with tabs only.
3 # - Keep files sorted; one line per file.
4 # - Directories in lib/ must have their own *dir variable (see hypervisor).
5 # - All directories must be listed DIRS.
6 # - Use autogen.sh to generate Makefile.in and configure script.
7
8 # Automake doesn't export these variables before version 1.10.
9 abs_top_builddir = @abs_top_builddir@
10 abs_top_srcdir = @abs_top_srcdir@
11
12 ACLOCAL_AMFLAGS = -I autotools
13 DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
14 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
15 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
16 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
17 CHECK_MAN = $(top_srcdir)/autotools/check-man
18 REPLACE_VARS_SED = autotools/replace_vars.sed
19
20 hypervisordir = $(pkgpythondir)/hypervisor
21 httpdir = $(pkgpythondir)/http
22 masterddir = $(pkgpythondir)/masterd
23 confddir = $(pkgpythondir)/confd
24 rapidir = $(pkgpythondir)/rapi
25 impexpddir = $(pkgpythondir)/impexpd
26 toolsdir = $(pkglibdir)/tools
27 docdir = $(datadir)/doc/$(PACKAGE)
28
29 # Delete output file if an error occurred while building it
30 .DELETE_ON_ERROR:
31
32 DIRS = \
33         autotools \
34         daemons \
35         devel \
36         doc \
37         doc/examples \
38         doc/examples/hooks \
39         lib \
40         lib/build \
41         lib/confd \
42         lib/http \
43         lib/hypervisor \
44         lib/impexpd \
45         lib/masterd \
46         lib/rapi \
47         man \
48         qa \
49         scripts \
50         test \
51         test/data \
52         tools
53
54 MAINTAINERCLEANFILES = \
55         $(docpng) \
56         $(maninput) \
57         doc/install-quick.rst \
58         doc/news.rst
59
60 maintainer-clean-local:
61         rm -rf doc/api doc/html doc/coverage
62
63 CLEANFILES = \
64         $(addsuffix /*.py[co],$(DIRS)) \
65         autotools/replace_vars.sed \
66         daemons/daemon-util \
67         daemons/ensure-dirs \
68         daemons/ganeti-cleaner \
69         devel/upload \
70         doc/examples/bash_completion \
71         doc/examples/ganeti.initd \
72         doc/examples/ganeti.cron \
73         doc/examples/gnt-config-backup \
74         doc/examples/hooks/ipsec \
75         $(man_MANS) \
76         $(manhtml) \
77         stamp-directories \
78         stamp-srclinks \
79         $(nodist_pkgpython_PYTHON)
80
81 BUILT_SOURCES = \
82         ganeti \
83         stamp-srclinks \
84         stamp-directories \
85         lib/_autoconf.py
86
87 nodist_pkgpython_PYTHON = \
88         lib/_autoconf.py
89
90 noinst_PYTHON = \
91         lib/build/__init__.py
92
93 pkgpython_PYTHON = \
94         lib/__init__.py \
95         lib/asyncnotifier.py \
96         lib/backend.py \
97         lib/bdev.py \
98         lib/bootstrap.py \
99         lib/cli.py \
100         lib/cmdlib.py \
101         lib/compat.py \
102         lib/config.py \
103         lib/constants.py \
104         lib/daemon.py \
105         lib/errors.py \
106         lib/jqueue.py \
107         lib/jstore.py \
108         lib/locking.py \
109         lib/luxi.py \
110         lib/mcpu.py \
111         lib/objects.py \
112         lib/opcodes.py \
113         lib/rpc.py \
114         lib/serializer.py \
115         lib/ssconf.py \
116         lib/ssh.py \
117         lib/storage.py \
118         lib/utils.py \
119         lib/uidpool.py \
120         lib/workerpool.py
121
122 hypervisor_PYTHON = \
123         lib/hypervisor/__init__.py \
124         lib/hypervisor/hv_base.py \
125         lib/hypervisor/hv_chroot.py \
126         lib/hypervisor/hv_fake.py \
127         lib/hypervisor/hv_kvm.py \
128         lib/hypervisor/hv_xen.py
129
130 rapi_PYTHON = \
131         lib/rapi/__init__.py \
132         lib/rapi/baserlib.py \
133         lib/rapi/client.py \
134         lib/rapi/client_utils.py \
135         lib/rapi/connector.py \
136         lib/rapi/rlib2.py
137
138 http_PYTHON = \
139         lib/http/__init__.py \
140         lib/http/auth.py \
141         lib/http/client.py \
142         lib/http/server.py
143
144 confd_PYTHON = \
145         lib/confd/__init__.py \
146         lib/confd/client.py \
147         lib/confd/querylib.py \
148         lib/confd/server.py
149
150 masterd_PYTHON = \
151         lib/masterd/__init__.py \
152         lib/masterd/instance.py
153
154 impexpd_PYTHON = \
155         lib/impexpd/__init__.py
156
157 docrst = \
158         doc/admin.rst \
159         doc/design-2.0.rst \
160         doc/design-2.1.rst \
161         doc/design-2.2.rst \
162         doc/design-cluster-merger.rst \
163         doc/devnotes.rst \
164         doc/glossary.rst \
165         doc/hooks.rst \
166         doc/iallocator.rst \
167         doc/index.rst \
168         doc/install-quick.rst \
169         doc/install.rst \
170         doc/locking.rst \
171         doc/move-instance.rst \
172         doc/news.rst \
173         doc/rapi.rst \
174         doc/security.rst \
175         doc/walkthrough.rst
176
177 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
178         @test -n "$(SPHINX)" || \
179             { echo 'sphinx-build' not found during configure; exit 1; }
180         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
181             -d . \
182             -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
183             -D release="$(PACKAGE_VERSION)" \
184             $(abs_top_srcdir)/doc $(CURDIR)/doc/html
185         rm -f doc/html/.buildinfo doc/html/objects.inv
186         touch $@
187
188 doc/html: doc/html/.stamp
189
190 doc/news.rst: NEWS
191         set -e; \
192         { echo '.. This file is automatically updated at build time from $<.'; \
193           echo '.. Do not edit.'; \
194           echo; \
195           cat $<; \
196         } > $@
197
198 doc/install-quick.rst: INSTALL
199         set -e; \
200         { echo '.. This file is automatically updated at build time from $<.'; \
201           echo '.. Do not edit.'; \
202           echo; \
203           cat $<; \
204         } > $@
205
206 docdot = \
207         doc/arch-2.0.dot \
208         doc/design-2.1-lock-acquire.dot \
209         doc/design-2.1-lock-release.dot
210
211 docpng = $(patsubst %.dot,%.png,$(docdot))
212
213 # Things to build but not to install (add it to EXTRA_DIST if it should be
214 # distributed)
215 noinst_DATA = \
216         devel/upload \
217         doc/html \
218         doc/examples/bash_completion \
219         doc/examples/ganeti.cron \
220         doc/examples/ganeti.initd \
221         doc/examples/gnt-config-backup \
222         doc/examples/hooks/ipsec \
223         $(manhtml)
224
225 gnt_scripts = \
226         scripts/gnt-backup \
227         scripts/gnt-cluster \
228         scripts/gnt-debug \
229         scripts/gnt-instance \
230         scripts/gnt-job \
231         scripts/gnt-node \
232         scripts/gnt-os
233
234 dist_sbin_SCRIPTS = \
235         daemons/ganeti-noded \
236         daemons/ganeti-watcher \
237         daemons/ganeti-masterd \
238         daemons/ganeti-confd \
239         daemons/ganeti-rapi \
240         $(gnt_scripts)
241
242 nodist_sbin_SCRIPTS = \
243         daemons/ganeti-cleaner
244
245 dist_tools_SCRIPTS = \
246         tools/burnin \
247         tools/cfgshell \
248         tools/cfgupgrade \
249         tools/cfgupgrade12 \
250         tools/cluster-merge \
251         tools/lvmstrap \
252         tools/move-instance \
253         tools/sanitize-config
254
255 pkglib_python_scripts = \
256         daemons/import-export \
257         tools/check-cert-expired
258
259 pkglib_SCRIPTS = \
260         daemons/daemon-util \
261         daemons/ensure-dirs \
262         $(pkglib_python_scripts)
263
264 EXTRA_DIST = \
265         NEWS \
266         pylintrc \
267         autotools/build-bash-completion \
268         autotools/check-python-code \
269         autotools/check-man \
270         autotools/docbook-wrapper \
271         autotools/gen-coverage \
272         autotools/testrunner \
273         $(RUN_IN_TEMPDIR) \
274         daemons/daemon-util.in \
275         daemons/ensure-dirs.in \
276         daemons/ganeti-cleaner.in \
277         $(pkglib_python_scripts) \
278         devel/upload.in \
279         $(docdot) \
280         $(docpng) \
281         $(docrst) \
282         doc/conf.py \
283         doc/html \
284         doc/examples/ganeti.initd.in \
285         doc/examples/ganeti.cron.in \
286         doc/examples/gnt-config-backup.in \
287         doc/examples/dumb-allocator \
288         doc/examples/ganeti.default \
289         doc/examples/ganeti.default-debug \
290         doc/examples/hooks/ethers \
291         doc/examples/hooks/ipsec.in \
292         test/testutils.py \
293         test/mocks.py \
294         $(dist_TESTS) \
295         $(TEST_FILES) \
296         man/footer.sgml \
297         $(mansgml) \
298         $(maninput) \
299         qa/ganeti-qa.py \
300         qa/qa-sample.json \
301         qa/qa_cluster.py \
302         qa/qa_config.py \
303         qa/qa_daemon.py \
304         qa/qa_env.py \
305         qa/qa_error.py \
306         qa/qa_instance.py \
307         qa/qa_node.py \
308         qa/qa_os.py \
309         qa/qa_rapi.py \
310         qa/qa_tags.py \
311         qa/qa_utils.py
312
313 man_MANS = \
314         man/ganeti.7 \
315         man/ganeti-cleaner.8 \
316         man/ganeti-confd.8 \
317         man/ganeti-masterd.8 \
318         man/ganeti-noded.8 \
319         man/ganeti-os-interface.7 \
320         man/ganeti-rapi.8 \
321         man/ganeti-watcher.8 \
322         man/gnt-backup.8 \
323         man/gnt-cluster.8 \
324         man/gnt-debug.8 \
325         man/gnt-instance.8 \
326         man/gnt-job.8 \
327         man/gnt-node.8 \
328         man/gnt-os.8
329
330 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
331 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
332 maninput = \
333         $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
334         $(patsubst %.html,%.html.in,$(manhtml))
335
336 TEST_FILES = \
337         test/data/bdev-both.txt \
338         test/data/bdev-8.3-both.txt \
339         test/data/bdev-disk.txt \
340         test/data/bdev-net.txt \
341         test/data/cert1.pem \
342         test/data/proc_drbd8.txt \
343         test/data/proc_drbd80-emptyline.txt \
344         test/data/proc_drbd83.txt \
345         test/import-export_unittest-helper
346
347 python_tests = \
348         test/ganeti.asyncnotifier_unittest.py \
349         test/ganeti.backend_unittest.py \
350         test/ganeti.bdev_unittest.py \
351         test/ganeti.cli_unittest.py \
352         test/ganeti.daemon_unittest.py \
353         test/ganeti.cmdlib_unittest.py \
354         test/ganeti.compat_unittest.py \
355         test/ganeti.confd.client_unittest.py \
356         test/ganeti.config_unittest.py \
357         test/ganeti.constants_unittest.py \
358         test/ganeti.errors_unittest.py \
359         test/ganeti.hooks_unittest.py \
360         test/ganeti.http_unittest.py \
361         test/ganeti.impexpd_unittest.py \
362         test/ganeti.locking_unittest.py \
363         test/ganeti.luxi_unittest.py \
364         test/ganeti.masterd.instance_unittest.py \
365         test/ganeti.mcpu_unittest.py \
366         test/ganeti.objects_unittest.py \
367         test/ganeti.opcodes_unittest.py \
368         test/ganeti.rapi.client_unittest.py \
369         test/ganeti.rapi.resources_unittest.py \
370         test/ganeti.rapi.rlib2_unittest.py \
371         test/ganeti.serializer_unittest.py \
372         test/ganeti.ssh_unittest.py \
373         test/ganeti.uidpool_unittest.py \
374         test/ganeti.utils_unittest.py \
375         test/ganeti.utils_mlockall_unittest.py \
376         test/ganeti.workerpool_unittest.py \
377         test/docs_unittest.py \
378         test/tempfile_fork_unittest.py
379
380 dist_TESTS = \
381         test/check-cert-expired_unittest.bash \
382         test/daemon-util_unittest.bash \
383         test/ganeti-cleaner_unittest.bash \
384         test/import-export_unittest.bash \
385         $(python_tests)
386
387 nodist_TESTS =
388
389 TESTS = $(dist_TESTS) $(nodist_TESTS)
390
391 # Environment for all tests
392 PLAIN_TESTS_ENVIRONMENT = \
393         PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
394
395 # Environment for tests run by automake
396 TESTS_ENVIRONMENT = \
397         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
398
399 all_python_code = \
400         $(dist_sbin_SCRIPTS) \
401         $(dist_tools_SCRIPTS) \
402         $(pkglib_python_scripts) \
403         $(python_tests) \
404         $(pkgpython_PYTHON) \
405         $(hypervisor_PYTHON) \
406         $(rapi_PYTHON) \
407         $(http_PYTHON) \
408         $(confd_PYTHON) \
409         $(masterd_PYTHON) \
410         $(impexpd_PYTHON) \
411         $(noinst_PYTHON)
412
413 srclink_files = \
414         man/footer.sgml \
415         test/check-cert-expired_unittest.bash \
416         test/daemon-util_unittest.bash \
417         test/ganeti-cleaner_unittest.bash \
418         test/import-export_unittest.bash \
419         $(all_python_code)
420
421 check_python_code = \
422         $(BUILD_BASH_COMPLETION) \
423         $(all_python_code)
424
425 lint_python_code = \
426         ganeti \
427         $(dist_sbin_SCRIPTS) \
428         $(dist_tools_SCRIPTS) \
429         $(pkglib_python_scripts) \
430         $(BUILD_BASH_COMPLETION)
431
432 test/daemon-util_unittest.bash: daemons/daemon-util
433
434 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
435
436 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
437         sed -f $(REPLACE_VARS_SED) < $< > $@
438         chmod u+x $@
439
440 daemons/%: daemons/%.in \
441                 $(REPLACE_VARS_SED)
442         sed -f $(REPLACE_VARS_SED) < $< > $@
443         chmod +x $@
444
445 doc/examples/%: doc/examples/%.in \
446                 $(REPLACE_VARS_SED)
447         sed -f $(REPLACE_VARS_SED) < $< > $@
448
449 doc/examples/hooks/%: doc/examples/hooks/%.in \
450                 $(REPLACE_VARS_SED)
451         sed -f $(REPLACE_VARS_SED) < $< > $@
452
453 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
454         lib/cli.py $(gnt_scripts) tools/burnin
455         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
456
457 doc/%.png: doc/%.dot
458         @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
459         $(DOT) -Tpng -o $@ $<
460
461 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
462         @test -n "$(DOCBOOK2MAN)" || \
463           { echo 'docbook2man' not found during configure; exit 1; }
464         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
465         $(CHECK_MAN) $@
466
467 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
468         @test -n "$(DOCBOOK2HTML)" || \
469           { echo 'docbook2html' not found during configure; exit 1; }
470         $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
471
472 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
473         sed -f $(REPLACE_VARS_SED) < $< > $@
474
475 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
476         sed -f $(REPLACE_VARS_SED) < $< > $@
477
478 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
479         sed -f $(REPLACE_VARS_SED) < $< > $@
480
481 lib/_autoconf.py: Makefile stamp-directories
482         set -e; \
483         { echo '# This file is automatically generated, do not edit!'; \
484           echo '#'; \
485           echo ''; \
486           echo '"""Build-time configuration for Ganeti.'; \
487           echo '';\
488           echo 'This file is autogenerated by the build process.'; \
489           echo 'For any changes you need to re-run ./configure (and'; \
490           echo 'not edit by hand).'; \
491           echo ''; \
492           echo '"""'; \
493           echo ''; \
494           echo '# pylint: disable-msg=C0301,C0324'; \
495           echo '# because this is autogenerated, we do not want'; \
496           echo '# style warnings' ; \
497           echo ''; \
498           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
499           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
500           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
501           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
502           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
503           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
504           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
505           echo "SYSCONFDIR = '$(sysconfdir)'"; \
506           echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
507           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
508           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
509           echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
510           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
511           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
512           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
513           echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
514           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
515           echo "KVM_PATH = '$(KVM_PATH)'"; \
516           echo "SOCAT_PATH = '$(SOCAT)'"; \
517           echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
518           echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
519           echo "TOOLSDIR = '$(toolsdir)'"; \
520           echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
521           echo "PKGLIBDIR = '$(pkglibdir)'"; \
522           echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
523           echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
524           echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
525           echo "MASTERD_USER = '$(MASTERD_USER)'"; \
526           echo "RAPI_USER = '$(RAPI_USER)'"; \
527         } > $@
528
529 $(REPLACE_VARS_SED): Makefile
530         set -e; \
531         { echo 's#@PREFIX@#$(prefix)#g'; \
532           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
533           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
534           echo 's#@BINDIR@#$(bindir)#g'; \
535           echo 's#@SBINDIR@#$(sbindir)#g'; \
536           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
537           echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
538           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
539           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
540           echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
541           echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
542           echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
543           echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
544           echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
545           echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
546           echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
547           echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
548           echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
549           echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
550           echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
551           echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
552         } > $@
553
554 # We need to create symlinks because "make distcheck" will not install Python
555 # files when building.
556 stamp-srclinks: Makefile stamp-directories
557         set -e; \
558         for i in $(srclink_files); do \
559                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
560                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
561                 fi; \
562         done
563         touch $@
564
565 .PHONY: ganeti
566 ganeti:
567         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
568
569 check-local:
570         $(CHECK_PYTHON_CODE) $(check_python_code)
571
572 .PHONY: lint
573 lint: ganeti $(BUILT_SOURCES)
574         @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
575         $(PYLINT) $(LINT_OPTS) $(lint_python_code)
576
577 # a dist hook rule for catching revision control directories
578 distcheck-hook:
579         if find $(top_distdir) -name .svn -or -name .git | grep .; then \
580                 echo "Found revision control files in final archive." 1>&2; \
581                 exit 1; \
582         fi
583         if find $(top_distdir) -name '*.py[co]' | grep .; then \
584                 echo "Found Python byte code in final archive." 1>&2; \
585                 exit 1; \
586         fi
587         if find $(top_distdir) -name '*~' | grep .; then \
588                 echo "Found backup files in final archive." 1>&2; \
589                 exit 1; \
590         fi
591
592 install-exec-local:
593         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
594           "$(DESTDIR)${localstatedir}/log/ganeti" \
595           "$(DESTDIR)${localstatedir}/run/ganeti"
596
597 stamp-directories: Makefile
598         @mkdir_p@ $(DIRS)
599         touch $@
600
601 .PHONY: apidoc
602 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
603         test -e doc/api || mkdir doc/api
604         $(RUN_IN_TEMPDIR) epydoc -v \
605                 --conf $(CURDIR)/epydoc.conf \
606                 --output $(CURDIR)/doc/api
607
608 .PHONY: TAGS
609 TAGS: $(BUILT_SOURCES)
610         rm -f TAGS
611         find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
612           -path 'daemons/ganeti-*' -o -path 'tools/*' | \
613           etags -
614
615 .PHONY: coverage
616 coverage: $(BUILT_SOURCES) $(python_tests)
617         set -e; \
618         mkdir -p doc/coverage; \
619         COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
620         TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
621         HTML_COVERAGE=$(CURDIR)/doc/coverage \
622         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
623         $(python_tests)
624
625 commit-check: distcheck lint apidoc
626
627 # vim: set noet :