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 DOCPP = $(top_srcdir)/autotools/docpp
23 REPLACE_VARS_SED = autotools/replace_vars.sed
25 clientdir = $(pkgpythondir)/client
26 hypervisordir = $(pkgpythondir)/hypervisor
27 httpdir = $(pkgpythondir)/http
28 masterddir = $(pkgpythondir)/masterd
29 confddir = $(pkgpythondir)/confd
30 rapidir = $(pkgpythondir)/rapi
31 serverdir = $(pkgpythondir)/server
32 watcherdir = $(pkgpythondir)/watcher
33 impexpddir = $(pkgpythondir)/impexpd
34 utilsdir = $(pkgpythondir)/utils
35 toolsdir = $(pkglibdir)/tools
36 docdir = $(datadir)/doc/$(PACKAGE)
38 # Delete output file if an error occurred while building it
48 doc/examples/gnt-debug \
67 BUILDTIME_DIR_AUTOCREATE = \
73 $(BUILDTIME_DIR_AUTOCREATE) \
78 ganeti-[0-9]*.[0-9]*.[0-9]* \
81 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
83 MAINTAINERCLEANFILES = \
86 doc/install-quick.rst \
91 maintainer-clean-local:
92 rm -rf $(BUILDTIME_DIRS)
95 $(addsuffix /*.py[co],$(DIRS)) \
99 autotools/replace_vars.sed \
100 daemons/daemon-util \
101 daemons/ensure-dirs \
102 daemons/ganeti-cleaner \
104 doc/examples/bash_completion \
105 doc/examples/ganeti.initd \
106 doc/examples/ganeti-kvm-poweroff.initd \
107 doc/examples/ganeti.cron \
108 doc/examples/gnt-config-backup \
109 doc/examples/hooks/ipsec \
114 $(nodist_pkgpython_PYTHON)
116 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
117 # it'll cause the target to rebuild every time.
125 nodist_pkgpython_PYTHON = \
129 lib/build/__init__.py \
130 lib/build/sphinx_ext.py
134 lib/asyncnotifier.py \
166 lib/client/__init__.py \
167 lib/client/gnt_backup.py \
168 lib/client/gnt_cluster.py \
169 lib/client/gnt_debug.py \
170 lib/client/gnt_group.py \
171 lib/client/gnt_instance.py \
172 lib/client/gnt_job.py \
173 lib/client/gnt_node.py \
176 hypervisor_PYTHON = \
177 lib/hypervisor/__init__.py \
178 lib/hypervisor/hv_base.py \
179 lib/hypervisor/hv_chroot.py \
180 lib/hypervisor/hv_fake.py \
181 lib/hypervisor/hv_kvm.py \
182 lib/hypervisor/hv_lxc.py \
183 lib/hypervisor/hv_xen.py
186 lib/rapi/__init__.py \
187 lib/rapi/baserlib.py \
189 lib/rapi/client_utils.py \
190 lib/rapi/connector.py \
194 lib/http/__init__.py \
200 lib/confd/__init__.py \
201 lib/confd/client.py \
202 lib/confd/querylib.py \
206 lib/masterd/__init__.py \
207 lib/masterd/instance.py
210 lib/impexpd/__init__.py
213 lib/watcher/__init__.py
216 lib/server/__init__.py \
217 lib/server/confd.py \
218 lib/server/masterd.py \
219 lib/server/noded.py \
223 lib/utils/__init__.py \
225 lib/utils/filelock.py \
230 lib/utils/nodesetup.py \
231 lib/utils/process.py \
234 lib/utils/wrapper.py \
244 doc/design-draft.rst \
246 doc/design-query2.rst \
247 doc/cluster-merge.rst \
248 doc/design-shared-storage.rst \
254 doc/install-quick.rst \
257 doc/move-instance.rst \
264 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
266 # Note: we use here an order-only prerequisite, as the contents of
267 # _autoconf.py are not actually influencing the html build output: it
268 # has to exist in order for the sphinx module to be loaded
269 # successfully, but we certainly don't want the docs to be rebuilt if
271 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
272 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
274 @test -n "$(SPHINX)" || \
275 { echo 'sphinx-build' not found during configure; exit 1; }
277 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
279 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
280 -D release="$(PACKAGE_VERSION)" \
281 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
282 rm -f doc/html/.buildinfo doc/html/objects.inv
285 doc/html: doc/html/index.html
287 doc/install-quick.rst: INSTALL
289 doc/upgrade.rst: UPGRADE
291 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
293 { echo '.. This file is automatically updated at build time from $<.'; \
294 echo '.. Do not edit.'; \
301 doc/design-2.1-lock-acquire.dot \
302 doc/design-2.1-lock-release.dot
304 docpng = $(patsubst %.dot,%.png,$(docdot))
306 # Things to build but not to install (add it to EXTRA_DIST if it should be
311 doc/examples/bash_completion \
312 doc/examples/ganeti.cron \
313 doc/examples/ganeti.initd \
314 doc/examples/ganeti-kvm-poweroff.initd \
315 doc/examples/gnt-config-backup \
316 doc/examples/hooks/ipsec \
321 scripts/gnt-cluster \
324 scripts/gnt-instance \
330 daemons/ganeti-confd \
331 daemons/ganeti-masterd \
332 daemons/ganeti-noded \
333 daemons/ganeti-watcher \
334 daemons/ganeti-rapi \
336 scripts/gnt-cluster \
339 scripts/gnt-instance \
358 dist_sbin_SCRIPTS = \
359 tools/ganeti-listrunner
361 nodist_sbin_SCRIPTS = \
362 $(PYTHON_BOOTSTRAP) \
363 daemons/ganeti-cleaner
365 dist_tools_SCRIPTS = \
370 tools/cluster-merge \
372 tools/move-instance \
374 tools/sanitize-config
376 pkglib_python_scripts = \
377 daemons/import-export \
378 tools/check-cert-expired
381 daemons/daemon-util \
382 daemons/ensure-dirs \
384 $(pkglib_python_scripts)
391 autotools/build-bash-completion \
392 autotools/check-python-code \
393 autotools/check-man \
394 autotools/check-news \
395 autotools/check-tar \
396 autotools/check-version \
398 autotools/gen-coverage \
399 autotools/testrunner \
401 daemons/daemon-util.in \
402 daemons/ensure-dirs.in \
403 daemons/ganeti-cleaner.in \
404 $(pkglib_python_scripts) \
412 doc/examples/ganeti.initd.in \
413 doc/examples/ganeti-kvm-poweroff.initd.in \
414 doc/examples/ganeti.cron.in \
415 doc/examples/gnt-config-backup.in \
416 doc/examples/ganeti.default \
417 doc/examples/ganeti.default-debug \
418 doc/examples/hooks/ethers \
419 doc/examples/hooks/ipsec.in \
420 doc/examples/gnt-debug/README \
421 doc/examples/gnt-debug/delay0.json \
422 doc/examples/gnt-debug/delay50.json \
435 man/ganeti-cleaner.8 \
437 man/ganeti-listrunner.8 \
438 man/ganeti-masterd.8 \
440 man/ganeti-os-interface.7 \
442 man/ganeti-watcher.8 \
452 manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
453 manhtml = $(patsubst %.rst,%.html,$(manrst))
454 mangen = $(patsubst %.rst,%.gen,$(manrst))
456 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
457 $(patsubst %.html,%.html.in,$(manhtml)) \
458 man/footer.man man/footer.html $(mangen)
461 test/data/bdev-drbd-8.0.txt \
462 test/data/bdev-drbd-8.3.txt \
463 test/data/bdev-drbd-disk.txt \
464 test/data/bdev-drbd-net-ip4.txt \
465 test/data/bdev-drbd-net-ip6.txt \
466 test/data/cert1.pem \
467 test/data/proc_drbd8.txt \
468 test/data/proc_drbd80-emptyline.txt \
469 test/data/proc_drbd83.txt \
470 test/data/sys_drbd_usermode_helper.txt \
471 test/import-export_unittest-helper
474 test/ganeti.asyncnotifier_unittest.py \
475 test/ganeti.backend_unittest.py \
476 test/ganeti.bdev_unittest.py \
477 test/ganeti.cli_unittest.py \
478 test/ganeti.client.gnt_cluster_unittest.py \
479 test/ganeti.client.gnt_instance_unittest.py \
480 test/ganeti.daemon_unittest.py \
481 test/ganeti.cmdlib_unittest.py \
482 test/ganeti.compat_unittest.py \
483 test/ganeti.confd.client_unittest.py \
484 test/ganeti.config_unittest.py \
485 test/ganeti.constants_unittest.py \
486 test/ganeti.errors_unittest.py \
487 test/ganeti.hooks_unittest.py \
488 test/ganeti.ht_unittest.py \
489 test/ganeti.http_unittest.py \
490 test/ganeti.hypervisor_unittest.py \
491 test/ganeti.hypervisor.hv_chroot_unittest.py \
492 test/ganeti.hypervisor.hv_fake_unittest.py \
493 test/ganeti.hypervisor.hv_kvm_unittest.py \
494 test/ganeti.hypervisor.hv_lxc_unittest.py \
495 test/ganeti.hypervisor.hv_xen_unittest.py \
496 test/ganeti.impexpd_unittest.py \
497 test/ganeti.jqueue_unittest.py \
498 test/ganeti.locking_unittest.py \
499 test/ganeti.luxi_unittest.py \
500 test/ganeti.masterd.instance_unittest.py \
501 test/ganeti.mcpu_unittest.py \
502 test/ganeti.netutils_unittest.py \
503 test/ganeti.objects_unittest.py \
504 test/ganeti.opcodes_unittest.py \
505 test/ganeti.qlang_unittest.py \
506 test/ganeti.query_unittest.py \
507 test/ganeti.rapi.baserlib_unittest.py \
508 test/ganeti.rapi.client_unittest.py \
509 test/ganeti.rapi.resources_unittest.py \
510 test/ganeti.rapi.rlib2_unittest.py \
511 test/ganeti.rpc_unittest.py \
512 test/ganeti.runtime_unittest.py \
513 test/ganeti.serializer_unittest.py \
514 test/ganeti.ssh_unittest.py \
515 test/ganeti.uidpool_unittest.py \
516 test/ganeti.utils.algo_unittest.py \
517 test/ganeti.utils.filelock_unittest.py \
518 test/ganeti.utils.hash_unittest.py \
519 test/ganeti.utils.io_unittest.py \
520 test/ganeti.utils.log_unittest.py \
521 test/ganeti.utils.mlock_unittest.py \
522 test/ganeti.utils.nodesetup_unittest.py \
523 test/ganeti.utils.process_unittest.py \
524 test/ganeti.utils.retry_unittest.py \
525 test/ganeti.utils.text_unittest.py \
526 test/ganeti.utils.wrapper_unittest.py \
527 test/ganeti.utils.x509_unittest.py \
528 test/ganeti.utils_unittest.py \
529 test/ganeti.workerpool_unittest.py \
530 test/cfgupgrade_unittest.py \
531 test/docs_unittest.py \
532 test/tempfile_fork_unittest.py
535 test/check-cert-expired_unittest.bash \
536 test/daemon-util_unittest.bash \
537 test/ganeti-cleaner_unittest.bash \
538 test/import-export_unittest.bash \
543 TESTS = $(dist_TESTS) $(nodist_TESTS)
545 # Environment for all tests
546 PLAIN_TESTS_ENVIRONMENT = \
547 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
549 # Environment for tests run by automake
550 TESTS_ENVIRONMENT = \
551 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
554 $(dist_sbin_SCRIPTS) \
555 $(dist_tools_SCRIPTS) \
556 $(pkglib_python_scripts) \
558 $(pkgpython_PYTHON) \
560 $(hypervisor_PYTHON) \
574 test/check-cert-expired_unittest.bash \
575 test/daemon-util_unittest.bash \
576 test/ganeti-cleaner_unittest.bash \
577 test/import-export_unittest.bash \
580 check_python_code = \
581 $(BUILD_BASH_COMPLETION) \
587 ganeti/http/server.py \
588 $(dist_sbin_SCRIPTS) \
589 $(dist_tools_SCRIPTS) \
590 $(pkglib_python_scripts) \
591 $(BUILD_BASH_COMPLETION) \
595 test/daemon-util_unittest.bash: daemons/daemon-util
597 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
599 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
600 sed -f $(REPLACE_VARS_SED) < $< > $@
603 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
604 sed -f $(REPLACE_VARS_SED) < $< > $@
607 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
608 sed -f $(REPLACE_VARS_SED) < $< > $@
611 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
612 sed -f $(REPLACE_VARS_SED) < $< > $@
614 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
615 sed -f $(REPLACE_VARS_SED) < $< > $@
617 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
618 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
619 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
622 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
623 $(DOT) -Tpng -o $@ $<
625 man/footer.man: man/footer.rst
626 @test -n "$(PANDOC)" || \
627 { echo 'pandoc' not found during configure; exit 1; }
628 $(PANDOC) -f rst -t man -o $@ $<
630 man/footer.html: man/footer.rst
631 @test -n "$(PANDOC)" || \
632 { echo 'pandoc' not found during configure; exit 1; }
633 $(PANDOC) -f rst -t html -o $@ $<
635 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
636 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
638 man/%.7.in man/%.8.in: man/%.gen man/footer.man
639 @test -n "$(PANDOC)" || \
640 { echo 'pandoc' not found during configure; exit 1; }
642 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
643 sed -e 's/\\@/@/g' > $@
644 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
646 man/%.html.in: man/%.gen man/footer.html
647 @test -n "$(PANDOC)" || \
648 { echo 'pandoc' not found during configure; exit 1; }
650 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
651 sed -e 's/\\@/@/g' > $@
653 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
654 sed -f $(REPLACE_VARS_SED) < $< > $@
656 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
657 sed -f $(REPLACE_VARS_SED) < $< > $@
659 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
660 sed -f $(REPLACE_VARS_SED) < $< > $@
662 epydoc.conf: epydoc.conf.in Makefile
663 sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
666 if test -d .git; then \
668 elif test ! -f $@ ; then \
669 echo "Cannot auto-generate $@ file"; exit 1; \
672 .PHONY: regen-vcs-version
676 if test -d .git; then \
678 $(MAKE) vcs-version; \
681 lib/_autoconf.py: Makefile vcs-version | lib/.dir
683 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
684 { echo '# This file is automatically generated, do not edit!'; \
687 echo '"""Build-time configuration for Ganeti.'; \
689 echo 'This file is autogenerated by the build process.'; \
690 echo 'For any changes you need to re-run ./configure (and'; \
691 echo 'not edit by hand).'; \
695 echo '# pylint: disable-msg=C0301,C0324'; \
696 echo '# because this is autogenerated, we do not want'; \
697 echo '# style warnings' ; \
699 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
700 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
701 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
702 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
703 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
704 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
705 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
706 echo "SYSCONFDIR = '$(sysconfdir)'"; \
707 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
708 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
709 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
710 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
711 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
712 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
713 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
714 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
715 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
716 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
717 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
718 echo "KVM_PATH = '$(KVM_PATH)'"; \
719 echo "SOCAT_PATH = '$(SOCAT)'"; \
720 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
721 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
722 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
723 echo "TOOLSDIR = '$(toolsdir)'"; \
724 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
725 echo "PKGLIBDIR = '$(pkglibdir)'"; \
726 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
727 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
728 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
729 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
730 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
731 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
732 echo "RAPI_USER = '$(RAPI_USER)'"; \
733 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
734 echo "CONFD_USER = '$(CONFD_USER)'"; \
735 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
736 echo "NODED_USER = '$(NODED_USER)'"; \
737 echo "VCS_VERSION = '$$VCSVER'"; \
738 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
741 $(REPLACE_VARS_SED): Makefile
743 { echo 's#@PREFIX@#$(prefix)#g'; \
744 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
745 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
746 echo 's#@BINDIR@#$(bindir)#g'; \
747 echo 's#@SBINDIR@#$(sbindir)#g'; \
748 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
749 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
750 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
751 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
752 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
753 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
754 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
755 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
756 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
757 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
758 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
759 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
760 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
761 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
762 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
763 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
764 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
765 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
768 # Using deferred evaluation
769 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
770 daemons/ganeti-watcher: MODULE = ganeti.watcher
771 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
773 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
774 test -n "$(MODULE)" || { echo Missing module; exit 1; }
776 { echo '#!/usr/bin/python'; \
777 echo '# This file is automatically generated, do not edit!'; \
778 echo "# Edit $(MODULE) instead."; \
780 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
782 echo '# pylint: disable-msg=C0103'; \
783 echo '# C0103: Invalid name'; \
786 echo 'import $(MODULE) as main'; \
788 echo '# Temporarily alias commands until bash completion'; \
789 echo '# generator is changed'; \
790 echo 'if hasattr(main, "commands"):'; \
791 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
793 echo 'if __name__ == "__main__":'; \
794 echo ' sys.exit(main.Main())'; \
798 # We need to create symlinks because "make distcheck" will not install Python
799 # files when building.
800 stamp-srclinks: Makefile | $(all_dirfiles)
802 for i in $(srclink_files); do \
803 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
804 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
811 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
814 check-dirs: $(BUILT_SOURCES)
816 find . -type d \( \( -name . \) -o \( \
818 -name autom4te.cache \
819 \) -prune -o -print \) | { \
823 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
824 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
827 for dir in $(DIRS); do \
828 if ! test -d "$$dir"; then \
829 echo "Directory $$dir listed in DIRS does not exist" >&2; \
833 if test -n "$$error"; then exit 1; else exit 0; fi; \
836 check-local: check-dirs
837 $(CHECK_PYTHON_CODE) $(check_python_code)
838 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
839 $(CHECK_NEWS) < $(top_srcdir)/NEWS
842 lint: $(BUILT_SOURCES)
843 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
844 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
845 cd $(top_srcdir)/qa && \
846 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
847 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
849 # a dist hook rule for updating the vcs-version file; this is
850 # hardcoded due to where it needs to build the file...
852 $(MAKE) regen-vcs-version && \
853 rm -f $(top_distdir)/vcs-version && \
854 cp -p $(srcdir)/vcs-version $(top_distdir)
856 # a distcheck hook rule for catching revision control directories
858 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
859 echo "Found revision control files in final archive." 1>&2; \
862 if find $(top_distdir) -name '*.py[co]' | grep .; then \
863 echo "Found Python byte code in final archive." 1>&2; \
866 if find $(top_distdir) -name '*~' | grep .; then \
867 echo "Found backup files in final archive." 1>&2; \
870 # Empty files or directories should not be distributed. They can cause
871 # unnecessary warnings for packagers. Directories used by automake during
872 # distcheck must be excluded.
873 if find $(top_distdir) -empty -and -not \( \
874 -path $(top_distdir)/_build -or \
875 -path $(top_distdir)/_inst \) | grep .; then \
876 echo "Found empty files or directories in final archive." 1>&2; \
879 if test -n "$(BUILD_RELEASE)" && \
880 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
881 echo "Found unreleased version in NEWS." >&2; \
885 # When building a release, stricter checks should be used
886 distcheck-release dist-release: export BUILD_RELEASE = 1
887 distcheck-release: distcheck
891 for i in $(DIST_ARCHIVES); do \
892 echo -n "Checking $$i ... "; \
893 autotools/check-tar < $$i; \
898 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
899 "$(DESTDIR)${localstatedir}/log/ganeti" \
900 "$(DESTDIR)${localstatedir}/run/ganeti"
902 # To avoid conflicts between directory names and other targets, a file inside
903 # the directory is used to ensure its existence.
905 @mkdir_p@ $* && touch $@
908 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
909 $(RUN_IN_TEMPDIR) epydoc -v \
910 --conf $(CURDIR)/epydoc.conf \
911 --output $(CURDIR)/doc/api
914 TAGS: $(BUILT_SOURCES)
916 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
917 -path './daemons/ganeti-*' -o -path './tools/*' -o \
918 -path './qa/*.py' | \
922 coverage: $(BUILT_SOURCES) $(python_tests)
924 COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
925 TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
926 HTML_COVERAGE=$(CURDIR)/doc/coverage \
927 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
930 commit-check: distcheck lint apidoc
932 -include ./Makefile.local