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 ACLOCAL_AMFLAGS = -I autotools
13 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
14 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
15 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
16 CHECK_MAN = $(top_srcdir)/autotools/check-man
17 CHECK_VERSION = $(top_srcdir)/autotools/check-version
18 CHECK_NEWS = $(top_srcdir)/autotools/check-news
19 REPLACE_VARS_SED = autotools/replace_vars.sed
21 clientdir = $(pkgpythondir)/client
22 hypervisordir = $(pkgpythondir)/hypervisor
23 httpdir = $(pkgpythondir)/http
24 masterddir = $(pkgpythondir)/masterd
25 confddir = $(pkgpythondir)/confd
26 rapidir = $(pkgpythondir)/rapi
27 serverdir = $(pkgpythondir)/server
28 watcherdir = $(pkgpythondir)/watcher
29 impexpddir = $(pkgpythondir)/impexpd
30 utilsdir = $(pkgpythondir)/utils
31 toolsdir = $(pkglibdir)/tools
32 docdir = $(datadir)/doc/$(PACKAGE)
34 # Delete output file if an error occurred while building it
44 doc/examples/gnt-debug \
63 BUILDTIME_DIR_AUTOCREATE = \
69 $(BUILDTIME_DIR_AUTOCREATE) \
74 ganeti-[0-9]*.[0-9]*.[0-9]* \
77 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
79 MAINTAINERCLEANFILES = \
82 doc/install-quick.rst \
87 maintainer-clean-local:
88 rm -rf $(BUILDTIME_DIRS)
91 $(addsuffix /*.py[co],$(DIRS)) \
95 autotools/replace_vars.sed \
98 daemons/ganeti-cleaner \
100 doc/examples/bash_completion \
101 doc/examples/ganeti.initd \
102 doc/examples/ganeti-kvm-poweroff.initd \
103 doc/examples/ganeti.cron \
104 doc/examples/gnt-config-backup \
105 doc/examples/hooks/ipsec \
110 $(nodist_pkgpython_PYTHON)
112 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
113 # it'll cause the target to rebuild every time.
121 nodist_pkgpython_PYTHON = \
125 lib/build/__init__.py
129 lib/asyncnotifier.py \
161 lib/client/__init__.py \
162 lib/client/gnt_backup.py \
163 lib/client/gnt_cluster.py \
164 lib/client/gnt_debug.py \
165 lib/client/gnt_group.py \
166 lib/client/gnt_instance.py \
167 lib/client/gnt_job.py \
168 lib/client/gnt_node.py \
171 hypervisor_PYTHON = \
172 lib/hypervisor/__init__.py \
173 lib/hypervisor/hv_base.py \
174 lib/hypervisor/hv_chroot.py \
175 lib/hypervisor/hv_fake.py \
176 lib/hypervisor/hv_kvm.py \
177 lib/hypervisor/hv_lxc.py \
178 lib/hypervisor/hv_xen.py
181 lib/rapi/__init__.py \
182 lib/rapi/baserlib.py \
184 lib/rapi/client_utils.py \
185 lib/rapi/connector.py \
189 lib/http/__init__.py \
195 lib/confd/__init__.py \
196 lib/confd/client.py \
197 lib/confd/querylib.py \
201 lib/masterd/__init__.py \
202 lib/masterd/instance.py
205 lib/impexpd/__init__.py
208 lib/watcher/__init__.py
211 lib/server/__init__.py \
212 lib/server/confd.py \
213 lib/server/masterd.py \
214 lib/server/noded.py \
218 lib/utils/__init__.py \
220 lib/utils/filelock.py \
225 lib/utils/nodesetup.py \
226 lib/utils/process.py \
229 lib/utils/wrapper.py \
240 doc/design-query2.rst \
241 doc/cluster-merge.rst \
247 doc/install-quick.rst \
250 doc/move-instance.rst \
257 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
259 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
261 @test -n "$(SPHINX)" || \
262 { echo 'sphinx-build' not found during configure; exit 1; }
264 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
266 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
267 -D release="$(PACKAGE_VERSION)" \
268 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
269 rm -f doc/html/.buildinfo doc/html/objects.inv
272 doc/html: doc/html/index.html
274 doc/install-quick.rst: INSTALL
276 doc/upgrade.rst: UPGRADE
278 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
280 { echo '.. This file is automatically updated at build time from $<.'; \
281 echo '.. Do not edit.'; \
288 doc/design-2.1-lock-acquire.dot \
289 doc/design-2.1-lock-release.dot
291 docpng = $(patsubst %.dot,%.png,$(docdot))
293 # Things to build but not to install (add it to EXTRA_DIST if it should be
298 doc/examples/bash_completion \
299 doc/examples/ganeti.cron \
300 doc/examples/ganeti.initd \
301 doc/examples/ganeti-kvm-poweroff.initd \
302 doc/examples/gnt-config-backup \
303 doc/examples/hooks/ipsec \
308 scripts/gnt-cluster \
311 scripts/gnt-instance \
317 daemons/ganeti-confd \
318 daemons/ganeti-masterd \
319 daemons/ganeti-noded \
320 daemons/ganeti-watcher \
321 daemons/ganeti-rapi \
323 scripts/gnt-cluster \
326 scripts/gnt-instance \
345 dist_sbin_SCRIPTS = \
346 tools/ganeti-listrunner
348 nodist_sbin_SCRIPTS = \
349 $(PYTHON_BOOTSTRAP) \
350 daemons/ganeti-cleaner
352 dist_tools_SCRIPTS = \
357 tools/cluster-merge \
359 tools/move-instance \
361 tools/sanitize-config
363 pkglib_python_scripts = \
364 daemons/import-export \
365 tools/check-cert-expired
368 daemons/daemon-util \
369 daemons/ensure-dirs \
371 $(pkglib_python_scripts)
378 autotools/build-bash-completion \
379 autotools/check-python-code \
380 autotools/check-man \
381 autotools/check-tar \
382 autotools/check-version \
383 autotools/gen-coverage \
384 autotools/testrunner \
386 daemons/daemon-util.in \
387 daemons/ensure-dirs.in \
388 daemons/ganeti-cleaner.in \
389 $(pkglib_python_scripts) \
397 doc/examples/ganeti.initd.in \
398 doc/examples/ganeti-kvm-poweroff.initd.in \
399 doc/examples/ganeti.cron.in \
400 doc/examples/gnt-config-backup.in \
401 doc/examples/dumb-allocator \
402 doc/examples/ganeti.default \
403 doc/examples/ganeti.default-debug \
404 doc/examples/hooks/ethers \
405 doc/examples/hooks/ipsec.in \
406 doc/examples/gnt-debug/README \
407 doc/examples/gnt-debug/delay0.json \
408 doc/examples/gnt-debug/delay50.json \
421 man/ganeti-cleaner.8 \
423 man/ganeti-listrunner.8 \
424 man/ganeti-masterd.8 \
426 man/ganeti-os-interface.7 \
428 man/ganeti-watcher.8 \
438 manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
439 manhtml = $(patsubst %.rst,%.html,$(manrst))
441 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
442 $(patsubst %.html,%.html.in,$(manhtml)) \
443 man/footer.man man/footer.html
446 test/data/bdev-drbd-8.0.txt \
447 test/data/bdev-drbd-8.3.txt \
448 test/data/bdev-drbd-disk.txt \
449 test/data/bdev-drbd-net-ip4.txt \
450 test/data/bdev-drbd-net-ip6.txt \
451 test/data/cert1.pem \
452 test/data/proc_drbd8.txt \
453 test/data/proc_drbd80-emptyline.txt \
454 test/data/proc_drbd83.txt \
455 test/data/sys_drbd_usermode_helper.txt \
456 test/import-export_unittest-helper
459 test/ganeti.asyncnotifier_unittest.py \
460 test/ganeti.backend_unittest.py \
461 test/ganeti.bdev_unittest.py \
462 test/ganeti.cli_unittest.py \
463 test/ganeti.client.gnt_instance_unittest.py \
464 test/ganeti.daemon_unittest.py \
465 test/ganeti.cmdlib_unittest.py \
466 test/ganeti.compat_unittest.py \
467 test/ganeti.confd.client_unittest.py \
468 test/ganeti.config_unittest.py \
469 test/ganeti.constants_unittest.py \
470 test/ganeti.errors_unittest.py \
471 test/ganeti.hooks_unittest.py \
472 test/ganeti.ht_unittest.py \
473 test/ganeti.http_unittest.py \
474 test/ganeti.hypervisor_unittest.py \
475 test/ganeti.hypervisor.hv_chroot_unittest.py \
476 test/ganeti.hypervisor.hv_fake_unittest.py \
477 test/ganeti.hypervisor.hv_kvm_unittest.py \
478 test/ganeti.hypervisor.hv_lxc_unittest.py \
479 test/ganeti.hypervisor.hv_xen_unittest.py \
480 test/ganeti.impexpd_unittest.py \
481 test/ganeti.jqueue_unittest.py \
482 test/ganeti.locking_unittest.py \
483 test/ganeti.luxi_unittest.py \
484 test/ganeti.masterd.instance_unittest.py \
485 test/ganeti.mcpu_unittest.py \
486 test/ganeti.netutils_unittest.py \
487 test/ganeti.objects_unittest.py \
488 test/ganeti.opcodes_unittest.py \
489 test/ganeti.qlang_unittest.py \
490 test/ganeti.query_unittest.py \
491 test/ganeti.rapi.baserlib_unittest.py \
492 test/ganeti.rapi.client_unittest.py \
493 test/ganeti.rapi.resources_unittest.py \
494 test/ganeti.rapi.rlib2_unittest.py \
495 test/ganeti.rpc_unittest.py \
496 test/ganeti.runtime_unittest.py \
497 test/ganeti.serializer_unittest.py \
498 test/ganeti.ssh_unittest.py \
499 test/ganeti.uidpool_unittest.py \
500 test/ganeti.utils.algo_unittest.py \
501 test/ganeti.utils.filelock_unittest.py \
502 test/ganeti.utils.hash_unittest.py \
503 test/ganeti.utils.io_unittest.py \
504 test/ganeti.utils.mlock_unittest.py \
505 test/ganeti.utils.nodesetup_unittest.py \
506 test/ganeti.utils.process_unittest.py \
507 test/ganeti.utils.retry_unittest.py \
508 test/ganeti.utils.text_unittest.py \
509 test/ganeti.utils.wrapper_unittest.py \
510 test/ganeti.utils.x509_unittest.py \
511 test/ganeti.utils_unittest.py \
512 test/ganeti.workerpool_unittest.py \
513 test/cfgupgrade_unittest.py \
514 test/docs_unittest.py \
515 test/tempfile_fork_unittest.py
518 test/check-cert-expired_unittest.bash \
519 test/daemon-util_unittest.bash \
520 test/ganeti-cleaner_unittest.bash \
521 test/import-export_unittest.bash \
526 TESTS = $(dist_TESTS) $(nodist_TESTS)
528 # Environment for all tests
529 PLAIN_TESTS_ENVIRONMENT = \
530 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
532 # Environment for tests run by automake
533 TESTS_ENVIRONMENT = \
534 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
537 $(dist_sbin_SCRIPTS) \
538 $(dist_tools_SCRIPTS) \
539 $(pkglib_python_scripts) \
541 $(pkgpython_PYTHON) \
543 $(hypervisor_PYTHON) \
557 test/check-cert-expired_unittest.bash \
558 test/daemon-util_unittest.bash \
559 test/ganeti-cleaner_unittest.bash \
560 test/import-export_unittest.bash \
563 check_python_code = \
564 $(BUILD_BASH_COMPLETION) \
569 ganeti/http/server.py \
570 $(dist_sbin_SCRIPTS) \
571 $(dist_tools_SCRIPTS) \
572 $(pkglib_python_scripts) \
573 $(BUILD_BASH_COMPLETION) \
576 test/daemon-util_unittest.bash: daemons/daemon-util
578 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
580 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
581 sed -f $(REPLACE_VARS_SED) < $< > $@
584 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
585 sed -f $(REPLACE_VARS_SED) < $< > $@
588 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
589 sed -f $(REPLACE_VARS_SED) < $< > $@
592 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
593 sed -f $(REPLACE_VARS_SED) < $< > $@
595 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
596 sed -f $(REPLACE_VARS_SED) < $< > $@
598 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
599 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
600 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
603 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
604 $(DOT) -Tpng -o $@ $<
606 man/footer.man: man/footer.rst
607 @test -n "$(PANDOC)" || \
608 { echo 'pandoc' not found during configure; exit 1; }
609 $(PANDOC) -f rst -t man -o $@ $<
611 man/footer.html: man/footer.rst
612 @test -n "$(PANDOC)" || \
613 { echo 'pandoc' not found during configure; exit 1; }
614 $(PANDOC) -f rst -t html -o $@ $<
616 man/%.7.in man/%.8.in: man/%.rst man/footer.man
617 @test -n "$(PANDOC)" || \
618 { echo 'pandoc' not found during configure; exit 1; }
619 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
620 sed -e 's/\\@/@/g' > $@
621 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
623 man/%.html.in: man/%.rst man/footer.html
624 @test -n "$(PANDOC)" || \
625 { echo 'pandoc' not found during configure; exit 1; }
626 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
627 sed -e 's/\\@/@/g' > $@
629 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
630 sed -f $(REPLACE_VARS_SED) < $< > $@
632 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
633 sed -f $(REPLACE_VARS_SED) < $< > $@
635 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
636 sed -f $(REPLACE_VARS_SED) < $< > $@
638 epydoc.conf: epydoc.conf.in
639 sed -e 's#@MODULES@#$(lint_python_code)#g' < $< > $@
642 if test -d .git; then \
644 elif test ! -f $@ ; then \
645 echo "Cannot auto-generate $@ file"; exit 1; \
648 .PHONY: regen-vcs-version
652 if test -d .git; then \
654 $(MAKE) vcs-version; \
657 lib/_autoconf.py: Makefile vcs-version | lib/.dir
659 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
660 { echo '# This file is automatically generated, do not edit!'; \
663 echo '"""Build-time configuration for Ganeti.'; \
665 echo 'This file is autogenerated by the build process.'; \
666 echo 'For any changes you need to re-run ./configure (and'; \
667 echo 'not edit by hand).'; \
671 echo '# pylint: disable-msg=C0301,C0324'; \
672 echo '# because this is autogenerated, we do not want'; \
673 echo '# style warnings' ; \
675 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
676 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
677 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
678 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
679 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
680 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
681 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
682 echo "SYSCONFDIR = '$(sysconfdir)'"; \
683 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
684 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
685 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
686 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
687 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
688 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
689 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
690 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
691 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
692 echo "KVM_PATH = '$(KVM_PATH)'"; \
693 echo "SOCAT_PATH = '$(SOCAT)'"; \
694 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
695 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
696 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
697 echo "TOOLSDIR = '$(toolsdir)'"; \
698 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
699 echo "PKGLIBDIR = '$(pkglibdir)'"; \
700 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
701 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
702 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
703 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
704 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
705 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
706 echo "RAPI_USER = '$(RAPI_USER)'"; \
707 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
708 echo "CONFD_USER = '$(CONFD_USER)'"; \
709 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
710 echo "NODED_USER = '$(NODED_USER)'"; \
711 echo "VCS_VERSION = '$$VCSVER'"; \
712 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
715 $(REPLACE_VARS_SED): Makefile
717 { echo 's#@PREFIX@#$(prefix)#g'; \
718 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
719 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
720 echo 's#@BINDIR@#$(bindir)#g'; \
721 echo 's#@SBINDIR@#$(sbindir)#g'; \
722 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
723 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
724 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
725 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
726 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
727 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
728 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
729 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
730 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
731 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
732 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
733 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
734 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
735 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
736 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
737 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
738 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
739 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
742 # Using deferred evaluation
743 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
744 daemons/ganeti-watcher: MODULE = ganeti.watcher
745 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
747 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
748 test -n "$(MODULE)" || { echo Missing module; exit 1; }
750 { echo '#!/usr/bin/python'; \
751 echo '# This file is automatically generated, do not edit!'; \
752 echo "# Edit $(MODULE) instead."; \
754 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
756 echo '# pylint: disable-msg=C0103'; \
757 echo '# C0103: Invalid name'; \
760 echo 'import $(MODULE) as main'; \
762 echo '# Temporarily alias commands until bash completion'; \
763 echo '# generator is changed'; \
764 echo 'if hasattr(main, "commands"):'; \
765 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
767 echo 'if __name__ == "__main__":'; \
768 echo ' sys.exit(main.Main())'; \
772 # We need to create symlinks because "make distcheck" will not install Python
773 # files when building.
774 stamp-srclinks: Makefile | $(all_dirfiles)
776 for i in $(srclink_files); do \
777 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
778 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
785 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
788 check-dirs: $(BUILT_SOURCES)
790 find . -type d \( \( -name . \) -o \( \
792 -name autom4te.cache \
793 \) -prune -o -print \) | { \
797 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
798 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
801 for dir in $(DIRS); do \
802 if ! test -d "$$dir"; then \
803 echo "Directory $$dir listed in DIRS does not exist" >&2; \
807 if test -n "$$error"; then exit 1; else exit 0; fi; \
810 check-local: check-dirs
811 $(CHECK_PYTHON_CODE) $(check_python_code)
812 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
813 $(CHECK_NEWS) < $(top_srcdir)/NEWS
816 lint: $(BUILT_SOURCES)
817 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
818 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
819 cd $(top_srcdir)/qa && \
820 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
821 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
823 # a dist hook rule for updating the vcs-version file; this is
824 # hardcoded due to where it needs to build the file...
826 $(MAKE) regen-vcs-version && \
827 rm -f $(top_distdir)/vcs-version && \
828 cp -p $(srcdir)/vcs-version $(top_distdir)
830 # a distcheck hook rule for catching revision control directories
832 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
833 echo "Found revision control files in final archive." 1>&2; \
836 if find $(top_distdir) -name '*.py[co]' | grep .; then \
837 echo "Found Python byte code in final archive." 1>&2; \
840 if find $(top_distdir) -name '*~' | grep .; then \
841 echo "Found backup files in final archive." 1>&2; \
844 # Empty files or directories should not be distributed. They can cause
845 # unnecessary warnings for packagers. Directories used by automake during
846 # distcheck must be excluded.
847 if find $(top_distdir) -empty -and -not \( \
848 -path $(top_distdir)/_build -or \
849 -path $(top_distdir)/_inst \) | grep .; then \
850 echo "Found empty files or directories in final archive." 1>&2; \
853 if test -n "$(BUILD_RELEASE)" && \
854 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
855 echo "Found unreleased version in NEWS." >&2; \
859 # When building a release, stricter checks should be used
860 distcheck-release dist-release: export BUILD_RELEASE = 1
861 distcheck-release: distcheck
865 for i in $(DIST_ARCHIVES); do \
866 echo -n "Checking $$i ... "; \
867 autotools/check-tar < $$i; \
872 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
873 "$(DESTDIR)${localstatedir}/log/ganeti" \
874 "$(DESTDIR)${localstatedir}/run/ganeti"
876 # To avoid conflicts between directory names and other targets, a file inside
877 # the directory is used to ensure its existence.
879 @mkdir_p@ $* && touch $@
882 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
883 $(RUN_IN_TEMPDIR) epydoc -v \
884 --conf $(CURDIR)/epydoc.conf \
885 --output $(CURDIR)/doc/api
888 TAGS: $(BUILT_SOURCES)
890 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
891 -path './daemons/ganeti-*' -o -path './tools/*' -o \
892 -path './qa/*.py' | \
896 coverage: $(BUILT_SOURCES) $(python_tests)
898 COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
899 TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
900 HTML_COVERAGE=$(CURDIR)/doc/coverage \
901 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
904 commit-check: distcheck lint apidoc
906 -include ./Makefile.local