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 # Helper values for calling builtin functions
14 space := $(empty) $(empty)
17 # Helper function to strip src/ and test/hs/ from a list
18 strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))
20 # Use bash in order to be able to use pipefail
23 # Enable colors in shelltest
26 ACLOCAL_AMFLAGS = -I autotools
27 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
28 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
29 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
30 CHECK_HEADER = $(top_srcdir)/autotools/check-header
31 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
32 CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
33 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
34 CHECK_VERSION = $(top_srcdir)/autotools/check-version
35 CHECK_NEWS = $(top_srcdir)/autotools/check-news
36 CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
37 DOCPP = $(top_srcdir)/autotools/docpp
38 REPLACE_VARS_SED = autotools/replace_vars.sed
39 CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
40 BUILD_RPC = $(top_srcdir)/autotools/build-rpc
41 SHELL_ENV_INIT = autotools/shell-env-init
43 # starting as of Ganeti 2.10, all files are stored in a single directory,
44 # with only symbolic links added at other places.
45 versiondir = $(libdir)/ganeti-$(VERSION)
47 # Note: these are automake-specific variables, and must be named after
48 # the directory + 'dir' suffix
49 pkglibdir = $(versiondir)$(libdir)/ganeti
50 myexeclibdir = $(pkglibdir)
51 bindir = $(versiondir)$(exec_prefix)/bin
52 sbindir = $(versiondir)$(exec_prefix)/sbin
53 mandir = $(versiondir)$(datarootdir)/man
54 pkgpythondir = $(versiondir)$(pythondir)/ganeti
56 clientdir = $(pkgpythondir)/client
57 cmdlibdir = $(pkgpythondir)/cmdlib
58 hypervisordir = $(pkgpythondir)/hypervisor
59 storagedir = $(pkgpythondir)/storage
60 httpdir = $(pkgpythondir)/http
61 masterddir = $(pkgpythondir)/masterd
62 confddir = $(pkgpythondir)/confd
63 rapidir = $(pkgpythondir)/rapi
64 serverdir = $(pkgpythondir)/server
65 watcherdir = $(pkgpythondir)/watcher
66 impexpddir = $(pkgpythondir)/impexpd
67 utilsdir = $(pkgpythondir)/utils
68 toolsdir = $(pkglibdir)/tools
69 iallocatorsdir = $(pkglibdir)/iallocators
70 pytoolsdir = $(pkgpythondir)/tools
71 docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
73 SYMLINK_TARGET_DIRS = \
75 $(libdir)/ganeti/iallocators \
78 $(datarootdir)/man/man1 \
79 $(datarootdir)/man/man7 \
80 $(datarootdir)/man/man8
83 $(libdir)/ganeti/tools
85 # Delete output file if an error occurred while building it
94 src/Ganeti/DataCollectors \
97 src/Ganeti/HTools/Backend \
98 src/Ganeti/HTools/Program \
99 src/Ganeti/Hypervisor \
100 src/Ganeti/Hypervisor/Xen \
101 src/Ganeti/Monitoring \
104 src/Ganeti/Storage/Diskstats \
105 src/Ganeti/Storage/Drbd \
106 src/Ganeti/Storage/Lvm \
109 test/hs/Test/Ganeti \
110 test/hs/Test/Ganeti/Storage \
111 test/hs/Test/Ganeti/Storage/Diskstats \
112 test/hs/Test/Ganeti/Storage/Drbd \
113 test/hs/Test/Ganeti/Storage/Lvm \
114 test/hs/Test/Ganeti/Confd \
115 test/hs/Test/Ganeti/HTools \
116 test/hs/Test/Ganeti/HTools/Backend \
117 test/hs/Test/Ganeti/Hypervisor \
118 test/hs/Test/Ganeti/Hypervisor/Xen \
119 test/hs/Test/Ganeti/Query
121 # Haskell directories without the roots (src, test/hs)
122 HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
133 doc/examples/gnt-debug \
136 test/data/htools/rapi \
160 test/data/ovfdata/other \
163 test/py/cmdlib/testsupport \
166 ALL_APIDOC_HS_DIRS = \
168 $(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
170 BUILDTIME_DIR_AUTOCREATE = \
173 $(ALL_APIDOC_HS_DIRS) \
181 $(BUILDTIME_DIR_AUTOCREATE) \
187 ganeti-[0-9]*.[0-9]*.[0-9]* \
193 COVERAGE_DIR = doc/coverage
194 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
195 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
197 APIDOC_PY_DIR = $(APIDOC_DIR)/py
198 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
200 MAINTAINERCLEANFILES = \
202 doc/install-quick.rst \
207 maintainer-clean-local:
208 rm -rf $(BUILDTIME_DIRS)
211 $(addsuffix /*.py[co],$(DIRS)) \
212 $(addsuffix /*.hi,$(HS_DIRS)) \
213 $(addsuffix /*.o,$(HS_DIRS)) \
214 $(PYTHON_BOOTSTRAP) \
216 $(REPLACE_VARS_SED) \
218 daemons/daemon-util \
219 daemons/ganeti-cleaner \
220 devel/squeeze-amd64.tar.gz \
221 devel/squeeze-amd64.conf \
223 doc/manpages-enabled.rst \
225 doc/examples/bash_completion \
226 doc/examples/bash_completion-debug \
227 lib/_generated_rpc.py \
234 tools/vcluster-setup \
237 $(nodist_pkgpython_PYTHON) \
238 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
239 $(HS_BUILT_TEST_HELPERS) \
243 src/hs2py-constants \
244 .hpc/*.mix src/*.tix test/hs/*.tix \
248 $(built_base_sources) \
249 $(BUILT_PYTHON_SOURCES) \
254 HS_GENERATED_FILES += $(HS_PROGS)
256 HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
260 HS_GENERATED_FILES += src/ganeti-mond
264 built_base_sources = \
268 built_python_base_sources = \
274 BUILT_PYTHON_SOURCES = \
275 $(built_python_base_sources) \
276 lib/_generated_rpc.py
278 # Generating the RPC wrappers depends on many things, so make sure
279 # it's built at the end of the built sources
280 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
282 # these are all built from the underlying %.in sources
284 doc/examples/ganeti-kvm-poweroff.initd \
285 doc/examples/ganeti.cron \
286 doc/examples/ganeti.initd \
287 doc/examples/ganeti.logrotate \
288 doc/examples/ganeti-master-role.ocf \
289 doc/examples/ganeti-node-role.ocf \
290 doc/examples/gnt-config-backup \
291 doc/examples/hooks/ipsec
293 nodist_pkgpython_PYTHON = \
294 $(BUILT_PYTHON_SOURCES)
297 lib/build/__init__.py \
298 lib/build/shell_example_lexer.py \
299 lib/build/sphinx_ext.py
303 lib/asyncnotifier.py \
321 lib/opcodes_base.py \
339 lib/client/__init__.py \
340 lib/client/gnt_backup.py \
341 lib/client/gnt_cluster.py \
342 lib/client/gnt_debug.py \
343 lib/client/gnt_group.py \
344 lib/client/gnt_instance.py \
345 lib/client/gnt_job.py \
346 lib/client/gnt_node.py \
347 lib/client/gnt_network.py \
348 lib/client/gnt_os.py \
349 lib/client/gnt_storage.py
352 lib/cmdlib/__init__.py \
353 lib/cmdlib/backup.py \
355 lib/cmdlib/cluster.py \
356 lib/cmdlib/common.py \
357 lib/cmdlib/group.py \
358 lib/cmdlib/instance.py \
359 lib/cmdlib/instance_migration.py \
360 lib/cmdlib/instance_operation.py \
361 lib/cmdlib/instance_query.py \
362 lib/cmdlib/instance_storage.py \
363 lib/cmdlib/instance_utils.py \
365 lib/cmdlib/network.py \
367 lib/cmdlib/operating_system.py \
368 lib/cmdlib/query.py \
372 hypervisor_PYTHON = \
373 lib/hypervisor/__init__.py \
374 lib/hypervisor/hv_base.py \
375 lib/hypervisor/hv_chroot.py \
376 lib/hypervisor/hv_fake.py \
377 lib/hypervisor/hv_kvm.py \
378 lib/hypervisor/hv_lxc.py \
379 lib/hypervisor/hv_xen.py
382 lib/storage/__init__.py \
383 lib/storage/bdev.py \
384 lib/storage/base.py \
385 lib/storage/container.py \
386 lib/storage/drbd.py \
387 lib/storage/drbd_info.py \
388 lib/storage/drbd_cmdgen.py \
389 lib/storage/filestorage.py
392 lib/rapi/__init__.py \
393 lib/rapi/baserlib.py \
395 lib/rapi/client_utils.py \
396 lib/rapi/connector.py \
398 lib/rapi/testutils.py
401 lib/http/__init__.py \
407 lib/confd/__init__.py \
411 lib/masterd/__init__.py \
412 lib/masterd/iallocator.py \
413 lib/masterd/instance.py
416 lib/impexpd/__init__.py
419 lib/watcher/__init__.py \
420 lib/watcher/nodemaint.py \
424 lib/server/__init__.py \
425 lib/server/masterd.py \
426 lib/server/noded.py \
430 lib/tools/__init__.py \
431 lib/tools/burnin.py \
432 lib/tools/ensure_dirs.py \
433 lib/tools/node_cleanup.py \
434 lib/tools/node_daemon_setup.py \
435 lib/tools/prepare_node_join.py
438 lib/utils/__init__.py \
440 lib/utils/filelock.py \
446 lib/utils/nodesetup.py \
447 lib/utils/process.py \
449 lib/utils/storage.py \
451 lib/utils/wrapper.py \
458 doc/cluster-merge.rst \
468 doc/design-autorepair.rst \
469 doc/design-bulk-create.rst \
470 doc/design-chained-jobs.rst \
471 doc/design-cpu-pinning.rst \
472 doc/design-device-uuid-name.rst \
473 doc/design-draft.rst \
474 doc/design-hotplug.rst \
475 doc/design-htools-2.3.rst \
476 doc/design-http-server.rst \
477 doc/design-impexp2.rst \
478 doc/design-internal-shutdown.rst \
479 doc/design-lu-generated-jobs.rst \
480 doc/design-linuxha.rst \
481 doc/design-multi-reloc.rst \
482 doc/design-network.rst \
483 doc/design-node-add.rst \
485 doc/design-ovf-support.rst \
486 doc/design-opportunistic-locking.rst \
487 doc/design-optables.rst \
488 doc/design-partitioned.rst \
489 doc/design-query-splitting.rst \
490 doc/design-query2.rst \
491 doc/design-reason-trail.rst \
492 doc/design-resource-model.rst \
493 doc/design-restricted-commands.rst \
494 doc/design-shared-storage.rst \
495 doc/design-monitoring-agent.rst \
496 doc/design-virtual-clusters.rst \
497 doc/design-x509-ca.rst \
498 doc/design-hroller.rst \
499 doc/design-storagetypes.rst \
500 doc/design-upgrade.rst \
506 doc/install-quick.rst \
509 doc/manpages-disabled.rst \
510 doc/monitoring-query-format.rst \
511 doc/move-instance.rst \
513 doc/ovfconverter.rst \
517 doc/virtual-cluster.rst \
520 # Generates file names such as "doc/man-gnt-instance.rst"
521 mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
523 # Haskell programs to be installed in $PREFIX/bin
524 HS_BIN_PROGS=src/htools
526 # Haskell programs to be installed in the MYEXECLIB dir
528 HS_MYEXECLIB_PROGS=src/mon-collector
533 # Haskell programs to be compiled by "make really-all"
541 # All Haskell non-test programs to be compiled but not automatically installed
542 HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
544 HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
545 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
550 test/hs/hpc-mon-collector \
554 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS)) src/hs2py-constants.hs
555 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
558 -O -Wall -Werror -isrc \
559 -fwarn-monomorphism-restriction \
561 $(GHC_BYVERSION_FLAGS)
563 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
565 # internal extra flags (used for test/hs/htest mainly)
567 # exclude options for coverage reports
568 HPCEXCL = --exclude Main \
569 --exclude Ganeti.Constants \
570 --exclude Ganeti.HTools.QC \
571 --exclude Ganeti.THH \
572 --exclude Ganeti.Version \
573 --exclude Test.Ganeti.Attoparsec \
574 --exclude Test.Ganeti.TestCommon \
575 --exclude Test.Ganeti.TestHTools \
576 --exclude Test.Ganeti.TestHelper \
577 --exclude Test.Ganeti.TestImports \
578 $(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
581 src/Ganeti/BasicTypes.hs \
582 src/Ganeti/Common.hs \
583 src/Ganeti/Compat.hs \
584 src/Ganeti/Confd/Client.hs \
585 src/Ganeti/Confd/ClientFunctions.hs \
586 src/Ganeti/Confd/Server.hs \
587 src/Ganeti/Confd/Types.hs \
588 src/Ganeti/Confd/Utils.hs \
589 src/Ganeti/Config.hs \
590 src/Ganeti/ConfigReader.hs \
591 src/Ganeti/Constants.hs \
592 src/Ganeti/Cpu/LoadParser.hs \
593 src/Ganeti/Cpu/Types.hs \
594 src/Ganeti/Curl/Multi.hs \
595 src/Ganeti/Daemon.hs \
596 src/Ganeti/DataCollectors/CLI.hs \
597 src/Ganeti/DataCollectors/CPUload.hs \
598 src/Ganeti/DataCollectors/Diskstats.hs \
599 src/Ganeti/DataCollectors/Drbd.hs \
600 src/Ganeti/DataCollectors/InstStatus.hs \
601 src/Ganeti/DataCollectors/InstStatusTypes.hs \
602 src/Ganeti/DataCollectors/Lv.hs \
603 src/Ganeti/DataCollectors/Program.hs \
604 src/Ganeti/DataCollectors/Types.hs \
605 src/Ganeti/Errors.hs \
606 src/Ganeti/HTools/Backend/IAlloc.hs \
607 src/Ganeti/HTools/Backend/Luxi.hs \
608 src/Ganeti/HTools/Backend/Rapi.hs \
609 src/Ganeti/HTools/Backend/Simu.hs \
610 src/Ganeti/HTools/Backend/Text.hs \
611 src/Ganeti/HTools/CLI.hs \
612 src/Ganeti/HTools/Cluster.hs \
613 src/Ganeti/HTools/Container.hs \
614 src/Ganeti/HTools/ExtLoader.hs \
615 src/Ganeti/HTools/Graph.hs \
616 src/Ganeti/HTools/Group.hs \
617 src/Ganeti/HTools/Instance.hs \
618 src/Ganeti/HTools/Loader.hs \
619 src/Ganeti/HTools/Nic.hs \
620 src/Ganeti/HTools/Node.hs \
621 src/Ganeti/HTools/PeerMap.hs \
622 src/Ganeti/HTools/Program/Hail.hs \
623 src/Ganeti/HTools/Program/Harep.hs \
624 src/Ganeti/HTools/Program/Hbal.hs \
625 src/Ganeti/HTools/Program/Hcheck.hs \
626 src/Ganeti/HTools/Program/Hinfo.hs \
627 src/Ganeti/HTools/Program/Hscan.hs \
628 src/Ganeti/HTools/Program/Hspace.hs \
629 src/Ganeti/HTools/Program/Hroller.hs \
630 src/Ganeti/HTools/Program/Main.hs \
631 src/Ganeti/HTools/Types.hs \
632 src/Ganeti/Hypervisor/Xen.hs \
633 src/Ganeti/Hypervisor/Xen/XmParser.hs \
634 src/Ganeti/Hypervisor/Xen/Types.hs \
636 src/Ganeti/Hs2Py/GenConstants.hs \
637 src/Ganeti/Hs2Py/GenOpCodes.hs \
638 src/Ganeti/Hs2Py/OpDoc.hs \
639 src/Ganeti/HsConstants.hs \
640 src/Ganeti/JQueue.hs \
643 src/Ganeti/Logging.hs \
645 src/Ganeti/Monitoring/Server.hs \
646 src/Ganeti/Network.hs \
647 src/Ganeti/Objects.hs \
648 src/Ganeti/OpCodes.hs \
649 src/Ganeti/OpParams.hs \
651 src/Ganeti/Parsers.hs \
652 src/Ganeti/PyValueInstances.hs \
653 src/Ganeti/Query/Cluster.hs \
654 src/Ganeti/Query/Common.hs \
655 src/Ganeti/Query/Export.hs \
656 src/Ganeti/Query/Filter.hs \
657 src/Ganeti/Query/Group.hs \
658 src/Ganeti/Query/Job.hs \
659 src/Ganeti/Query/Language.hs \
660 src/Ganeti/Query/Network.hs \
661 src/Ganeti/Query/Node.hs \
662 src/Ganeti/Query/Query.hs \
663 src/Ganeti/Query/Server.hs \
664 src/Ganeti/Query/Types.hs \
666 src/Ganeti/Runtime.hs \
667 src/Ganeti/Ssconf.hs \
668 src/Ganeti/Storage/Diskstats/Parser.hs \
669 src/Ganeti/Storage/Diskstats/Types.hs \
670 src/Ganeti/Storage/Drbd/Parser.hs \
671 src/Ganeti/Storage/Drbd/Types.hs \
672 src/Ganeti/Storage/Lvm/LVParser.hs \
673 src/Ganeti/Storage/Lvm/Types.hs \
674 src/Ganeti/Storage/Utils.hs \
676 src/Ganeti/Types.hs \
680 test/hs/Test/Ganeti/Attoparsec.hs \
681 test/hs/Test/Ganeti/BasicTypes.hs \
682 test/hs/Test/Ganeti/Common.hs \
683 test/hs/Test/Ganeti/Confd/Types.hs \
684 test/hs/Test/Ganeti/Confd/Utils.hs \
685 test/hs/Test/Ganeti/Daemon.hs \
686 test/hs/Test/Ganeti/Errors.hs \
687 test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
688 test/hs/Test/Ganeti/HTools/Backend/Text.hs \
689 test/hs/Test/Ganeti/HTools/CLI.hs \
690 test/hs/Test/Ganeti/HTools/Cluster.hs \
691 test/hs/Test/Ganeti/HTools/Container.hs \
692 test/hs/Test/Ganeti/HTools/Graph.hs \
693 test/hs/Test/Ganeti/HTools/Instance.hs \
694 test/hs/Test/Ganeti/HTools/Loader.hs \
695 test/hs/Test/Ganeti/HTools/Node.hs \
696 test/hs/Test/Ganeti/HTools/PeerMap.hs \
697 test/hs/Test/Ganeti/HTools/Types.hs \
698 test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
699 test/hs/Test/Ganeti/JSON.hs \
700 test/hs/Test/Ganeti/Jobs.hs \
701 test/hs/Test/Ganeti/JQueue.hs \
702 test/hs/Test/Ganeti/Luxi.hs \
703 test/hs/Test/Ganeti/Network.hs \
704 test/hs/Test/Ganeti/Objects.hs \
705 test/hs/Test/Ganeti/OpCodes.hs \
706 test/hs/Test/Ganeti/Query/Filter.hs \
707 test/hs/Test/Ganeti/Query/Language.hs \
708 test/hs/Test/Ganeti/Query/Network.hs \
709 test/hs/Test/Ganeti/Query/Query.hs \
710 test/hs/Test/Ganeti/Rpc.hs \
711 test/hs/Test/Ganeti/Runtime.hs \
712 test/hs/Test/Ganeti/Ssconf.hs \
713 test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
714 test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
715 test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
716 test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
717 test/hs/Test/Ganeti/THH.hs \
718 test/hs/Test/Ganeti/TestCommon.hs \
719 test/hs/Test/Ganeti/TestHTools.hs \
720 test/hs/Test/Ganeti/TestHelper.hs \
721 test/hs/Test/Ganeti/Types.hs \
722 test/hs/Test/Ganeti/Utils.hs
724 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
727 test/hs/Test/Ganeti/TestImports.hs \
728 src/Ganeti/Hs2Py/ListConstants.hs \
729 src/Ganeti/PyConstants.hs \
730 src/Ganeti/Curl/Internal.hs \
731 src/Ganeti/Version.hs
733 $(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
734 src/Ganeti/Curl/Internal.hsc \
735 lib/_constants.py.in \
736 lib/opcodes.py.in_after \
737 lib/opcodes.py.in_before
739 HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
741 $(RUN_IN_TEMPDIR): | stamp-directories
743 doc/html/index.html: ENABLE_MANPAGES =
744 doc/man-html/index.html: ENABLE_MANPAGES = 1
745 doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
747 # Note: we use here an order-only prerequisite, as the contents of
748 # _autoconf.py are not actually influencing the html build output: it
749 # has to exist in order for the sphinx module to be loaded
750 # successfully, but we certainly don't want the docs to be rebuilt if
752 doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
753 configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
754 lib/build/shell_example_lexer.py lib/ht.py \
755 doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
756 autotools/sphinx-wrapper | $(BUILT_PYTHON_SOURCES)
757 @test -n "$(SPHINX)" || \
758 { echo 'sphinx-build' not found during configure; exit 1; }
760 if test -n '$(ENABLE_MANPAGES)'; then \
761 echo 'Man pages in documentation were disabled at configure time' >&2; \
765 ## Sphinx provides little control over what content should be included. Some
766 ## mechanisms exist, but they all have drawbacks or actual issues. Since we
767 ## build two different versions of the documentation--once without man pages and
768 ## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
769 ## us with this, but requires running in a temporary directory. It moves the
770 ## correct files into place depending on environment variables.
773 PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
774 $(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
776 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
777 -D release="$(PACKAGE_VERSION)" \
778 -D graphviz_dot="$(DOT)" \
779 -D enable_manpages="$(ENABLE_MANPAGES)" \
780 doc $(CURDIR)/$$dir && \
781 rm -f $$dir/.buildinfo $$dir/objects.inv
784 doc/html: doc/html/index.html
786 doc/man-html: doc/man-html/index.html
788 doc/install-quick.rst: INSTALL
790 doc/upgrade.rst: UPGRADE
792 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
794 { echo '.. This file is automatically updated at build time from $<.'; \
795 echo '.. Do not edit.'; \
800 doc/manpages-enabled.rst: Makefile | $(built_base_sources)
801 { echo '.. This file is automatically generated, do not edit!'; \
806 echo '.. toctree::'; \
807 echo ' :maxdepth: 1'; \
809 for i in $(notdir $(mandocrst)); do \
811 done | LC_ALL=C sort; \
814 doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
816 { echo '.. This file is automatically updated at build time from $<.'; \
817 echo '.. Do not edit.'; \
820 echo '=========================================='; \
821 tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
824 echo 'Man pages in documentation were disabled at configure time' >&2; \
828 # Things to build but not to install (add it to EXTRA_DIST if it should be
832 doc/examples/bash_completion \
833 doc/examples/bash_completion-debug \
838 noinst_DATA += doc/man-html
840 noinst_DATA += doc/html
846 scripts/gnt-cluster \
849 scripts/gnt-instance \
851 scripts/gnt-network \
856 PYTHON_BOOTSTRAP_SBIN = \
857 daemons/ganeti-masterd \
858 daemons/ganeti-noded \
859 daemons/ganeti-rapi \
860 daemons/ganeti-watcher \
864 $(PYTHON_BOOTSTRAP_SBIN) \
868 tools/node-daemon-setup \
869 tools/prepare-node-join
881 qa/qa_instance_utils.py \
883 qa/qa_monitoring.py \
892 bin_SCRIPTS += $(HS_BIN_PROGS)
894 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
895 # FIXME: this is a hardcoded logic, instead of auto-resolving
896 $(LN_S) -f ../../../bin/htools \
897 $(DESTDIR)$(iallocatorsdir)/hail
898 for role in $(HS_BIN_ROLES); do \
899 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
903 # This target cannot be merged with the '$(HS_ALL_PROGS)' target
904 # because 'hs2py-constants' cannot depend on 'Ganeti.Constants'. And
905 # the reason for this is because 'hs2py-constants' needs to generate
906 # Python code, and 'Ganeti.Constants' is generated by Python.
907 src/hs2py-constants: src/hs2py-constants.hs src/Ganeti/BasicTypes.hs \
908 src/Ganeti/JSON.hs src/Ganeti/THH.hs \
909 src/Ganeti/Hs2Py/GenConstants.hs \
910 src/Ganeti/Hs2Py/ListConstants.hs \
911 src/Ganeti/HsConstants.hs \
912 src/Ganeti/PyValueInstances.hs \
916 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
917 $(HEXTRA) $(HEXTRA_INT) src/hs2py-constants.hs
919 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) Makefile
920 @if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
921 echo "Error: cannot run unittests without the development" \
922 " libraries (see devnotes.rst)" 1>&2; \
925 @rm -f $(notdir $@).tix
928 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
929 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
930 $(HEXTRA) $(HEXTRA_INT) $@
933 # for the test/hs/htest binary, we need to enable profiling/coverage
934 test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
936 # we compile the hpc-htools binary with the program coverage
937 test/hs/hpc-htools: HEXTRA_INT=-fhpc
939 # we compile the hpc-mon-collector binary with the program coverage
940 test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
943 test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
945 # rules for building profiling-enabled versions of the haskell
946 # programs: hs-prof does the full two-step build, whereas
947 # hs-prof-quick does only the final rebuild (hs-prof must have been
949 .PHONY: hs-prof hs-prof-quick
951 @if [ -z "$(TARGET)" ]; then \
952 echo "You need to define TARGET when running this rule" 1>&2; \
955 $(MAKE) $(AM_MAKEFLAGS) clean
956 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf o"
957 rm -f $(HS_ALL_PROGS)
958 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
961 @if [ -z "$(TARGET)" ]; then \
962 echo "You need to define TARGET when running this rule" 1>&2; \
965 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf prof_o -prof -auto-all"
967 dist_sbin_SCRIPTS = \
968 tools/ganeti-listrunner
970 nodist_sbin_SCRIPTS = \
971 $(PYTHON_BOOTSTRAP_SBIN) \
972 daemons/ganeti-cleaner
974 # strip path prefixes off the sbin scripts
976 $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
977 $(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
980 src/ganeti-confd: src/hconfd
983 src/ganeti-luxid: src/hluxid
986 nodist_sbin_SCRIPTS += src/ganeti-confd
987 nodist_sbin_SCRIPTS += src/ganeti-luxid
991 nodist_sbin_SCRIPTS += src/ganeti-mond
998 tools/cluster-merge \
1002 tools/move-instance \
1003 tools/ovfconverter \
1004 tools/sanitize-config
1006 dist_tools_SCRIPTS = \
1009 tools/kvm-console-wrapper \
1010 tools/master-ip-setup \
1011 tools/xen-console-wrapper
1013 nodist_tools_python_scripts = \
1016 nodist_tools_SCRIPTS = \
1017 $(nodist_tools_python_scripts) \
1019 tools/vcluster-setup
1021 pkglib_python_scripts = \
1022 daemons/import-export \
1023 tools/check-cert-expired
1025 nodist_pkglib_python_scripts = \
1027 tools/node-daemon-setup \
1028 tools/prepare-node-join
1030 myexeclib_SCRIPTS = \
1031 daemons/daemon-util \
1035 $(pkglib_python_scripts) \
1036 $(HS_MYEXECLIB_PROGS)
1038 nodist_myexeclib_SCRIPTS = \
1039 $(nodist_pkglib_python_scripts)
1041 # strip path prefixes off the lib python scripts
1042 all_myexeclib_scripts = \
1043 $(patsubst tools/%,%,$(patsubst daemons/%,%,\
1044 $(patsubst src/%,%,$(myexeclib_SCRIPTS) $(nodist_myexeclib_SCRIPTS))))
1052 autotools/build-bash-completion \
1053 autotools/build-rpc \
1054 autotools/check-header \
1055 autotools/check-imports \
1056 autotools/check-man-dashes \
1057 autotools/check-man-references \
1058 autotools/check-man-warnings \
1059 autotools/check-news \
1060 autotools/check-python-code \
1061 autotools/check-tar \
1062 autotools/check-version \
1063 autotools/convert-constants \
1065 autotools/gen-py-coverage \
1066 autotools/sphinx-wrapper \
1067 autotools/testrunner \
1068 autotools/wrong-hardcoded-paths \
1070 daemons/daemon-util.in \
1071 daemons/ganeti-cleaner.in \
1072 $(pkglib_python_scripts) \
1076 tools/vif-ganeti.in \
1077 tools/net-common.in \
1078 tools/users-setup.in \
1079 tools/vcluster-setup.in \
1082 $(BUILT_EXAMPLES:%=%.in) \
1083 doc/examples/ganeti.default \
1084 doc/examples/ganeti.default-debug \
1085 doc/examples/hooks/ethers \
1086 doc/examples/gnt-debug/README \
1087 doc/examples/gnt-debug/delay0.json \
1088 doc/examples/gnt-debug/delay50.json \
1091 $(python_test_support) \
1097 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
1100 test/hs/cli-tests-defs.sh \
1101 test/hs/offline-test.sh \
1105 man/ganeti-cleaner.8 \
1106 man/ganeti-confd.8 \
1107 man/ganeti-luxid.8 \
1108 man/ganeti-listrunner.8 \
1109 man/ganeti-masterd.8 \
1111 man/ganeti-noded.8 \
1112 man/ganeti-os-interface.7 \
1113 man/ganeti-extstorage-interface.7 \
1115 man/ganeti-watcher.8 \
1122 man/gnt-instance.8 \
1138 # Remove extensions from all filenames in man_MANS
1139 mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1141 manrst = $(patsubst %,%.rst,$(mannoext))
1142 manhtml = $(patsubst %.rst,%.html,$(manrst))
1143 mangen = $(patsubst %.rst,%.gen,$(manrst))
1145 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1146 $(patsubst %.html,%.html.in,$(manhtml)) \
1149 manfullpath = $(patsubst man/%.1,man1/%.1,\
1150 $(patsubst man/%.7,man7/%.7,\
1151 $(patsubst man/%.8,man8/%.8,$(man_MANS))))
1154 test/autotools/autotools-check-news.test \
1155 test/data/htools/clean-nonzero-score.data \
1156 test/data/htools/common-suffix.data \
1157 test/data/htools/empty-cluster.data \
1158 test/data/htools/hail-alloc-drbd.json \
1159 test/data/htools/hail-alloc-invalid-network.json \
1160 test/data/htools/hail-alloc-invalid-twodisks.json \
1161 test/data/htools/hail-alloc-restricted-network.json \
1162 test/data/htools/hail-alloc-spindles.json \
1163 test/data/htools/hail-alloc-twodisks.json \
1164 test/data/htools/hail-change-group.json \
1165 test/data/htools/hail-invalid-reloc.json \
1166 test/data/htools/hail-node-evac.json \
1167 test/data/htools/hail-reloc-drbd.json \
1168 test/data/htools/hbal-excl-tags.data \
1169 test/data/htools/hbal-split-insts.data \
1170 test/data/htools/hspace-tiered-dualspec-exclusive.data \
1171 test/data/htools/hspace-tiered-dualspec.data \
1172 test/data/htools/hspace-tiered-exclusive.data \
1173 test/data/htools/hspace-tiered-ipolicy.data \
1174 test/data/htools/hspace-tiered-mixed.data \
1175 test/data/htools/hspace-tiered-resourcetypes.data \
1176 test/data/htools/hspace-tiered-vcpu.data \
1177 test/data/htools/hspace-tiered.data \
1178 test/data/htools/invalid-node.data \
1179 test/data/htools/missing-resources.data \
1180 test/data/htools/multiple-master.data \
1181 test/data/htools/multiple-tags.data \
1182 test/data/htools/n1-failure.data \
1183 test/data/htools/rapi/groups.json \
1184 test/data/htools/rapi/info.json \
1185 test/data/htools/rapi/instances.json \
1186 test/data/htools/rapi/nodes.json \
1187 test/data/htools/hroller-full.data \
1188 test/data/htools/hroller-nodegroups.data \
1189 test/data/htools/hroller-nonredundant.data \
1190 test/data/htools/hroller-online.data \
1191 test/data/htools/unique-reboot-order.data \
1192 test/hs/shelltests/htools-balancing.test \
1193 test/hs/shelltests/htools-basic.test \
1194 test/hs/shelltests/htools-dynutil.test \
1195 test/hs/shelltests/htools-excl.test \
1196 test/hs/shelltests/htools-hail.test \
1197 test/hs/shelltests/htools-hroller.test \
1198 test/hs/shelltests/htools-hspace.test \
1199 test/hs/shelltests/htools-invalid.test \
1200 test/hs/shelltests/htools-multi-group.test \
1201 test/hs/shelltests/htools-no-backend.test \
1202 test/hs/shelltests/htools-rapi.test \
1203 test/hs/shelltests/htools-single-group.test \
1204 test/hs/shelltests/htools-text-backend.test \
1205 test/hs/shelltests/htools-mon-collector.test \
1206 test/data/bdev-drbd-8.0.txt \
1207 test/data/bdev-drbd-8.3.txt \
1208 test/data/bdev-drbd-8.4.txt \
1209 test/data/bdev-drbd-8.4-no-disk-params.txt \
1210 test/data/bdev-drbd-disk.txt \
1211 test/data/bdev-drbd-net-ip4.txt \
1212 test/data/bdev-drbd-net-ip6.txt \
1213 test/data/bdev-rbd/json_output_empty.txt \
1214 test/data/bdev-rbd/json_output_extra_matches.txt \
1215 test/data/bdev-rbd/json_output_no_matches.txt \
1216 test/data/bdev-rbd/json_output_ok.txt \
1217 test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1218 test/data/bdev-rbd/plain_output_new_no_matches.txt \
1219 test/data/bdev-rbd/plain_output_new_ok.txt \
1220 test/data/bdev-rbd/plain_output_old_empty.txt \
1221 test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1222 test/data/bdev-rbd/plain_output_old_no_matches.txt \
1223 test/data/bdev-rbd/plain_output_old_ok.txt \
1224 test/data/bdev-rbd/output_invalid.txt \
1225 test/data/cert1.pem \
1226 test/data/cert2.pem \
1227 test/data/cluster_config_2.7.json \
1228 test/data/cluster_config_2.8.json \
1229 test/data/cluster_config_2.9.json \
1230 test/data/instance-minor-pairing.txt \
1231 test/data/instance-prim-sec.txt \
1232 test/data/ip-addr-show-dummy0.txt \
1233 test/data/ip-addr-show-lo-ipv4.txt \
1234 test/data/ip-addr-show-lo-ipv6.txt \
1235 test/data/ip-addr-show-lo-oneline-ipv4.txt \
1236 test/data/ip-addr-show-lo-oneline-ipv6.txt \
1237 test/data/ip-addr-show-lo-oneline.txt \
1238 test/data/ip-addr-show-lo.txt \
1239 test/data/kvm_0.12.5_help.txt \
1240 test/data/kvm_0.15.90_help.txt \
1241 test/data/kvm_0.9.1_help.txt \
1242 test/data/kvm_0.9.1_help_boot_test.txt \
1243 test/data/kvm_1.0_help.txt \
1244 test/data/kvm_1.1.2_help.txt \
1245 test/data/lvs_lv.txt \
1246 test/data/NEWS_OK.txt \
1247 test/data/NEWS_previous_unreleased.txt \
1248 test/data/ovfdata/compr_disk.vmdk.gz \
1249 test/data/ovfdata/config.ini \
1250 test/data/ovfdata/corrupted_resources.ovf \
1251 test/data/ovfdata/empty.ini \
1252 test/data/ovfdata/empty.ovf \
1253 test/data/ovfdata/ganeti.mf \
1254 test/data/ovfdata/ganeti.ovf \
1255 test/data/ovfdata/gzip_disk.ovf \
1256 test/data/ovfdata/new_disk.vmdk \
1257 test/data/ovfdata/no_disk.ini \
1258 test/data/ovfdata/no_disk_in_ref.ovf \
1259 test/data/ovfdata/no_os.ini \
1260 test/data/ovfdata/no_ovf.ova \
1261 test/data/ovfdata/other/rawdisk.raw \
1262 test/data/ovfdata/ova.ova \
1263 test/data/ovfdata/rawdisk.raw \
1264 test/data/ovfdata/second_disk.vmdk \
1265 test/data/ovfdata/unsafe_path.ini \
1266 test/data/ovfdata/virtualbox.ovf \
1267 test/data/ovfdata/wrong_config.ini \
1268 test/data/ovfdata/wrong_extension.ovd \
1269 test/data/ovfdata/wrong_manifest.mf \
1270 test/data/ovfdata/wrong_manifest.ovf \
1271 test/data/ovfdata/wrong_ova.ova \
1272 test/data/ovfdata/wrong_xml.ovf \
1273 test/data/proc_diskstats.txt \
1274 test/data/proc_drbd8.txt \
1275 test/data/proc_drbd80-emptyline.txt \
1276 test/data/proc_drbd80-emptyversion.txt \
1277 test/data/proc_drbd83.txt \
1278 test/data/proc_drbd83_sync.txt \
1279 test/data/proc_drbd83_sync_want.txt \
1280 test/data/proc_drbd83_sync_krnl2.6.39.txt \
1281 test/data/proc_drbd84.txt \
1282 test/data/proc_drbd84_sync.txt \
1283 test/data/qa-minimal-nodes-instances-only.json \
1284 test/data/sys_drbd_usermode_helper.txt \
1285 test/data/vgreduce-removemissing-2.02.02.txt \
1286 test/data/vgreduce-removemissing-2.02.66-fail.txt \
1287 test/data/vgreduce-removemissing-2.02.66-ok.txt \
1288 test/data/vgs-missing-pvs-2.02.02.txt \
1289 test/data/vgs-missing-pvs-2.02.66.txt \
1290 test/data/xen-xm-info-4.0.1.txt \
1291 test/data/xen-xm-list-4.0.1-dom0-only.txt \
1292 test/data/xen-xm-list-4.0.1-four-instances.txt \
1293 test/data/xen-xm-list-long-4.0.1.txt \
1294 test/data/xen-xm-uptime-4.0.1.txt \
1295 test/py/ganeti-cli.test \
1296 test/py/gnt-cli.test \
1297 test/py/import-export_unittest-helper
1301 doc/examples/rapi_testutils.py \
1302 test/py/cmdlib/cluster_unittest.py \
1303 test/py/cmdlib/cmdlib_unittest.py \
1304 test/py/cmdlib/group_unittest.py \
1305 test/py/cmdlib/instance_unittest.py \
1306 test/py/cmdlib/instance_storage_unittest.py \
1307 test/py/cmdlib/test_unittest.py \
1308 test/py/cfgupgrade_unittest.py \
1309 test/py/docs_unittest.py \
1310 test/py/ganeti.asyncnotifier_unittest.py \
1311 test/py/ganeti.backend_unittest-runasroot.py \
1312 test/py/ganeti.backend_unittest.py \
1313 test/py/ganeti.bootstrap_unittest.py \
1314 test/py/ganeti.cli_unittest.py \
1315 test/py/ganeti.client.gnt_cluster_unittest.py \
1316 test/py/ganeti.client.gnt_instance_unittest.py \
1317 test/py/ganeti.client.gnt_job_unittest.py \
1318 test/py/ganeti.compat_unittest.py \
1319 test/py/ganeti.confd.client_unittest.py \
1320 test/py/ganeti.config_unittest.py \
1321 test/py/ganeti.constants_unittest.py \
1322 test/py/ganeti.daemon_unittest.py \
1323 test/py/ganeti.errors_unittest.py \
1324 test/py/ganeti.hooks_unittest.py \
1325 test/py/ganeti.ht_unittest.py \
1326 test/py/ganeti.http_unittest.py \
1327 test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1328 test/py/ganeti.hypervisor.hv_fake_unittest.py \
1329 test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1330 test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1331 test/py/ganeti.hypervisor.hv_xen_unittest.py \
1332 test/py/ganeti.hypervisor_unittest.py \
1333 test/py/ganeti.impexpd_unittest.py \
1334 test/py/ganeti.jqueue_unittest.py \
1335 test/py/ganeti.jstore_unittest.py \
1336 test/py/ganeti.locking_unittest.py \
1337 test/py/ganeti.luxi_unittest.py \
1338 test/py/ganeti.masterd.iallocator_unittest.py \
1339 test/py/ganeti.masterd.instance_unittest.py \
1340 test/py/ganeti.mcpu_unittest.py \
1341 test/py/ganeti.netutils_unittest.py \
1342 test/py/ganeti.objects_unittest.py \
1343 test/py/ganeti.opcodes_unittest.py \
1344 test/py/ganeti.outils_unittest.py \
1345 test/py/ganeti.ovf_unittest.py \
1346 test/py/ganeti.qlang_unittest.py \
1347 test/py/ganeti.query_unittest.py \
1348 test/py/ganeti.rapi.baserlib_unittest.py \
1349 test/py/ganeti.rapi.client_unittest.py \
1350 test/py/ganeti.rapi.resources_unittest.py \
1351 test/py/ganeti.rapi.rlib2_unittest.py \
1352 test/py/ganeti.rapi.testutils_unittest.py \
1353 test/py/ganeti.rpc_unittest.py \
1354 test/py/ganeti.runtime_unittest.py \
1355 test/py/ganeti.serializer_unittest.py \
1356 test/py/ganeti.server.rapi_unittest.py \
1357 test/py/ganeti.ssconf_unittest.py \
1358 test/py/ganeti.ssh_unittest.py \
1359 test/py/ganeti.storage.bdev_unittest.py \
1360 test/py/ganeti.storage.container_unittest.py \
1361 test/py/ganeti.storage.drbd_unittest.py \
1362 test/py/ganeti.storage.filestorage_unittest.py \
1363 test/py/ganeti.tools.burnin_unittest.py \
1364 test/py/ganeti.tools.ensure_dirs_unittest.py \
1365 test/py/ganeti.tools.node_daemon_setup_unittest.py \
1366 test/py/ganeti.tools.prepare_node_join_unittest.py \
1367 test/py/ganeti.uidpool_unittest.py \
1368 test/py/ganeti.utils.algo_unittest.py \
1369 test/py/ganeti.utils.filelock_unittest.py \
1370 test/py/ganeti.utils.hash_unittest.py \
1371 test/py/ganeti.utils.io_unittest-runasroot.py \
1372 test/py/ganeti.utils.io_unittest.py \
1373 test/py/ganeti.utils.log_unittest.py \
1374 test/py/ganeti.utils.lvm_unittest.py \
1375 test/py/ganeti.utils.mlock_unittest.py \
1376 test/py/ganeti.utils.nodesetup_unittest.py \
1377 test/py/ganeti.utils.process_unittest.py \
1378 test/py/ganeti.utils.retry_unittest.py \
1379 test/py/ganeti.utils.storage_unittest.py \
1380 test/py/ganeti.utils.text_unittest.py \
1381 test/py/ganeti.utils.wrapper_unittest.py \
1382 test/py/ganeti.utils.x509_unittest.py \
1383 test/py/ganeti.utils_unittest.py \
1384 test/py/ganeti.vcluster_unittest.py \
1385 test/py/ganeti.workerpool_unittest.py \
1386 test/py/pycurl_reset_unittest.py \
1387 test/py/qa.qa_config_unittest.py \
1388 test/py/tempfile_fork_unittest.py
1390 python_test_support = \
1391 test/py/__init__.py \
1392 test/py/lockperf.py \
1393 test/py/testutils.py \
1395 test/py/cmdlib/__init__.py \
1396 test/py/cmdlib/testsupport/__init__.py \
1397 test/py/cmdlib/testsupport/cmdlib_testcase.py \
1398 test/py/cmdlib/testsupport/config_mock.py \
1399 test/py/cmdlib/testsupport/iallocator_mock.py \
1400 test/py/cmdlib/testsupport/lock_manager_mock.py \
1401 test/py/cmdlib/testsupport/netutils_mock.py \
1402 test/py/cmdlib/testsupport/processor_mock.py \
1403 test/py/cmdlib/testsupport/rpc_runner_mock.py \
1404 test/py/cmdlib/testsupport/ssh_mock.py \
1405 test/py/cmdlib/testsupport/util.py
1407 haskell_tests = test/hs/htest
1410 test/py/check-cert-expired_unittest.bash \
1411 test/py/daemon-util_unittest.bash \
1412 test/py/ganeti-cleaner_unittest.bash \
1413 test/py/import-export_unittest.bash \
1414 test/py/cli-test.bash \
1415 test/py/bash_completion.bash
1418 dist_TESTS += $(python_tests)
1425 nodist_TESTS += $(haskell_tests)
1426 dist_TESTS += test/hs/offline-test.sh
1428 test/hs/hpc-htools \
1429 test/hs/hpc-mon-collector \
1430 $(HS_BUILT_TEST_HELPERS)
1433 TESTS = $(dist_TESTS) $(nodist_TESTS)
1435 # Environment for all tests
1436 PLAIN_TESTS_ENVIRONMENT = \
1437 PYTHONPATH=.:./test/py \
1438 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1439 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1442 # Environment for tests run by automake
1443 TESTS_ENVIRONMENT = \
1444 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1447 $(dist_sbin_SCRIPTS) \
1449 $(pkglib_python_scripts) \
1450 $(nodist_pkglib_python_scripts) \
1451 $(nodist_tools_python_scripts) \
1452 $(pkgpython_PYTHON) \
1455 $(hypervisor_PYTHON) \
1470 all_python_code += $(python_tests)
1471 all_python_code += $(python_test_support)
1476 test/py/check-cert-expired_unittest.bash \
1477 test/py/daemon-util_unittest.bash \
1478 test/py/ganeti-cleaner_unittest.bash \
1479 test/py/import-export_unittest.bash \
1480 test/py/cli-test.bash \
1481 test/py/bash_completion.bash \
1482 test/hs/offline-test.sh \
1483 test/hs/cli-tests-defs.sh \
1484 $(all_python_code) \
1485 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1488 check_python_code = \
1489 $(BUILD_BASH_COMPLETION) \
1495 lint_python_code = \
1497 ganeti/http/server.py \
1498 $(dist_sbin_SCRIPTS) \
1500 $(pkglib_python_scripts) \
1501 $(BUILD_BASH_COMPLETION) \
1507 standalone_python_modules = \
1508 lib/rapi/client.py \
1509 tools/ganeti-listrunner
1511 pep8_python_code = \
1513 ganeti/http/server.py \
1514 $(dist_sbin_SCRIPTS) \
1516 $(pkglib_python_scripts) \
1517 $(BUILD_BASH_COMPLETION) \
1520 $(PYTHON_BOOTSTRAP) \
1522 $(python_test_support)
1524 test/py/daemon-util_unittest.bash: daemons/daemon-util
1526 test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1528 test/py/bash_completion.bash: doc/examples/bash_completion-debug
1530 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1531 sed -f $(REPLACE_VARS_SED) < $< > $@
1534 tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
1535 sed -f $(REPLACE_VARS_SED) < $< > $@
1538 tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
1539 sed -f $(REPLACE_VARS_SED) < $< > $@
1542 tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
1543 sed -f $(REPLACE_VARS_SED) < $< > $@
1546 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1547 sed -f $(REPLACE_VARS_SED) < $< > $@
1550 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1551 sed -f $(REPLACE_VARS_SED) < $< > $@
1554 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1555 sed -f $(REPLACE_VARS_SED) < $< > $@
1557 doc/examples/bash_completion: BC_ARGS = --compact
1558 doc/examples/bash_completion-debug: BC_ARGS =
1560 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1561 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1562 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1563 daemons/ganeti-cleaner \
1564 $(GENERATED_FILES) $(HS_GENERATED_FILES)
1565 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1566 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1568 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1569 lib/build/shell_example_lexer.py \
1570 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1571 @echo "Checking $< for hardcoded paths..."
1572 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1573 echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1577 trap 'echo auto-removing $@; rm $@' EXIT; \
1578 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1579 $(CHECK_MAN_REFERENCES) $@; \
1582 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1583 @test -n "$(PANDOC)" || \
1584 { echo 'pandoc' not found during configure; exit 1; }
1585 set -o pipefail -e; \
1586 trap 'echo auto-removing $@; rm $@' EXIT; \
1587 $(PANDOC) -s -f rst -t man $< man/footer.rst | \
1588 sed -e 's/\\@/@/g' > $@; \
1589 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1590 $(CHECK_MAN_DASHES) $@; \
1593 man/%.html.in: man/%.gen man/footer.rst
1594 @test -n "$(PANDOC)" || \
1595 { echo 'pandoc' not found during configure; exit 1; }
1597 $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1598 sed -e 's/\\@/@/g' > $@
1600 man/%: man/%.in $(REPLACE_VARS_SED)
1601 sed -f $(REPLACE_VARS_SED) < $< > $@
1603 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1604 sed -f $(REPLACE_VARS_SED) < $< > $@
1607 if test -d .git; then \
1608 git describe > $@; \
1609 elif test ! -f $@ ; then \
1610 echo "Cannot auto-generate $@ file"; exit 1; \
1613 .PHONY: clean-vcs-version
1617 .PHONY: regen-vcs-version
1621 if test -d .git; then \
1622 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1623 git describe > $$T; \
1624 if ! cmp --quiet $$T vcs-version; then \
1625 mv $$T vcs-version; \
1629 src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1630 vcs-version $(built_base_sources)
1632 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1633 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1635 src/Ganeti/Hs2Py/ListConstants.hs: src/Ganeti/Hs2Py/ListConstants.hs.in \
1636 src/Ganeti/HsConstants.hs \
1640 ## Extract constant names from 'HsConstants.hs' by extracting the left
1641 ## side of all lines containing an equal sign (i.e., '=') and
1642 ## prepending the apostrophe sign (i.e., "'").
1644 ## For example, the constant
1645 ## adminstDown = ...
1648 NAMES=$$(sed -n -e "/=/ s/\(.*\) =.*/ '\1:/g p" \
1649 $(abs_top_srcdir)/src/Ganeti/HsConstants.hs); \
1650 m4 -DPY_CONSTANT_NAMES="$$NAMES" $(abs_top_srcdir)/$< > $@
1652 src/Ganeti/PyConstants.hs: src/Ganeti/PyConstants.hs.in \
1653 lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
1654 lib/jstore.py $(RUN_IN_TEMPDIR) \
1655 $(CONVERT_CONSTANTS) $(built_base_sources) \
1656 | lib/_vcsversion.py
1659 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
1662 src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
1665 test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1666 $(built_base_sources)
1670 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1671 echo "import $$name ()" ; \
1675 lib/_autoconf.py: Makefile | stamp-directories
1677 { echo '# This file is automatically generated, do not edit!'; \
1680 echo '"""Build-time configuration for Ganeti.'; \
1682 echo 'This file is autogenerated by the build process.'; \
1683 echo 'For any changes you need to re-run ./configure (and'; \
1684 echo 'not edit by hand).'; \
1688 echo '# pylint: disable=C0301,C0324'; \
1689 echo '# because this is autogenerated, we do not want'; \
1690 echo '# style warnings' ; \
1692 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1693 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1694 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1695 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1696 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1697 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1698 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1699 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1700 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1701 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1702 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1703 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1704 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1705 echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
1706 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1707 echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
1708 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1709 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1710 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1711 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1712 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1713 echo "KVM_PATH = '$(KVM_PATH)'"; \
1714 echo "IP_PATH = '$(IP_PATH)'"; \
1715 echo "SOCAT_PATH = '$(SOCAT)'"; \
1716 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1717 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1718 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1719 echo "TOOLSDIR = '$(toolsdir)'"; \
1720 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1721 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1722 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1723 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1724 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1725 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1726 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1727 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1728 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1729 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1730 echo "RAPI_USER = '$(RAPI_USER)'"; \
1731 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1732 echo "CONFD_USER = '$(CONFD_USER)'"; \
1733 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1734 echo "LUXID_USER = '$(LUXID_USER)'"; \
1735 echo "LUXID_GROUP = '$(LUXID_GROUP)'"; \
1736 echo "NODED_USER = '$(NODED_USER)'"; \
1737 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1738 echo "MOND_USER = '$(MOND_USER)'"; \
1739 echo "MOND_GROUP = '$(MOND_GROUP)'"; \
1740 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1741 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1742 echo "HTOOLS = True"; \
1743 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1744 echo "XEN_CMD = '$(XEN_CMD)'"; \
1745 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1746 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1747 echo "ENABLE_MOND = $(ENABLE_MOND)"; \
1748 ## Write dictionary with man page name as the key and the section number as the
1750 echo "MAN_PAGES = {"; \
1751 for i in $(notdir $(man_MANS)); do \
1752 echo "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/ "\1": \2,/g'; \
1757 lib/_constants.py: Makefile lib/_constants.py.in src/hs2py-constants \
1759 cat $(abs_top_srcdir)/lib/_constants.py.in > $@
1760 src/hs2py-constants >> $@
1762 lib/constants.py: lib/_constants.py
1764 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1766 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1767 { echo '# This file is automatically generated, do not edit!'; \
1770 echo '"""Build-time VCS version number for Ganeti.'; \
1772 echo 'This file is autogenerated by the build process.'; \
1773 echo 'For any changes you need to re-run ./configure (and'; \
1774 echo 'not edit by hand).'; \
1778 echo '# pylint: disable=C0301,C0324'; \
1779 echo '# because this is autogenerated, we do not want'; \
1780 echo '# style warnings' ; \
1782 echo "VCS_VERSION = '$$VCSVER'"; \
1785 lib/opcodes.py: Makefile src/hs2py src/Ganeti/PyConstants.hs \
1786 lib/opcodes.py.in_before lib/opcodes.py.in_after \
1788 cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
1790 cat $(abs_top_srcdir)/lib/opcodes.py.in_after >> $@
1792 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1793 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1795 $(SHELL_ENV_INIT): Makefile stamp-directories
1797 { echo '# Allow overriding for tests'; \
1798 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1799 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1801 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1802 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1803 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1804 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1805 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1808 ## Writes sed script to replace placeholders with build-time values. The
1809 ## additional quotes after the first @ sign are necessary to stop configure
1810 ## from replacing those values as well.
1811 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1813 { echo 's#@''PREFIX@#$(prefix)#g'; \
1814 echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1815 echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1816 echo 's#@''BINDIR@#$(execprefix)/bin#g'; \
1817 echo 's#@''SBINDIR@#$(execprefix)/sbin#g'; \
1818 echo 's#@''LIBDIR@#$(libdir)#g'; \
1819 echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1820 echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1821 echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1822 echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1823 echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1824 echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1825 echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1826 echo 's#@''PKGLIBDIR@#$(libdir)/ganeti#g'; \
1827 echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1828 echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1829 echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1830 echo 's#@''GNTLUXIDUSER@#$(LUXID_USER)#g'; \
1831 echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1832 echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
1833 echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1834 echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1835 echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1836 echo 's#@''GNTLUXIDGROUP@#$(LUXID_GROUP)#g'; \
1837 echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1838 echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
1839 echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1840 echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1841 echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
1842 echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1843 echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1845 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1846 echo ' r $(SHELL_ENV_INIT)'; \
1851 # Using deferred evaluation
1852 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1853 daemons/ganeti-watcher: MODULE = ganeti.watcher
1854 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1855 tools/burnin: MODULE = ganeti.tools.burnin
1856 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1857 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1858 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1859 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1860 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1862 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1863 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1865 { echo '#!/usr/bin/python'; \
1866 echo '# This file is automatically generated, do not edit!'; \
1867 echo "# Edit $(MODULE) instead."; \
1869 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1871 echo '# pylint: disable=C0103'; \
1872 echo '# C0103: Invalid name'; \
1874 echo 'import sys'; \
1875 echo 'import $(MODULE) as main'; \
1877 echo '# Temporarily alias commands until bash completion'; \
1878 echo '# generator is changed'; \
1879 echo 'if hasattr(main, "commands"):'; \
1880 echo ' commands = main.commands # pylint: disable=E1101'; \
1881 echo 'if hasattr(main, "aliases"):'; \
1882 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1884 echo 'if __name__ == "__main__":'; \
1885 echo ' sys.exit(main.Main())'; \
1889 $(HS_BUILT_TEST_HELPERS): Makefile
1890 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1892 { echo '#!/bin/sh'; \
1893 echo '# This file is automatically generated, do not edit!'; \
1894 echo "# Edit Makefile.am instead."; \
1896 echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
1900 stamp-directories: Makefile
1901 $(MAKE) $(AM_MAKEFLAGS) ganeti
1902 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1905 # We need to create symlinks because "make distcheck" will not install Python
1906 # files when building.
1907 stamp-srclinks: Makefile | stamp-directories
1909 for i in $(srclink_files); do \
1910 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1911 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1918 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1921 check-dirs: $(GENERATED_FILES)
1923 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1925 while read dir; do \
1927 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1928 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1931 for dir in $(DIRS); do \
1932 if ! test -d "$$dir"; then \
1933 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1937 test -z "$$error"; \
1941 check-local: check-dirs $(GENERATED_FILES)
1942 $(CHECK_PYTHON_CODE) $(check_python_code)
1943 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1944 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1945 RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
1946 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1948 if [ "x`echo $(VERSION_SUFFIX)|grep 'alpha'`" == "x" ]; then \
1949 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1950 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1951 echo "Incorrect version in README, expected $$expver" >&2; \
1954 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1955 doc/security.rst; do \
1956 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1957 "Documents Ganeti version $$expver"; then \
1958 echo "Incorrect version in $$file, expected $$expver" >&2; \
1962 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1963 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
1966 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
1967 ".. Last updated for Ganeti $$expver"; then \
1968 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
1972 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1973 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1974 echo "Longest line in $$file is longer than 80 characters" >&2; \
1981 hs-test-%: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1986 hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1991 hs-shell-%: test/hs/hpc-htools test/hs/hpc-mon-collector \
1992 $(HS_BUILT_TEST_HELPERS)
1993 @rm -f hpc-htools.tix hpc-mon-collector.tix
1994 HBINARY="./test/hs/hpc-htools" \
1995 SHELLTESTARGS=$(SHELLTESTARGS) \
1996 ./test/hs/offline-test.sh $*
1999 hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
2000 @rm -f hpc-htools.tix hpc-mon-collector.tix
2001 HBINARY="./test/hs/hpc-htools" \
2002 SHELLTESTARGS=$(SHELLTESTARGS) \
2003 ./test/hs/offline-test.sh
2006 hs-check: hs-tests hs-shell
2008 # E111: indentation is not a multiple of four
2009 # E121: continuation line indentation is not a multiple of four
2010 # (since our indent level is not 4)
2011 # E125: continuation line does not distinguish itself from next logical line
2012 # (since our indent level is not 4)
2013 # E127: continuation line over-indented for visual indent
2014 # (since our indent level is not 4)
2015 # note: do NOT add E128 here; it's a valid style error in most cases!
2016 # I've seen real errors, but also some cases were we indent wrongly
2017 # due to line length; try to rework the cases where it is triggered,
2018 # instead of silencing it
2019 # E261: at least two spaces before inline comment
2020 # E501: line too long (80 characters)
2021 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
2023 # For excluding pep8 expects filenames only, not whole paths
2024 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
2026 LINT_TARGETS = pylint pylint-qa pylint-test
2028 LINT_TARGETS += pep8
2031 LINT_TARGETS += hlint
2035 lint: $(LINT_TARGETS)
2038 pylint: $(GENERATED_FILES)
2039 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2040 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
2043 pylint-qa: $(GENERATED_FILES)
2044 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2045 cd $(top_srcdir)/qa && \
2046 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
2047 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
2048 # FIXME: lint all test code, not just the newly added test support
2049 pylint-test: $(GENERATED_FILES)
2050 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2051 cd $(top_srcdir) && \
2052 PYTHONPATH=.:./test/py $(PYLINT) $(LINT_OPTS) \
2053 --rcfile=pylintrc-test $(python_test_support)
2056 pep8: $(GENERATED_FILES)
2057 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
2058 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
2059 --repeat $(pep8_python_code)
2061 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
2062 HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
2064 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
2065 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
2066 @rm -f doc/hs-lint.html
2067 if tty -s; then C="-c"; else C=""; fi; \
2068 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
2069 --ignore "Use first" \
2070 --ignore "Use &&&" \
2071 --ignore "Use void" \
2072 --ignore "Reduce duplication" \
2073 --hint src/lint-hints \
2074 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
2075 @if [ ! -f doc/hs-lint.html ]; then \
2076 echo "All good" > doc/hs-lint.html; \
2079 # a dist hook rule for updating the vcs-version file; this is
2080 # hardcoded due to where it needs to build the file...
2082 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
2083 rm -f $(top_distdir)/vcs-version
2084 cp -p $(srcdir)/vcs-version $(top_distdir)
2086 # a distcheck hook rule for catching revision control directories
2088 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
2089 echo "Found revision control files in final archive." 1>&2; \
2092 if find $(top_distdir) -name '*.py[co]' | grep .; then \
2093 echo "Found Python byte code in final archive." 1>&2; \
2096 if find $(top_distdir) -name '*~' | grep .; then \
2097 echo "Found backup files in final archive." 1>&2; \
2100 # Empty files or directories should not be distributed. They can cause
2101 # unnecessary warnings for packagers. Directories used by automake during
2102 # distcheck must be excluded.
2103 if find $(top_distdir) -empty -and -not \( \
2104 -path $(top_distdir)/_build -or \
2105 -path $(top_distdir)/_inst \) | grep .; then \
2106 echo "Found empty files or directories in final archive." 1>&2; \
2109 if test -e $(top_distdir)/doc/man-html; then \
2110 echo "Found documentation including man pages in final archive" >&2; \
2114 # Backwards compatible distcheck-release target
2115 distcheck-release: distcheck
2117 distrebuildcheck: dist
2119 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
2120 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
2122 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
2125 $(MAKE) maintainer-clean; \
2126 cp $(abs_srcdir)/vcs-version .; \
2128 $(MAKE) $(AM_MAKEFLAGS)
2132 for i in $(DIST_ARCHIVES); do \
2133 echo -n "Checking $$i ... "; \
2134 autotools/check-tar < $$i; \
2139 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
2140 "$(DESTDIR)${localstatedir}/log/ganeti" \
2141 "$(DESTDIR)${localstatedir}/run/ganeti"
2143 for dir in $(SYMLINK_TARGET_DIRS); do \
2144 @mkdir_p@ $(DESTDIR)$$dir; \
2146 for prog in $(HS_BIN_ROLES); do \
2147 $(LN_S) $(bindir)/$$prog $(DESTDIR)$(exec_prefix)/bin/$$prog; \
2149 $(LN_S) $(bindir)/htools $(DESTDIR)$(libdir)/ganeti/iallocators/hail
2150 for prog in $(all_sbin_scripts); do \
2151 $(LN_S) $(sbindir)/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
2153 for link in $(SYMLINK_DIRS); do \
2154 $(LN_S) $(versiondir)$$link $(DESTDIR)$$link; \
2156 for prog in $(all_myexeclib_scripts); do \
2157 $(LN_S) $(pkglibdir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2159 if ! test -n '$(ENABLE_MANPAGES)'; then \
2160 for man in $(manfullpath); do \
2161 $(LN_S) $(versiondir)$(datarootdir)/man/$$man $(DESTDIR)$(datarootdir)/man/$$man; \
2168 apidoc: py-apidoc hs-apidoc
2174 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
2175 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
2176 $(RUN_IN_TEMPDIR) epydoc -v \
2177 --conf $(CURDIR)/epydoc.conf \
2178 --output $(CURDIR)/$(APIDOC_PY_DIR)
2181 hs-apidoc: $(APIDOC_HS_DIR)/index.html
2183 $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
2184 @test -n "$(HSCOLOUR)" || \
2185 { echo 'HsColour' not found during configure; exit 1; }
2186 @test -n "$(HADDOCK)" || \
2187 { echo 'haddock' not found during configure; exit 1; }
2188 rm -rf $(APIDOC_HS_DIR)/*
2189 for i in $(ALL_APIDOC_HS_DIRS); do \
2191 $(HSCOLOUR) -print-css > $$i/hscolour.css; \
2194 export LC_ALL=en_US.UTF-8; \
2195 OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
2196 if [ "$(HS_PARALLEL3)" ]; \
2197 then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
2199 if [ "$(HS_REGEX_PCRE)" ]; \
2200 then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
2202 for file in $(HS_LIBTESTBUILT_SRCS); do \
2203 f_nosrc=$${file##src/}; \
2204 f_notst=$${f_nosrc##test/hs/}; \
2205 f_html=$${f_notst%%.hs}.html; \
2206 $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
2208 $(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
2209 -t ganeti -p src/haddock-prologue \
2210 --source-module="%{MODULE/.//}.html" \
2211 --source-entity="%{MODULE/.//}.html#%{NAME}" \
2213 $(HS_LIBTESTBUILT_SRCS)
2216 TAGS: $(GENERATED_FILES)
2218 $(GHC) -e ":etags" -v0 \
2219 $(filter-out -O -Werror,$(HFLAGS)) \
2220 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
2222 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
2223 -path './daemons/ganeti-*' -o -path './tools/*' -o \
2224 -path './qa/*.py' | \
2225 etags -l python -a -
2231 COVERAGE_TESTS += hs-coverage
2234 COVERAGE_TESTS += py-coverage
2237 coverage: $(COVERAGE_TESTS)
2240 py-coverage: $(GENERATED_FILES) $(python_tests)
2241 @test -n "$(PYCOVERAGE)" || \
2242 { echo 'python-coverage' not found during configure; exit 1; }
2244 COVERAGE=$(PYCOVERAGE) \
2245 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2246 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2247 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2248 $(PLAIN_TESTS_ENVIRONMENT) \
2249 $(abs_top_srcdir)/autotools/gen-py-coverage \
2253 hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2255 $(MAKE) $(AM_MAKEFLAGS) hs-check
2256 @mkdir_p@ $(COVERAGE_HS_DIR)
2257 hpc sum --union $(HPCEXCL) \
2258 htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2259 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2260 hpc report coverage-hs.tix | tee $(COVERAGE_HS_DIR)/report.txt
2261 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2263 # Special "kind-of-QA" target for htools, needs special setup (all
2264 # tools compiled with -fhpc)
2269 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2270 rm -f *.tix *.mix; \
2272 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2273 --output=live-test.tix ; \
2274 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2275 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2276 --srcdir=.. $(HPCEXCL) ; \
2277 hpc report --srcdir=.. live-test $(HPCEXCL)
2279 commit-check: autotools-check distcheck lint apidoc
2282 TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
2283 $(abs_top_srcdir)/test/autotools/*-*.test \
2286 .PHONY: gitignore-check
2288 @if [ -n "`git status --short`" ]; then \
2289 echo "Git status is not clean!" 1>&2 ; \
2290 git status --short; \
2294 # target to rebuild all man pages (both groff and html output)
2296 man: $(man_MANS) $(manhtml)
2298 # Target that builds all binaries (including those that are not
2299 # rebuilt except when running the tests)
2301 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2303 # we don't need the ancient implicit rules:
2310 -include ./Makefile.local