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 # Note: these are automake-specific variables, and must be named after
26 # the directory + 'dir' suffix
27 clientdir = $(pkgpythondir)/client
28 hypervisordir = $(pkgpythondir)/hypervisor
29 httpdir = $(pkgpythondir)/http
30 masterddir = $(pkgpythondir)/masterd
31 confddir = $(pkgpythondir)/confd
32 rapidir = $(pkgpythondir)/rapi
33 serverdir = $(pkgpythondir)/server
34 watcherdir = $(pkgpythondir)/watcher
35 impexpddir = $(pkgpythondir)/impexpd
36 utilsdir = $(pkgpythondir)/utils
37 toolsdir = $(pkglibdir)/tools
38 iallocatorsdir = $(pkglibdir)/iallocators
39 pytoolsdir = $(pkgpythondir)/tools
40 docdir = $(datadir)/doc/$(PACKAGE)
42 # Delete output file if an error occurred while building it
57 doc/examples/gnt-debug \
78 BUILDTIME_DIR_AUTOCREATE = \
83 $(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
90 $(BUILDTIME_DIR_AUTOCREATE) \
95 ganeti-[0-9]*.[0-9]*.[0-9]* \
98 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
101 COVERAGE_DIR = doc/coverage
102 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
103 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
105 APIDOC_PY_DIR = $(APIDOC_DIR)/py
106 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
108 MAINTAINERCLEANFILES = \
111 doc/install-quick.rst \
116 maintainer-clean-local:
117 rm -rf $(BUILDTIME_DIRS)
120 $(addsuffix /*.py[co],$(DIRS)) \
121 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
122 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
124 $(PYTHON_BOOTSTRAP) \
126 autotools/replace_vars.sed \
127 daemons/daemon-util \
128 daemons/ganeti-cleaner \
130 doc/examples/bash_completion \
131 doc/examples/ganeti.initd \
132 doc/examples/ganeti-kvm-poweroff.initd \
133 doc/examples/ganeti.cron \
134 doc/examples/gnt-config-backup \
135 doc/examples/hooks/ipsec \
140 $(nodist_pkgpython_PYTHON) \
141 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
142 .hpc/*.mix htools/*.tix \
145 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
146 # it'll cause the target to rebuild every time.
154 nodist_pkgpython_PYTHON = \
158 lib/build/__init__.py \
159 lib/build/sphinx_ext.py
163 lib/asyncnotifier.py \
195 lib/client/__init__.py \
196 lib/client/gnt_backup.py \
197 lib/client/gnt_cluster.py \
198 lib/client/gnt_debug.py \
199 lib/client/gnt_group.py \
200 lib/client/gnt_instance.py \
201 lib/client/gnt_job.py \
202 lib/client/gnt_node.py \
205 hypervisor_PYTHON = \
206 lib/hypervisor/__init__.py \
207 lib/hypervisor/hv_base.py \
208 lib/hypervisor/hv_chroot.py \
209 lib/hypervisor/hv_fake.py \
210 lib/hypervisor/hv_kvm.py \
211 lib/hypervisor/hv_lxc.py \
212 lib/hypervisor/hv_xen.py
215 lib/rapi/__init__.py \
216 lib/rapi/baserlib.py \
218 lib/rapi/client_utils.py \
219 lib/rapi/connector.py \
223 lib/http/__init__.py \
229 lib/confd/__init__.py \
230 lib/confd/client.py \
231 lib/confd/querylib.py \
235 lib/masterd/__init__.py \
236 lib/masterd/instance.py
239 lib/impexpd/__init__.py
242 lib/watcher/__init__.py
245 lib/server/__init__.py \
246 lib/server/confd.py \
247 lib/server/masterd.py \
248 lib/server/noded.py \
252 lib/tools/__init__.py \
253 lib/tools/ensure_dirs.py
256 lib/utils/__init__.py \
258 lib/utils/filelock.py \
263 lib/utils/nodesetup.py \
264 lib/utils/process.py \
267 lib/utils/wrapper.py \
276 doc/design-htools-2.3.rst \
278 doc/design-draft.rst \
280 doc/design-query2.rst \
281 doc/design-x509-ca.rst \
282 doc/design-http-server.rst \
283 doc/design-impexp2.rst \
284 doc/design-lu-generated-jobs.rst \
285 doc/design-multi-reloc.rst \
286 doc/cluster-merge.rst \
287 doc/design-shared-storage.rst \
293 doc/install-quick.rst \
296 doc/move-instance.rst \
309 HS_ALL_PROGS = $(HS_PROGS) htools/test
310 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
311 # we don't add -Werror by default
312 HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
313 # extra flags that can be overriden on the command line
315 # exclude options for coverage reports
316 HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
319 htools/Ganeti/HTools/CLI.hs \
320 htools/Ganeti/HTools/Cluster.hs \
321 htools/Ganeti/HTools/Container.hs \
322 htools/Ganeti/HTools/ExtLoader.hs \
323 htools/Ganeti/HTools/Group.hs \
324 htools/Ganeti/HTools/IAlloc.hs \
325 htools/Ganeti/HTools/Instance.hs \
326 htools/Ganeti/HTools/Loader.hs \
327 htools/Ganeti/HTools/Luxi.hs \
328 htools/Ganeti/HTools/Node.hs \
329 htools/Ganeti/HTools/PeerMap.hs \
330 htools/Ganeti/HTools/QC.hs \
331 htools/Ganeti/HTools/Rapi.hs \
332 htools/Ganeti/HTools/Simu.hs \
333 htools/Ganeti/HTools/Text.hs \
334 htools/Ganeti/HTools/Types.hs \
335 htools/Ganeti/HTools/Utils.hs \
336 htools/Ganeti/Jobs.hs \
337 htools/Ganeti/Luxi.hs \
338 htools/Ganeti/OpCodes.hs
340 HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
341 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
343 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
345 # Note: we use here an order-only prerequisite, as the contents of
346 # _autoconf.py are not actually influencing the html build output: it
347 # has to exist in order for the sphinx module to be loaded
348 # successfully, but we certainly don't want the docs to be rebuilt if
350 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
351 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
353 @test -n "$(SPHINX)" || \
354 { echo 'sphinx-build' not found during configure; exit 1; }
356 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
358 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
359 -D release="$(PACKAGE_VERSION)" \
360 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
361 rm -f doc/html/.buildinfo doc/html/objects.inv
364 doc/html: doc/html/index.html
366 doc/install-quick.rst: INSTALL
368 doc/upgrade.rst: UPGRADE
370 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
372 { echo '.. This file is automatically updated at build time from $<.'; \
373 echo '.. Do not edit.'; \
380 doc/design-2.1-lock-acquire.dot \
381 doc/design-2.1-lock-release.dot
383 docpng = $(patsubst %.dot,%.png,$(docdot))
385 # Things to build but not to install (add it to EXTRA_DIST if it should be
390 doc/examples/bash_completion \
391 doc/examples/ganeti.cron \
392 doc/examples/ganeti.initd \
393 doc/examples/ganeti-kvm-poweroff.initd \
394 doc/examples/gnt-config-backup \
395 doc/examples/hooks/ipsec \
400 scripts/gnt-cluster \
403 scripts/gnt-instance \
408 PYTHON_BOOTSTRAP_SBIN = \
409 daemons/ganeti-confd \
410 daemons/ganeti-masterd \
411 daemons/ganeti-noded \
412 daemons/ganeti-watcher \
413 daemons/ganeti-rapi \
415 scripts/gnt-cluster \
418 scripts/gnt-instance \
424 $(PYTHON_BOOTSTRAP_SBIN) \
442 iallocators_SCRIPTS =
444 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
445 iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
448 $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
449 @if [ -z "$(HTOOLS)" ]; then \
450 echo "Error: htools compilation disabled at configure time" 1>&2 ;\
453 @BINARY=$(@:htools/%=%); \
454 if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
455 echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
458 BINARY=$(@:htools/%=%); $(GHC) --make \
459 $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
460 -osuf $$BINARY.o -hisuf $$BINARY.hi $@
462 # for the htools/test binary, we need to enable profiling/coverage
463 htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
464 -fno-warn-monomorphism-restriction -fno-warn-orphans \
465 -fno-warn-missing-methods -fno-warn-unused-imports
467 dist_sbin_SCRIPTS = \
468 tools/ganeti-listrunner
470 nodist_sbin_SCRIPTS = \
471 $(PYTHON_BOOTSTRAP_SBIN) \
472 daemons/ganeti-cleaner
474 dist_tools_SCRIPTS = \
479 tools/cluster-merge \
481 tools/move-instance \
483 tools/sanitize-config
485 pkglib_python_scripts = \
486 daemons/import-export \
487 tools/check-cert-expired
489 nodist_pkglib_python_scripts = \
493 daemons/daemon-util \
495 $(pkglib_python_scripts)
497 nodist_pkglib_SCRIPTS = \
498 $(nodist_pkglib_python_scripts)
505 autotools/build-bash-completion \
506 autotools/check-python-code \
507 autotools/check-man \
508 autotools/check-news \
509 autotools/check-tar \
510 autotools/check-version \
512 autotools/gen-coverage \
513 autotools/testrunner \
515 daemons/daemon-util.in \
516 daemons/ganeti-cleaner.in \
517 $(pkglib_python_scripts) \
525 doc/examples/ganeti.initd.in \
526 doc/examples/ganeti-kvm-poweroff.initd.in \
527 doc/examples/ganeti.cron.in \
528 doc/examples/gnt-config-backup.in \
529 doc/examples/ganeti.default \
530 doc/examples/ganeti.default-debug \
531 doc/examples/hooks/ethers \
532 doc/examples/hooks/ipsec.in \
533 doc/examples/gnt-debug/README \
534 doc/examples/gnt-debug/delay0.json \
535 doc/examples/gnt-debug/delay50.json \
545 $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
550 man/ganeti-cleaner.8 \
552 man/ganeti-listrunner.8 \
553 man/ganeti-masterd.8 \
555 man/ganeti-os-interface.7 \
557 man/ganeti-watcher.8 \
571 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
572 manhtml = $(patsubst %.rst,%.html,$(manrst))
573 mangen = $(patsubst %.rst,%.gen,$(manrst))
575 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
576 $(patsubst %.html,%.html.in,$(manhtml)) \
577 man/footer.man man/footer.html $(mangen)
580 test/data/bdev-drbd-8.0.txt \
581 test/data/bdev-drbd-8.3.txt \
582 test/data/bdev-drbd-disk.txt \
583 test/data/bdev-drbd-net-ip4.txt \
584 test/data/bdev-drbd-net-ip6.txt \
585 test/data/cert1.pem \
586 test/data/proc_drbd8.txt \
587 test/data/proc_drbd80-emptyline.txt \
588 test/data/proc_drbd83.txt \
589 test/data/sys_drbd_usermode_helper.txt \
590 test/import-export_unittest-helper
593 test/ganeti.asyncnotifier_unittest.py \
594 test/ganeti.backend_unittest.py \
595 test/ganeti.bdev_unittest.py \
596 test/ganeti.cli_unittest.py \
597 test/ganeti.client.gnt_cluster_unittest.py \
598 test/ganeti.client.gnt_instance_unittest.py \
599 test/ganeti.daemon_unittest.py \
600 test/ganeti.cmdlib_unittest.py \
601 test/ganeti.compat_unittest.py \
602 test/ganeti.confd.client_unittest.py \
603 test/ganeti.config_unittest.py \
604 test/ganeti.constants_unittest.py \
605 test/ganeti.errors_unittest.py \
606 test/ganeti.hooks_unittest.py \
607 test/ganeti.ht_unittest.py \
608 test/ganeti.http_unittest.py \
609 test/ganeti.hypervisor_unittest.py \
610 test/ganeti.hypervisor.hv_chroot_unittest.py \
611 test/ganeti.hypervisor.hv_fake_unittest.py \
612 test/ganeti.hypervisor.hv_kvm_unittest.py \
613 test/ganeti.hypervisor.hv_lxc_unittest.py \
614 test/ganeti.hypervisor.hv_xen_unittest.py \
615 test/ganeti.impexpd_unittest.py \
616 test/ganeti.jqueue_unittest.py \
617 test/ganeti.locking_unittest.py \
618 test/ganeti.luxi_unittest.py \
619 test/ganeti.masterd.instance_unittest.py \
620 test/ganeti.mcpu_unittest.py \
621 test/ganeti.netutils_unittest.py \
622 test/ganeti.objects_unittest.py \
623 test/ganeti.opcodes_unittest.py \
624 test/ganeti.qlang_unittest.py \
625 test/ganeti.query_unittest.py \
626 test/ganeti.rapi.baserlib_unittest.py \
627 test/ganeti.rapi.client_unittest.py \
628 test/ganeti.rapi.resources_unittest.py \
629 test/ganeti.rapi.rlib2_unittest.py \
630 test/ganeti.rpc_unittest.py \
631 test/ganeti.runtime_unittest.py \
632 test/ganeti.serializer_unittest.py \
633 test/ganeti.ssh_unittest.py \
634 test/ganeti.tools.ensure_dirs_unittest.py \
635 test/ganeti.uidpool_unittest.py \
636 test/ganeti.utils.algo_unittest.py \
637 test/ganeti.utils.filelock_unittest.py \
638 test/ganeti.utils.hash_unittest.py \
639 test/ganeti.utils.io_unittest.py \
640 test/ganeti.utils.log_unittest.py \
641 test/ganeti.utils.mlock_unittest.py \
642 test/ganeti.utils.nodesetup_unittest.py \
643 test/ganeti.utils.process_unittest.py \
644 test/ganeti.utils.retry_unittest.py \
645 test/ganeti.utils.text_unittest.py \
646 test/ganeti.utils.wrapper_unittest.py \
647 test/ganeti.utils.x509_unittest.py \
648 test/ganeti.utils_unittest.py \
649 test/ganeti.workerpool_unittest.py \
650 test/cfgupgrade_unittest.py \
651 test/docs_unittest.py \
652 test/tempfile_fork_unittest.py
654 haskell_tests = htools/test
657 test/check-cert-expired_unittest.bash \
658 test/daemon-util_unittest.bash \
659 test/ganeti-cleaner_unittest.bash \
660 test/import-export_unittest.bash \
665 nodist_TESTS += $(haskell_tests)
668 TESTS = $(dist_TESTS) $(nodist_TESTS)
670 # Environment for all tests
671 PLAIN_TESTS_ENVIRONMENT = \
672 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
674 # Environment for tests run by automake
675 TESTS_ENVIRONMENT = \
676 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
679 $(dist_sbin_SCRIPTS) \
680 $(dist_tools_SCRIPTS) \
681 $(pkglib_python_scripts) \
682 $(nodist_pkglib_python_scripts) \
684 $(pkgpython_PYTHON) \
686 $(hypervisor_PYTHON) \
701 test/check-cert-expired_unittest.bash \
702 test/daemon-util_unittest.bash \
703 test/ganeti-cleaner_unittest.bash \
704 test/import-export_unittest.bash \
706 $(HS_LIB_SRCS) $(HS_PROG_SRCS)
708 check_python_code = \
709 $(BUILD_BASH_COMPLETION) \
715 ganeti/http/server.py \
716 $(dist_sbin_SCRIPTS) \
717 $(dist_tools_SCRIPTS) \
718 $(pkglib_python_scripts) \
719 $(BUILD_BASH_COMPLETION) \
723 test/daemon-util_unittest.bash: daemons/daemon-util
725 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
727 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
728 sed -f $(REPLACE_VARS_SED) < $< > $@
731 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
732 sed -f $(REPLACE_VARS_SED) < $< > $@
735 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
736 sed -f $(REPLACE_VARS_SED) < $< > $@
739 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
740 sed -f $(REPLACE_VARS_SED) < $< > $@
742 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
743 sed -f $(REPLACE_VARS_SED) < $< > $@
745 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
746 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
747 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
750 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
751 $(DOT) -Tpng -o $@ $<
753 man/footer.man: man/footer.rst
754 @test -n "$(PANDOC)" || \
755 { echo 'pandoc' not found during configure; exit 1; }
756 $(PANDOC) -f rst -t man -o $@ $<
758 man/footer.html: man/footer.rst
759 @test -n "$(PANDOC)" || \
760 { echo 'pandoc' not found during configure; exit 1; }
761 $(PANDOC) -f rst -t html -o $@ $<
763 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
764 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
766 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
767 @test -n "$(PANDOC)" || \
768 { echo 'pandoc' not found during configure; exit 1; }
770 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
771 sed -e 's/\\@/@/g' > $@
772 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
774 man/%.html.in: man/%.gen man/footer.html
775 @test -n "$(PANDOC)" || \
776 { echo 'pandoc' not found during configure; exit 1; }
778 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
779 sed -e 's/\\@/@/g' > $@
781 man/%.1: man/%.1.in $(REPLACE_VARS_SED)
782 sed -f $(REPLACE_VARS_SED) < $< > $@
784 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
785 sed -f $(REPLACE_VARS_SED) < $< > $@
787 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
788 sed -f $(REPLACE_VARS_SED) < $< > $@
790 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
791 sed -f $(REPLACE_VARS_SED) < $< > $@
793 epydoc.conf: epydoc.conf.in Makefile
794 sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
797 if test -d .git; then \
799 elif test ! -f $@ ; then \
800 echo "Cannot auto-generate $@ file"; exit 1; \
803 .PHONY: regen-vcs-version
807 if test -d .git; then \
809 $(MAKE) vcs-version; \
812 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
814 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
815 sed -e "s/%ver%/$$VCSVER/" < $< > $@
817 lib/_autoconf.py: Makefile vcs-version | lib/.dir
819 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
820 { echo '# This file is automatically generated, do not edit!'; \
823 echo '"""Build-time configuration for Ganeti.'; \
825 echo 'This file is autogenerated by the build process.'; \
826 echo 'For any changes you need to re-run ./configure (and'; \
827 echo 'not edit by hand).'; \
831 echo '# pylint: disable-msg=C0301,C0324'; \
832 echo '# because this is autogenerated, we do not want'; \
833 echo '# style warnings' ; \
835 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
836 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
837 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
838 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
839 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
840 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
841 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
842 echo "SYSCONFDIR = '$(sysconfdir)'"; \
843 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
844 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
845 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
846 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
847 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
848 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
849 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
850 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
851 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
852 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
853 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
854 echo "KVM_PATH = '$(KVM_PATH)'"; \
855 echo "SOCAT_PATH = '$(SOCAT)'"; \
856 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
857 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
858 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
859 echo "TOOLSDIR = '$(toolsdir)'"; \
860 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
861 echo "PKGLIBDIR = '$(pkglibdir)'"; \
862 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
863 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
864 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
865 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
866 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
867 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
868 echo "RAPI_USER = '$(RAPI_USER)'"; \
869 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
870 echo "CONFD_USER = '$(CONFD_USER)'"; \
871 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
872 echo "NODED_USER = '$(NODED_USER)'"; \
873 echo "VCS_VERSION = '$$VCSVER'"; \
874 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
875 if [ "$(HTOOLS)" ]; then \
876 echo "HTOOLS = True"; \
878 echo "HTOOLS = False"; \
882 $(REPLACE_VARS_SED): Makefile
884 { echo 's#@PREFIX@#$(prefix)#g'; \
885 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
886 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
887 echo 's#@BINDIR@#$(bindir)#g'; \
888 echo 's#@SBINDIR@#$(sbindir)#g'; \
889 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
890 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
891 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
892 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
893 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
894 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
895 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
896 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
897 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
898 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
899 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
900 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
901 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
902 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
903 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
904 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
905 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
906 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
909 # Using deferred evaluation
910 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
911 daemons/ganeti-watcher: MODULE = ganeti.watcher
912 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
913 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
915 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
916 test -n "$(MODULE)" || { echo Missing module; exit 1; }
918 { echo '#!/usr/bin/python'; \
919 echo '# This file is automatically generated, do not edit!'; \
920 echo "# Edit $(MODULE) instead."; \
922 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
924 echo '# pylint: disable-msg=C0103'; \
925 echo '# C0103: Invalid name'; \
928 echo 'import $(MODULE) as main'; \
930 echo '# Temporarily alias commands until bash completion'; \
931 echo '# generator is changed'; \
932 echo 'if hasattr(main, "commands"):'; \
933 echo ' commands = main.commands # pylint: disable-msg=E1101'; \
935 echo 'if __name__ == "__main__":'; \
936 echo ' sys.exit(main.Main())'; \
940 # We need to create symlinks because "make distcheck" will not install Python
941 # files when building.
942 stamp-srclinks: Makefile | $(all_dirfiles)
944 for i in $(srclink_files); do \
945 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
946 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
953 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
956 check-dirs: $(BUILT_SOURCES)
958 find . -type d \( \( -name . \) -o \( \
960 -name autom4te.cache \
961 \) -prune -o -print \) | { \
965 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
966 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
969 for dir in $(DIRS); do \
970 if ! test -d "$$dir"; then \
971 echo "Directory $$dir listed in DIRS does not exist" >&2; \
975 if test -n "$$error"; then exit 1; else exit 0; fi; \
978 check-local: check-dirs
979 $(CHECK_PYTHON_CODE) $(check_python_code)
980 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
981 $(CHECK_NEWS) < $(top_srcdir)/NEWS
984 hs-check: htools/test
989 lint: $(BUILT_SOURCES)
990 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
991 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
992 cd $(top_srcdir)/qa && \
993 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
994 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
997 hlint: $(HS_BUILT_SRCS)
998 if tty -s; then C="-c"; else C=""; fi; \
999 hlint --report=doc/hs-lint.html $$C htools
1001 # a dist hook rule for updating the vcs-version file; this is
1002 # hardcoded due to where it needs to build the file...
1004 $(MAKE) regen-vcs-version && \
1005 rm -f $(top_distdir)/vcs-version && \
1006 cp -p $(srcdir)/vcs-version $(top_distdir)
1008 # a distcheck hook rule for catching revision control directories
1010 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1011 echo "Found revision control files in final archive." 1>&2; \
1014 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1015 echo "Found Python byte code in final archive." 1>&2; \
1018 if find $(top_distdir) -name '*~' | grep .; then \
1019 echo "Found backup files in final archive." 1>&2; \
1022 # Empty files or directories should not be distributed. They can cause
1023 # unnecessary warnings for packagers. Directories used by automake during
1024 # distcheck must be excluded.
1025 if find $(top_distdir) -empty -and -not \( \
1026 -path $(top_distdir)/_build -or \
1027 -path $(top_distdir)/_inst \) | grep .; then \
1028 echo "Found empty files or directories in final archive." 1>&2; \
1031 if test -n "$(BUILD_RELEASE)" && \
1032 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1033 echo "Found unreleased version in NEWS." >&2; \
1037 # When building a release, stricter checks should be used
1038 distcheck-release dist-release: export BUILD_RELEASE = 1
1039 distcheck-release: distcheck
1043 for i in $(DIST_ARCHIVES); do \
1044 echo -n "Checking $$i ... "; \
1045 autotools/check-tar < $$i; \
1050 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1051 "$(DESTDIR)${localstatedir}/log/ganeti" \
1052 "$(DESTDIR)${localstatedir}/run/ganeti"
1054 # To avoid conflicts between directory names and other targets, a file inside
1055 # the directory is used to ensure its existence.
1057 @mkdir_p@ $* && touch $@
1060 if WANT_HTOOLSAPIDOC
1061 apidoc: py-apidoc hs-apidoc
1067 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1068 $(RUN_IN_TEMPDIR) epydoc -v \
1069 --conf $(CURDIR)/epydoc.conf \
1070 --output $(CURDIR)/$(APIDOC_PY_DIR)
1073 hs-apidoc: $(HS_BUILT_SRCS)
1074 @test -n "$(HSCOLOUR)" || \
1075 { echo 'HsColour' not found during configure; exit 1; }
1076 @test -n "$(HADDOCK)" || \
1077 { echo 'haddock' not found during configure; exit 1; }
1078 rm -rf $(APIDOC_HS_DIR)/*
1079 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools
1080 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1081 ln -s ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1084 if [ "$(HTOOLS_NOCURL)" ]; \
1085 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1088 RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
1089 for file in $$RELSRCS; do \
1090 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1091 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1093 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1094 -t ganeti-htools -p haddock-prologue \
1095 --source-module="%{MODULE/.//}.html" \
1096 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1098 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1101 TAGS: $(BUILT_SOURCES)
1103 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1104 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1105 -path './qa/*.py' | \
1110 coverage: py-coverage hs-coverage
1112 coverage: py-coverage
1116 py-coverage: $(BUILT_SOURCES) $(python_tests)
1118 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1119 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1120 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1121 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1125 hs-coverage: $(haskell_tests)
1126 cd htools && rm -f *.tix *.mix && ./test
1127 mkdir -p $(COVERAGE_HS_DIR)
1128 hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL)
1129 hpc report htools/test $(HPCEXCL)
1130 ln -sf hpc_index.html $(COVERAGE_HS_DIR)/index.html
1132 # Special "kind-of-QA" target for htools, needs special setup (all
1133 # tools compiled with -fhpc)
1138 rm -f .hpc; ln -s ../.hpc .hpc; \
1139 rm -f *.tix *.mix; \
1141 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1142 --output=live-test.tix ; \
1143 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1144 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1145 --srcdir=.. $(HPCEXCL) ; \
1146 hpc report --srcdir=.. live-test $(HPCEXCL)
1148 commit-check: distcheck lint apidoc
1150 -include ./Makefile.local