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.
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@
12 # Use bash in order to be able to use pipefail
15 ACLOCAL_AMFLAGS = -I autotools
16 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
17 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
18 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
19 CHECK_MAN = $(top_srcdir)/autotools/check-man
20 CHECK_VERSION = $(top_srcdir)/autotools/check-version
21 CHECK_NEWS = $(top_srcdir)/autotools/check-news
22 REPLACE_VARS_SED = autotools/replace_vars.sed
24 clientdir = $(pkgpythondir)/client
25 hypervisordir = $(pkgpythondir)/hypervisor
26 httpdir = $(pkgpythondir)/http
27 masterddir = $(pkgpythondir)/masterd
28 confddir = $(pkgpythondir)/confd
29 rapidir = $(pkgpythondir)/rapi
30 serverdir = $(pkgpythondir)/server
31 watcherdir = $(pkgpythondir)/watcher
32 impexpddir = $(pkgpythondir)/impexpd
33 utilsdir = $(pkgpythondir)/utils
34 toolsdir = $(pkglibdir)/tools
35 docdir = $(datadir)/doc/$(PACKAGE)
37 # Delete output file if an error occurred while building it
47 doc/examples/gnt-debug \
66 BUILDTIME_DIR_AUTOCREATE = \
72 $(BUILDTIME_DIR_AUTOCREATE) \
77 ganeti-[0-9]*.[0-9]*.[0-9]* \
80 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
82 MAINTAINERCLEANFILES = \
85 doc/install-quick.rst \
90 maintainer-clean-local:
91 rm -rf $(BUILDTIME_DIRS)
94 $(addsuffix /*.py[co],$(DIRS)) \
98 autotools/replace_vars.sed \
100 daemons/ensure-dirs \
101 daemons/ganeti-cleaner \
103 doc/examples/bash_completion \
104 doc/examples/ganeti.initd \
105 doc/examples/ganeti-kvm-poweroff.initd \
106 doc/examples/ganeti.cron \
107 doc/examples/gnt-config-backup \
108 doc/examples/hooks/ipsec \
113 $(nodist_pkgpython_PYTHON)
115 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
116 # it'll cause the target to rebuild every time.
124 nodist_pkgpython_PYTHON = \
128 lib/build/__init__.py \
129 lib/build/sphinx_ext.py
133 lib/asyncnotifier.py \
165 lib/client/__init__.py \
166 lib/client/gnt_backup.py \
167 lib/client/gnt_cluster.py \
168 lib/client/gnt_debug.py \
169 lib/client/gnt_group.py \
170 lib/client/gnt_instance.py \
171 lib/client/gnt_job.py \
172 lib/client/gnt_node.py \
175 hypervisor_PYTHON = \
176 lib/hypervisor/__init__.py \
177 lib/hypervisor/hv_base.py \
178 lib/hypervisor/hv_chroot.py \
179 lib/hypervisor/hv_fake.py \
180 lib/hypervisor/hv_kvm.py \
181 lib/hypervisor/hv_lxc.py \
182 lib/hypervisor/hv_xen.py
185 lib/rapi/__init__.py \
186 lib/rapi/baserlib.py \
188 lib/rapi/client_utils.py \
189 lib/rapi/connector.py \
193 lib/http/__init__.py \
199 lib/confd/__init__.py \
200 lib/confd/client.py \
201 lib/confd/querylib.py \
205 lib/masterd/__init__.py \
206 lib/masterd/instance.py
209 lib/impexpd/__init__.py
212 lib/watcher/__init__.py
215 lib/server/__init__.py \
216 lib/server/confd.py \
217 lib/server/masterd.py \
218 lib/server/noded.py \
222 lib/utils/__init__.py \
224 lib/utils/filelock.py \
229 lib/utils/nodesetup.py \
230 lib/utils/process.py \
233 lib/utils/wrapper.py \
243 doc/design-draft.rst \
245 doc/design-query2.rst \
246 doc/cluster-merge.rst \
252 doc/install-quick.rst \
255 doc/move-instance.rst \
262 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
264 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
265 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/opdoc.py
266 @test -n "$(SPHINX)" || \
267 { echo 'sphinx-build' not found during configure; exit 1; }
269 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
271 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
272 -D release="$(PACKAGE_VERSION)" \
273 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
274 rm -f doc/html/.buildinfo doc/html/objects.inv
277 doc/html: doc/html/index.html
279 doc/install-quick.rst: INSTALL
281 doc/upgrade.rst: UPGRADE
283 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
285 { echo '.. This file is automatically updated at build time from $<.'; \
286 echo '.. Do not edit.'; \
293 doc/design-2.1-lock-acquire.dot \
294 doc/design-2.1-lock-release.dot
296 docpng = $(patsubst %.dot,%.png,$(docdot))
298 # Things to build but not to install (add it to EXTRA_DIST if it should be
303 doc/examples/bash_completion \
304 doc/examples/ganeti.cron \
305 doc/examples/ganeti.initd \
306 doc/examples/ganeti-kvm-poweroff.initd \
307 doc/examples/gnt-config-backup \
308 doc/examples/hooks/ipsec \
313 scripts/gnt-cluster \
316 scripts/gnt-instance \
322 daemons/ganeti-confd \
323 daemons/ganeti-masterd \
324 daemons/ganeti-noded \
325 daemons/ganeti-watcher \
326 daemons/ganeti-rapi \
328 scripts/gnt-cluster \
331 scripts/gnt-instance \
350 dist_sbin_SCRIPTS = \
351 tools/ganeti-listrunner
353 nodist_sbin_SCRIPTS = \
354 $(PYTHON_BOOTSTRAP) \
355 daemons/ganeti-cleaner
357 dist_tools_SCRIPTS = \
362 tools/cluster-merge \
364 tools/move-instance \
366 tools/sanitize-config
368 pkglib_python_scripts = \
369 daemons/import-export \
370 tools/check-cert-expired
373 daemons/daemon-util \
374 daemons/ensure-dirs \
376 $(pkglib_python_scripts)
383 autotools/build-bash-completion \
384 autotools/check-python-code \
385 autotools/check-man \
386 autotools/check-news \
387 autotools/check-tar \
388 autotools/check-version \
389 autotools/gen-coverage \
390 autotools/testrunner \
392 daemons/daemon-util.in \
393 daemons/ensure-dirs.in \
394 daemons/ganeti-cleaner.in \
395 $(pkglib_python_scripts) \
403 doc/examples/ganeti.initd.in \
404 doc/examples/ganeti-kvm-poweroff.initd.in \
405 doc/examples/ganeti.cron.in \
406 doc/examples/gnt-config-backup.in \
407 doc/examples/ganeti.default \
408 doc/examples/ganeti.default-debug \
409 doc/examples/hooks/ethers \
410 doc/examples/hooks/ipsec.in \
411 doc/examples/gnt-debug/README \
412 doc/examples/gnt-debug/delay0.json \
413 doc/examples/gnt-debug/delay50.json \
426 man/ganeti-cleaner.8 \
428 man/ganeti-listrunner.8 \
429 man/ganeti-masterd.8 \
431 man/ganeti-os-interface.7 \
433 man/ganeti-watcher.8 \
443 manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
444 manhtml = $(patsubst %.rst,%.html,$(manrst))
446 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
447 $(patsubst %.html,%.html.in,$(manhtml)) \
448 man/footer.man man/footer.html
451 test/data/bdev-drbd-8.0.txt \
452 test/data/bdev-drbd-8.3.txt \
453 test/data/bdev-drbd-disk.txt \
454 test/data/bdev-drbd-net-ip4.txt \
455 test/data/bdev-drbd-net-ip6.txt \
456 test/data/cert1.pem \
457 test/data/proc_drbd8.txt \
458 test/data/proc_drbd80-emptyline.txt \
459 test/data/proc_drbd83.txt \
460 test/data/sys_drbd_usermode_helper.txt \
461 test/import-export_unittest-helper
464 test/ganeti.asyncnotifier_unittest.py \
465 test/ganeti.backend_unittest.py \
466 test/ganeti.bdev_unittest.py \
467 test/ganeti.cli_unittest.py \
468 test/ganeti.client.gnt_instance_unittest.py \
469 test/ganeti.daemon_unittest.py \
470 test/ganeti.cmdlib_unittest.py \
471 test/ganeti.compat_unittest.py \
472 test/ganeti.confd.client_unittest.py \
473 test/ganeti.config_unittest.py \
474 test/ganeti.constants_unittest.py \
475 test/ganeti.errors_unittest.py \
476 test/ganeti.hooks_unittest.py \
477 test/ganeti.ht_unittest.py \
478 test/ganeti.http_unittest.py \
479 test/ganeti.hypervisor_unittest.py \
480 test/ganeti.hypervisor.hv_chroot_unittest.py \
481 test/ganeti.hypervisor.hv_fake_unittest.py \
482 test/ganeti.hypervisor.hv_kvm_unittest.py \
483 test/ganeti.hypervisor.hv_lxc_unittest.py \
484 test/ganeti.hypervisor.hv_xen_unittest.py \
485 test/ganeti.impexpd_unittest.py \
486 test/ganeti.jqueue_unittest.py \
487 test/ganeti.locking_unittest.py \
488 test/ganeti.luxi_unittest.py \
489 test/ganeti.masterd.instance_unittest.py \
490 test/ganeti.mcpu_unittest.py \
491 test/ganeti.netutils_unittest.py \
492 test/ganeti.objects_unittest.py \
493 test/ganeti.opcodes_unittest.py \
494 test/ganeti.qlang_unittest.py \
495 test/ganeti.query_unittest.py \
496 test/ganeti.rapi.baserlib_unittest.py \
497 test/ganeti.rapi.client_unittest.py \
498 test/ganeti.rapi.resources_unittest.py \
499 test/ganeti.rapi.rlib2_unittest.py \
500 test/ganeti.rpc_unittest.py \
501 test/ganeti.runtime_unittest.py \
502 test/ganeti.serializer_unittest.py \
503 test/ganeti.ssh_unittest.py \
504 test/ganeti.uidpool_unittest.py \
505 test/ganeti.utils.algo_unittest.py \
506 test/ganeti.utils.filelock_unittest.py \
507 test/ganeti.utils.hash_unittest.py \
508 test/ganeti.utils.io_unittest.py \
509 test/ganeti.utils.mlock_unittest.py \
510 test/ganeti.utils.nodesetup_unittest.py \
511 test/ganeti.utils.process_unittest.py \
512 test/ganeti.utils.retry_unittest.py \
513 test/ganeti.utils.text_unittest.py \
514 test/ganeti.utils.wrapper_unittest.py \
515 test/ganeti.utils.x509_unittest.py \
516 test/ganeti.utils_unittest.py \
517 test/ganeti.workerpool_unittest.py \
518 test/cfgupgrade_unittest.py \
519 test/docs_unittest.py \
520 test/tempfile_fork_unittest.py
523 test/check-cert-expired_unittest.bash \
524 test/daemon-util_unittest.bash \
525 test/ganeti-cleaner_unittest.bash \
526 test/import-export_unittest.bash \
531 TESTS = $(dist_TESTS) $(nodist_TESTS)
533 # Environment for all tests
534 PLAIN_TESTS_ENVIRONMENT = \
535 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
537 # Environment for tests run by automake
538 TESTS_ENVIRONMENT = \
539 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
542 $(dist_sbin_SCRIPTS) \
543 $(dist_tools_SCRIPTS) \
544 $(pkglib_python_scripts) \
546 $(pkgpython_PYTHON) \
548 $(hypervisor_PYTHON) \
562 test/check-cert-expired_unittest.bash \
563 test/daemon-util_unittest.bash \
564 test/ganeti-cleaner_unittest.bash \
565 test/import-export_unittest.bash \
568 check_python_code = \
569 $(BUILD_BASH_COMPLETION) \
574 ganeti/http/server.py \
575 $(dist_sbin_SCRIPTS) \
576 $(dist_tools_SCRIPTS) \
577 $(pkglib_python_scripts) \
578 $(BUILD_BASH_COMPLETION) \
581 test/daemon-util_unittest.bash: daemons/daemon-util
583 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
585 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
586 sed -f $(REPLACE_VARS_SED) < $< > $@
589 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
590 sed -f $(REPLACE_VARS_SED) < $< > $@
593 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
594 sed -f $(REPLACE_VARS_SED) < $< > $@
597 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
598 sed -f $(REPLACE_VARS_SED) < $< > $@
600 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
601 sed -f $(REPLACE_VARS_SED) < $< > $@
603 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
604 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
605 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
608 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
609 $(DOT) -Tpng -o $@ $<
611 man/footer.man: man/footer.rst
612 @test -n "$(PANDOC)" || \
613 { echo 'pandoc' not found during configure; exit 1; }
614 $(PANDOC) -f rst -t man -o $@ $<
616 man/footer.html: man/footer.rst
617 @test -n "$(PANDOC)" || \
618 { echo 'pandoc' not found during configure; exit 1; }
619 $(PANDOC) -f rst -t html -o $@ $<
621 man/%.7.in man/%.8.in: man/%.rst man/footer.man
622 @test -n "$(PANDOC)" || \
623 { echo 'pandoc' not found during configure; exit 1; }
625 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
626 sed -e 's/\\@/@/g' > $@
627 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
629 man/%.html.in: man/%.rst man/footer.html
630 @test -n "$(PANDOC)" || \
631 { echo 'pandoc' not found during configure; exit 1; }
633 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
634 sed -e 's/\\@/@/g' > $@
636 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
637 sed -f $(REPLACE_VARS_SED) < $< > $@
639 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
640 sed -f $(REPLACE_VARS_SED) < $< > $@
642 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
643 sed -f $(REPLACE_VARS_SED) < $< > $@
645 epydoc.conf: epydoc.conf.in
646 sed -e 's#@MODULES@#$(lint_python_code)#g' < $< > $@
649 if test -d .git; then \
651 elif test ! -f $@ ; then \
652 echo "Cannot auto-generate $@ file"; exit 1; \
655 .PHONY: regen-vcs-version
659 if test -d .git; then \
661 $(MAKE) vcs-version; \
664 lib/_autoconf.py: Makefile vcs-version | lib/.dir
666 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
667 { echo '# This file is automatically generated, do not edit!'; \
670 echo '"""Build-time configuration for Ganeti.'; \
672 echo 'This file is autogenerated by the build process.'; \
673 echo 'For any changes you need to re-run ./configure (and'; \
674 echo 'not edit by hand).'; \
678 echo '# pylint: disable-msg=C0301,C0324'; \
679 echo '# because this is autogenerated, we do not want'; \
680 echo '# style warnings' ; \
682 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
683 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
684 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
685 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
686 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
687 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
688 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
689 echo "SYSCONFDIR = '$(sysconfdir)'"; \
690 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
691 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
692 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
693 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
694 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
695 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
696 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
697 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
698 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
699 echo "KVM_PATH = '$(KVM_PATH)'"; \
700 echo "SOCAT_PATH = '$(SOCAT)'"; \
701 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
702 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
703 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
704 echo "TOOLSDIR = '$(toolsdir)'"; \
705 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
706 echo "PKGLIBDIR = '$(pkglibdir)'"; \
707 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
708 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
709 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
710 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
711 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
712 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
713 echo "RAPI_USER = '$(RAPI_USER)'"; \
714 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
715 echo "CONFD_USER = '$(CONFD_USER)'"; \
716 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
717 echo "NODED_USER = '$(NODED_USER)'"; \
718 echo "VCS_VERSION = '$$VCSVER'"; \
719 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
722 $(REPLACE_VARS_SED): Makefile
724 { echo 's#@PREFIX@#$(prefix)#g'; \
725 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
726 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
727 echo 's#@BINDIR@#$(bindir)#g'; \
728 echo 's#@SBINDIR@#$(sbindir)#g'; \
729 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
730 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
731 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
732 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
733 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
734 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
735 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
736 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
737 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
738 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
739 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
740 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
741 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
742 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
743 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
744 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
745 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
746 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
749 # Using deferred evaluation
750 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
751 daemons/ganeti-watcher: MODULE = ganeti.watcher
752 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
754 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
755 test -n "$(MODULE)" || { echo Missing module; exit 1; }
757 { echo '#!/usr/bin/python'; \
758 echo '# This file is automatically generated, do not edit!'; \
759 echo "# Edit $(MODULE) instead."; \
761 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
763 echo '# pylint: disable-msg=C0103'; \
764 echo '# C0103: Invalid name'; \
767 echo 'import $(MODULE) as main'; \
769 echo '# Temporarily alias commands until bash completion'; \
770 echo '# generator is changed'; \
771 echo 'if hasattr(main, "commands"):'; \
772 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
774 echo 'if __name__ == "__main__":'; \
775 echo ' sys.exit(main.Main())'; \
779 # We need to create symlinks because "make distcheck" will not install Python
780 # files when building.
781 stamp-srclinks: Makefile | $(all_dirfiles)
783 for i in $(srclink_files); do \
784 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
785 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
792 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
795 check-dirs: $(BUILT_SOURCES)
797 find . -type d \( \( -name . \) -o \( \
799 -name autom4te.cache \
800 \) -prune -o -print \) | { \
804 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
805 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
808 for dir in $(DIRS); do \
809 if ! test -d "$$dir"; then \
810 echo "Directory $$dir listed in DIRS does not exist" >&2; \
814 if test -n "$$error"; then exit 1; else exit 0; fi; \
817 check-local: check-dirs
818 $(CHECK_PYTHON_CODE) $(check_python_code)
819 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
820 $(CHECK_NEWS) < $(top_srcdir)/NEWS
823 lint: $(BUILT_SOURCES)
824 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
825 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
826 cd $(top_srcdir)/qa && \
827 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
828 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
830 # a dist hook rule for updating the vcs-version file; this is
831 # hardcoded due to where it needs to build the file...
833 $(MAKE) regen-vcs-version && \
834 rm -f $(top_distdir)/vcs-version && \
835 cp -p $(srcdir)/vcs-version $(top_distdir)
837 # a distcheck hook rule for catching revision control directories
839 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
840 echo "Found revision control files in final archive." 1>&2; \
843 if find $(top_distdir) -name '*.py[co]' | grep .; then \
844 echo "Found Python byte code in final archive." 1>&2; \
847 if find $(top_distdir) -name '*~' | grep .; then \
848 echo "Found backup files in final archive." 1>&2; \
851 # Empty files or directories should not be distributed. They can cause
852 # unnecessary warnings for packagers. Directories used by automake during
853 # distcheck must be excluded.
854 if find $(top_distdir) -empty -and -not \( \
855 -path $(top_distdir)/_build -or \
856 -path $(top_distdir)/_inst \) | grep .; then \
857 echo "Found empty files or directories in final archive." 1>&2; \
860 if test -n "$(BUILD_RELEASE)" && \
861 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
862 echo "Found unreleased version in NEWS." >&2; \
866 # When building a release, stricter checks should be used
867 distcheck-release dist-release: export BUILD_RELEASE = 1
868 distcheck-release: distcheck
872 for i in $(DIST_ARCHIVES); do \
873 echo -n "Checking $$i ... "; \
874 autotools/check-tar < $$i; \
879 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
880 "$(DESTDIR)${localstatedir}/log/ganeti" \
881 "$(DESTDIR)${localstatedir}/run/ganeti"
883 # To avoid conflicts between directory names and other targets, a file inside
884 # the directory is used to ensure its existence.
886 @mkdir_p@ $* && touch $@
889 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
890 $(RUN_IN_TEMPDIR) epydoc -v \
891 --conf $(CURDIR)/epydoc.conf \
892 --output $(CURDIR)/doc/api
895 TAGS: $(BUILT_SOURCES)
897 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
898 -path './daemons/ganeti-*' -o -path './tools/*' -o \
899 -path './qa/*.py' | \
903 coverage: $(BUILT_SOURCES) $(python_tests)
905 COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
906 TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
907 HTML_COVERAGE=$(CURDIR)/doc/coverage \
908 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
911 commit-check: distcheck lint apidoc
913 -include ./Makefile.local