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 two directories,
44 # with only symbolic links added at other places.
46 # $(versiondir) contains most of Ganeti and all architecture-dependent files
47 # $(versionedsharedir) contains only architecture-independent files; all python
48 # executables need to go directly to $(versionedsharedir), as all ganeti python
49 # mdules are installed outside the usual python path, i.e., as private modules.
51 # $(defaultversiondir) and $(defaultversionedsharedir) are the corresponding
52 # directories for "the currently running" version of Ganeti. We never install
53 # there, but all symbolic links go there, rather than directory to $(versiondir)
54 # or $(versionedsharedir). Note that all links to $(default*dir) need to be stable;
55 # so, if some currently architecture-independent executable is replaced by an
56 # architecture-dependent one (and hence has to go under $(versiondir)), add a link
57 # under $(versionedsharedir) but do not change the external links.
59 DIRVERSION=$(VERSION_FULL)
61 DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
63 versiondir = $(libdir)/ganeti/$(DIRVERSION)
64 defaultversiondir = $(libdir)/ganeti/default
65 versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
66 defaultversionedsharedir = $(prefix)/share/ganeti/default
69 # Note: these are automake-specific variables, and must be named after
70 # the directory + 'dir' suffix
71 pkglibdir = $(versiondir)$(libdir)/ganeti
72 myexeclibdir = $(pkglibdir)
73 bindir = $(versiondir)$(exec_prefix)/bin
74 sbindir = $(versiondir)$(exec_prefix)/sbin
75 mandir = $(versionedsharedir)$(datarootdir)/man
76 pkgpythondir = $(versionedsharedir)/ganeti
77 gntpythondir = $(versionedsharedir)
78 pkgpython_bindir = $(versionedsharedir)
79 gnt_python_sbindir = $(versionedsharedir)
80 tools_pythondir = $(versionedsharedir)
82 clientdir = $(pkgpythondir)/client
83 cmdlibdir = $(pkgpythondir)/cmdlib
84 hypervisordir = $(pkgpythondir)/hypervisor
85 storagedir = $(pkgpythondir)/storage
86 httpdir = $(pkgpythondir)/http
87 masterddir = $(pkgpythondir)/masterd
88 confddir = $(pkgpythondir)/confd
89 rapidir = $(pkgpythondir)/rapi
90 serverdir = $(pkgpythondir)/server
91 watcherdir = $(pkgpythondir)/watcher
92 impexpddir = $(pkgpythondir)/impexpd
93 utilsdir = $(pkgpythondir)/utils
94 toolsdir = $(pkglibdir)/tools
95 iallocatorsdir = $(pkglibdir)/iallocators
96 pytoolsdir = $(pkgpythondir)/tools
97 docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
99 SYMLINK_TARGET_DIRS = \
100 $(sysconfdir)/ganeti \
101 $(libdir)/ganeti/iallocators \
102 $(libdir)/ganeti/tools \
103 $(prefix)/share/ganeti \
105 $(exec_prefix)/sbin \
106 $(datarootdir)/man/man1 \
107 $(datarootdir)/man/man7 \
108 $(datarootdir)/man/man8
110 # Delete output file if an error occurred while building it
119 src/Ganeti/DataCollectors \
122 src/Ganeti/HTools/Backend \
123 src/Ganeti/HTools/Program \
124 src/Ganeti/Hypervisor \
125 src/Ganeti/Hypervisor/Xen \
126 src/Ganeti/Monitoring \
129 src/Ganeti/Storage/Diskstats \
130 src/Ganeti/Storage/Drbd \
131 src/Ganeti/Storage/Lvm \
134 test/hs/Test/Ganeti \
135 test/hs/Test/Ganeti/Storage \
136 test/hs/Test/Ganeti/Storage/Diskstats \
137 test/hs/Test/Ganeti/Storage/Drbd \
138 test/hs/Test/Ganeti/Storage/Lvm \
139 test/hs/Test/Ganeti/Confd \
140 test/hs/Test/Ganeti/HTools \
141 test/hs/Test/Ganeti/HTools/Backend \
142 test/hs/Test/Ganeti/Hypervisor \
143 test/hs/Test/Ganeti/Hypervisor/Xen \
144 test/hs/Test/Ganeti/Query
146 # Haskell directories without the roots (src, test/hs)
147 HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
158 doc/examples/gnt-debug \
162 test/data/htools/rapi \
186 test/data/ovfdata/other \
189 test/py/cmdlib/testsupport \
192 ALL_APIDOC_HS_DIRS = \
194 $(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
196 BUILDTIME_DIR_AUTOCREATE = \
199 $(ALL_APIDOC_HS_DIRS) \
207 $(BUILDTIME_DIR_AUTOCREATE) \
213 ganeti-[0-9]*.[0-9]*.[0-9]* \
219 COVERAGE_DIR = doc/coverage
220 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
221 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
223 APIDOC_PY_DIR = $(APIDOC_DIR)/py
224 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
226 MAINTAINERCLEANFILES = \
228 doc/install-quick.rst \
233 maintainer-clean-local:
234 rm -rf $(BUILDTIME_DIRS)
237 $(addsuffix /*.py[co],$(DIRS)) \
238 $(addsuffix /*.hi,$(HS_DIRS)) \
239 $(addsuffix /*.o,$(HS_DIRS)) \
240 $(PYTHON_BOOTSTRAP) \
241 $(gnt_python_sbin_SCRIPTS) \
243 $(REPLACE_VARS_SED) \
245 daemons/daemon-util \
246 daemons/ganeti-cleaner \
247 devel/squeeze-amd64.tar.gz \
248 devel/squeeze-amd64.conf \
250 doc/manpages-enabled.rst \
252 doc/examples/bash_completion \
253 doc/examples/bash_completion-debug \
255 lib/_generated_rpc.py \
262 tools/vcluster-setup \
265 $(nodist_pkgpython_PYTHON) \
267 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
268 $(HS_BUILT_TEST_HELPERS) \
272 src/hs2py-constants \
273 .hpc/*.mix src/*.tix test/hs/*.tix *.tix \
277 $(built_base_sources) \
278 $(BUILT_PYTHON_SOURCES) \
279 $(PYTHON_BOOTSTRAP) \
280 $(gnt_python_sbin_SCRIPTS)
284 HS_GENERATED_FILES += $(HS_PROGS)
286 HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
290 HS_GENERATED_FILES += src/ganeti-mond
294 built_base_sources = \
298 built_python_base_sources = \
303 BUILT_PYTHON_SOURCES = \
304 $(built_python_base_sources) \
305 lib/_generated_rpc.py
307 # Generating the RPC wrappers depends on many things, so make sure
308 # it's built at the end of the built sources
309 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
311 # these are all built from the underlying %.in sources
313 doc/examples/ganeti-kvm-poweroff.initd \
314 doc/examples/ganeti.cron \
315 doc/examples/ganeti.initd \
316 doc/examples/ganeti.logrotate \
317 doc/examples/ganeti-master-role.ocf \
318 doc/examples/ganeti-node-role.ocf \
319 doc/examples/gnt-config-backup \
320 doc/examples/hooks/ipsec
322 nodist_pkgpython_PYTHON = \
323 $(BUILT_PYTHON_SOURCES)
325 nodist_pkgpython_bin_SCRIPTS = \
326 $(nodist_pkglib_python_scripts)
328 pkgpython_bin_SCRIPTS = \
329 $(pkglib_python_scripts)
332 lib/build/__init__.py \
333 lib/build/shell_example_lexer.py \
334 lib/build/sphinx_ext.py
338 lib/asyncnotifier.py \
356 lib/opcodes_base.py \
374 lib/client/__init__.py \
375 lib/client/gnt_backup.py \
376 lib/client/gnt_cluster.py \
377 lib/client/gnt_debug.py \
378 lib/client/gnt_group.py \
379 lib/client/gnt_instance.py \
380 lib/client/gnt_job.py \
381 lib/client/gnt_node.py \
382 lib/client/gnt_network.py \
383 lib/client/gnt_os.py \
384 lib/client/gnt_storage.py
387 lib/cmdlib/__init__.py \
388 lib/cmdlib/backup.py \
390 lib/cmdlib/cluster.py \
391 lib/cmdlib/common.py \
392 lib/cmdlib/group.py \
393 lib/cmdlib/instance.py \
394 lib/cmdlib/instance_migration.py \
395 lib/cmdlib/instance_operation.py \
396 lib/cmdlib/instance_query.py \
397 lib/cmdlib/instance_storage.py \
398 lib/cmdlib/instance_utils.py \
400 lib/cmdlib/network.py \
402 lib/cmdlib/operating_system.py \
403 lib/cmdlib/query.py \
407 hypervisor_PYTHON = \
408 lib/hypervisor/__init__.py \
409 lib/hypervisor/hv_base.py \
410 lib/hypervisor/hv_chroot.py \
411 lib/hypervisor/hv_fake.py \
412 lib/hypervisor/hv_kvm.py \
413 lib/hypervisor/hv_lxc.py \
414 lib/hypervisor/hv_xen.py
417 lib/storage/__init__.py \
418 lib/storage/bdev.py \
419 lib/storage/base.py \
420 lib/storage/container.py \
421 lib/storage/drbd.py \
422 lib/storage/drbd_info.py \
423 lib/storage/drbd_cmdgen.py \
424 lib/storage/filestorage.py
427 lib/rapi/__init__.py \
428 lib/rapi/baserlib.py \
430 lib/rapi/client_utils.py \
431 lib/rapi/connector.py \
433 lib/rapi/testutils.py
436 lib/http/__init__.py \
442 lib/confd/__init__.py \
446 lib/masterd/__init__.py \
447 lib/masterd/iallocator.py \
448 lib/masterd/instance.py
451 lib/impexpd/__init__.py
454 lib/watcher/__init__.py \
455 lib/watcher/nodemaint.py \
459 lib/server/__init__.py \
460 lib/server/masterd.py \
461 lib/server/noded.py \
465 lib/tools/__init__.py \
466 lib/tools/burnin.py \
467 lib/tools/ensure_dirs.py \
468 lib/tools/node_cleanup.py \
469 lib/tools/node_daemon_setup.py \
470 lib/tools/prepare_node_join.py
473 lib/utils/__init__.py \
475 lib/utils/filelock.py \
481 lib/utils/nodesetup.py \
482 lib/utils/process.py \
484 lib/utils/storage.py \
486 lib/utils/version.py \
487 lib/utils/wrapper.py \
494 doc/cluster-merge.rst \
505 doc/design-2.10.rst \
506 doc/design-autorepair.rst \
507 doc/design-bulk-create.rst \
508 doc/design-chained-jobs.rst \
509 doc/design-cpu-pinning.rst \
510 doc/design-device-uuid-name.rst \
511 doc/design-draft.rst \
512 doc/design-hotplug.rst \
513 doc/design-glusterfs-ganeti-support.rst \
514 doc/design-daemons.rst \
515 doc/design-htools-2.3.rst \
516 doc/design-http-server.rst \
517 doc/design-impexp2.rst \
518 doc/design-internal-shutdown.rst \
519 doc/design-lu-generated-jobs.rst \
520 doc/design-linuxha.rst \
521 doc/design-multi-reloc.rst \
522 doc/design-network.rst \
523 doc/design-node-add.rst \
525 doc/design-openvswitch.rst \
526 doc/design-ovf-support.rst \
527 doc/design-opportunistic-locking.rst \
528 doc/design-optables.rst \
529 doc/design-partitioned.rst \
530 doc/design-query-splitting.rst \
531 doc/design-query2.rst \
532 doc/design-reason-trail.rst \
533 doc/design-resource-model.rst \
534 doc/design-restricted-commands.rst \
535 doc/design-shared-storage.rst \
536 doc/design-monitoring-agent.rst \
537 doc/design-virtual-clusters.rst \
538 doc/design-x509-ca.rst \
539 doc/design-hroller.rst \
540 doc/design-storagetypes.rst \
541 doc/design-upgrade.rst \
542 doc/design-hsqueeze.rst \
548 doc/install-quick.rst \
551 doc/manpages-disabled.rst \
552 doc/monitoring-query-format.rst \
553 doc/move-instance.rst \
555 doc/ovfconverter.rst \
559 doc/virtual-cluster.rst \
562 # Generates file names such as "doc/man-gnt-instance.rst"
563 mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
565 # Haskell programs to be installed in $PREFIX/bin
566 HS_BIN_PROGS=src/htools
568 # Haskell programs to be installed in the MYEXECLIB dir
570 HS_MYEXECLIB_PROGS=src/mon-collector
575 # Haskell programs to be compiled by "make really-all"
583 # All Haskell non-test programs to be compiled but not automatically installed
584 HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
586 HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
587 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
589 # Haskell programs that cannot be disabled at configure (e.g., unlike
594 test/hs/hpc-mon-collector \
598 HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)
600 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) \
601 src/mon-collector.hs \
602 src/hs2py-constants.hs
603 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
606 -O -Wall -Werror -isrc \
607 -fwarn-monomorphism-restriction \
609 $(GHC_BYVERSION_FLAGS)
611 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
613 # internal extra flags (used for test/hs/htest mainly)
615 # exclude options for coverage reports
616 HPCEXCL = --exclude Main \
617 --exclude Ganeti.Constants \
618 --exclude Ganeti.HTools.QC \
619 --exclude Ganeti.THH \
620 --exclude Ganeti.Version \
621 --exclude Test.Ganeti.Attoparsec \
622 --exclude Test.Ganeti.TestCommon \
623 --exclude Test.Ganeti.TestHTools \
624 --exclude Test.Ganeti.TestHelper \
625 --exclude Test.Ganeti.TestImports \
626 $(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
629 src/Ganeti/BasicTypes.hs \
630 src/Ganeti/Common.hs \
631 src/Ganeti/Compat.hs \
632 src/Ganeti/Confd/Client.hs \
633 src/Ganeti/Confd/ClientFunctions.hs \
634 src/Ganeti/Confd/Server.hs \
635 src/Ganeti/Confd/Types.hs \
636 src/Ganeti/Confd/Utils.hs \
637 src/Ganeti/Config.hs \
638 src/Ganeti/ConfigReader.hs \
639 src/Ganeti/Constants.hs \
640 src/Ganeti/ConstantUtils.hs \
641 src/Ganeti/Cpu/LoadParser.hs \
642 src/Ganeti/Cpu/Types.hs \
643 src/Ganeti/Curl/Multi.hs \
644 src/Ganeti/Daemon.hs \
645 src/Ganeti/DataCollectors/CLI.hs \
646 src/Ganeti/DataCollectors/CPUload.hs \
647 src/Ganeti/DataCollectors/Diskstats.hs \
648 src/Ganeti/DataCollectors/Drbd.hs \
649 src/Ganeti/DataCollectors/InstStatus.hs \
650 src/Ganeti/DataCollectors/InstStatusTypes.hs \
651 src/Ganeti/DataCollectors/Lv.hs \
652 src/Ganeti/DataCollectors/Program.hs \
653 src/Ganeti/DataCollectors/Types.hs \
654 src/Ganeti/Errors.hs \
655 src/Ganeti/HTools/Backend/IAlloc.hs \
656 src/Ganeti/HTools/Backend/Luxi.hs \
657 src/Ganeti/HTools/Backend/Rapi.hs \
658 src/Ganeti/HTools/Backend/Simu.hs \
659 src/Ganeti/HTools/Backend/Text.hs \
660 src/Ganeti/HTools/CLI.hs \
661 src/Ganeti/HTools/Cluster.hs \
662 src/Ganeti/HTools/Container.hs \
663 src/Ganeti/HTools/ExtLoader.hs \
664 src/Ganeti/HTools/Graph.hs \
665 src/Ganeti/HTools/Group.hs \
666 src/Ganeti/HTools/Instance.hs \
667 src/Ganeti/HTools/Loader.hs \
668 src/Ganeti/HTools/Nic.hs \
669 src/Ganeti/HTools/Node.hs \
670 src/Ganeti/HTools/PeerMap.hs \
671 src/Ganeti/HTools/Program/Hail.hs \
672 src/Ganeti/HTools/Program/Harep.hs \
673 src/Ganeti/HTools/Program/Hbal.hs \
674 src/Ganeti/HTools/Program/Hcheck.hs \
675 src/Ganeti/HTools/Program/Hinfo.hs \
676 src/Ganeti/HTools/Program/Hscan.hs \
677 src/Ganeti/HTools/Program/Hspace.hs \
678 src/Ganeti/HTools/Program/Hroller.hs \
679 src/Ganeti/HTools/Program/Main.hs \
680 src/Ganeti/HTools/Types.hs \
681 src/Ganeti/Hypervisor/Xen.hs \
682 src/Ganeti/Hypervisor/Xen/XmParser.hs \
683 src/Ganeti/Hypervisor/Xen/Types.hs \
685 src/Ganeti/Hs2Py/GenConstants.hs \
686 src/Ganeti/Hs2Py/GenOpCodes.hs \
687 src/Ganeti/Hs2Py/OpDoc.hs \
688 src/Ganeti/HsConstants.hs \
689 src/Ganeti/JQueue.hs \
692 src/Ganeti/Logging.hs \
694 src/Ganeti/Monitoring/Server.hs \
695 src/Ganeti/Network.hs \
696 src/Ganeti/Objects.hs \
697 src/Ganeti/OpCodes.hs \
698 src/Ganeti/OpParams.hs \
700 src/Ganeti/Parsers.hs \
701 src/Ganeti/PyValueInstances.hs \
702 src/Ganeti/Query/Cluster.hs \
703 src/Ganeti/Query/Common.hs \
704 src/Ganeti/Query/Export.hs \
705 src/Ganeti/Query/Filter.hs \
706 src/Ganeti/Query/Group.hs \
707 src/Ganeti/Query/Job.hs \
708 src/Ganeti/Query/Language.hs \
709 src/Ganeti/Query/Network.hs \
710 src/Ganeti/Query/Node.hs \
711 src/Ganeti/Query/Query.hs \
712 src/Ganeti/Query/Server.hs \
713 src/Ganeti/Query/Types.hs \
715 src/Ganeti/Runtime.hs \
716 src/Ganeti/Ssconf.hs \
717 src/Ganeti/Storage/Diskstats/Parser.hs \
718 src/Ganeti/Storage/Diskstats/Types.hs \
719 src/Ganeti/Storage/Drbd/Parser.hs \
720 src/Ganeti/Storage/Drbd/Types.hs \
721 src/Ganeti/Storage/Lvm/LVParser.hs \
722 src/Ganeti/Storage/Lvm/Types.hs \
723 src/Ganeti/Storage/Utils.hs \
725 src/Ganeti/Types.hs \
729 test/hs/Test/AutoConf.hs \
730 test/hs/Test/Ganeti/Attoparsec.hs \
731 test/hs/Test/Ganeti/BasicTypes.hs \
732 test/hs/Test/Ganeti/Common.hs \
733 test/hs/Test/Ganeti/Confd/Types.hs \
734 test/hs/Test/Ganeti/Confd/Utils.hs \
735 test/hs/Test/Ganeti/Constants.hs \
736 test/hs/Test/Ganeti/Daemon.hs \
737 test/hs/Test/Ganeti/Errors.hs \
738 test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
739 test/hs/Test/Ganeti/HTools/Backend/Text.hs \
740 test/hs/Test/Ganeti/HTools/CLI.hs \
741 test/hs/Test/Ganeti/HTools/Cluster.hs \
742 test/hs/Test/Ganeti/HTools/Container.hs \
743 test/hs/Test/Ganeti/HTools/ExtLoader.hs \
744 test/hs/Test/Ganeti/HTools/Graph.hs \
745 test/hs/Test/Ganeti/HTools/Instance.hs \
746 test/hs/Test/Ganeti/HTools/Loader.hs \
747 test/hs/Test/Ganeti/HTools/Node.hs \
748 test/hs/Test/Ganeti/HTools/PeerMap.hs \
749 test/hs/Test/Ganeti/HTools/Types.hs \
750 test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
751 test/hs/Test/Ganeti/JSON.hs \
752 test/hs/Test/Ganeti/Jobs.hs \
753 test/hs/Test/Ganeti/JQueue.hs \
754 test/hs/Test/Ganeti/Luxi.hs \
755 test/hs/Test/Ganeti/Network.hs \
756 test/hs/Test/Ganeti/Objects.hs \
757 test/hs/Test/Ganeti/OpCodes.hs \
758 test/hs/Test/Ganeti/Query/Filter.hs \
759 test/hs/Test/Ganeti/Query/Language.hs \
760 test/hs/Test/Ganeti/Query/Network.hs \
761 test/hs/Test/Ganeti/Query/Query.hs \
762 test/hs/Test/Ganeti/Rpc.hs \
763 test/hs/Test/Ganeti/Runtime.hs \
764 test/hs/Test/Ganeti/Ssconf.hs \
765 test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
766 test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
767 test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
768 test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
769 test/hs/Test/Ganeti/THH.hs \
770 test/hs/Test/Ganeti/TestCommon.hs \
771 test/hs/Test/Ganeti/TestHTools.hs \
772 test/hs/Test/Ganeti/TestHelper.hs \
773 test/hs/Test/Ganeti/Types.hs \
774 test/hs/Test/Ganeti/Utils.hs
776 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
779 test/hs/Test/Ganeti/TestImports.hs \
781 src/Ganeti/Hs2Py/ListConstants.hs \
782 src/Ganeti/PyConstants.hs \
783 src/Ganeti/Curl/Internal.hs \
784 src/Ganeti/Version.hs
786 $(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
787 src/Ganeti/Curl/Internal.hsc \
788 lib/_constants.py.in \
789 lib/opcodes.py.in_after \
790 lib/opcodes.py.in_before
792 HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
794 $(RUN_IN_TEMPDIR): | stamp-directories
796 doc/html/index.html: ENABLE_MANPAGES =
797 doc/man-html/index.html: ENABLE_MANPAGES = 1
798 doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
800 # Note: we use here an order-only prerequisite, as the contents of
801 # _constants.py are not actually influencing the html build output: it
802 # has to exist in order for the sphinx module to be loaded
803 # successfully, but we certainly don't want the docs to be rebuilt if
805 doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
806 configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
807 lib/build/shell_example_lexer.py lib/ht.py \
808 doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
809 autotools/sphinx-wrapper | $(BUILT_PYTHON_SOURCES)
810 @test -n "$(SPHINX)" || \
811 { echo 'sphinx-build' not found during configure; exit 1; }
813 if test -n '$(ENABLE_MANPAGES)'; then \
814 echo 'Man pages in documentation were disabled at configure time' >&2; \
818 ## Sphinx provides little control over what content should be included. Some
819 ## mechanisms exist, but they all have drawbacks or actual issues. Since we
820 ## build two different versions of the documentation--once without man pages and
821 ## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
822 ## us with this, but requires running in a temporary directory. It moves the
823 ## correct files into place depending on environment variables.
826 PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
827 $(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
829 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
830 -D release="$(PACKAGE_VERSION)" \
831 -D graphviz_dot="$(DOT)" \
832 -D enable_manpages="$(ENABLE_MANPAGES)" \
833 doc $(CURDIR)/$$dir && \
834 rm -f $$dir/.buildinfo $$dir/objects.inv
837 doc/html: doc/html/index.html
839 doc/man-html: doc/man-html/index.html
841 doc/install-quick.rst: INSTALL
843 doc/upgrade.rst: UPGRADE
845 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
847 { echo '.. This file is automatically updated at build time from $<.'; \
848 echo '.. Do not edit.'; \
853 doc/manpages-enabled.rst: Makefile | $(built_base_sources)
854 { echo '.. This file is automatically generated, do not edit!'; \
859 echo '.. toctree::'; \
860 echo ' :maxdepth: 1'; \
862 for i in $(notdir $(mandocrst)); do \
864 done | LC_ALL=C sort; \
867 doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
869 { echo '.. This file is automatically updated at build time from $<.'; \
870 echo '.. Do not edit.'; \
873 echo '=========================================='; \
874 tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
877 echo 'Man pages in documentation were disabled at configure time' >&2; \
881 doc/users/%: doc/users/%.in Makefile $(REPLACE_VARS_SED)
882 cat $< | sed -f $(REPLACE_VARS_SED) | LC_ALL=C sort | uniq | (grep -v '^root' || true) > $@
887 doc/users/groupmemberships
889 # Things to build but not to install (add it to EXTRA_DIST if it should be
893 doc/examples/bash_completion \
894 doc/examples/bash_completion-debug \
900 noinst_DATA += doc/man-html
902 noinst_DATA += doc/html
908 scripts/gnt-cluster \
911 scripts/gnt-instance \
913 scripts/gnt-network \
918 gnt_scripts_basenames = \
919 $(patsubst scripts/%,%,$(patsubst daemons/%,%,$(gnt_scripts) $(gnt_python_sbin_SCRIPTS)))
921 gnt_python_sbin_SCRIPTS = \
922 $(PYTHON_BOOTSTRAP_SBIN)
924 gntpython_SCRIPTS = $(gnt_scripts)
926 PYTHON_BOOTSTRAP_SBIN = \
927 daemons/ganeti-masterd \
928 daemons/ganeti-noded \
929 daemons/ganeti-rapi \
930 daemons/ganeti-watcher
936 tools/node-daemon-setup \
937 tools/prepare-node-join
949 qa/qa_instance_utils.py \
951 qa/qa_monitoring.py \
960 bin_SCRIPTS += $(HS_BIN_PROGS)
962 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
963 # FIXME: this is a hardcoded logic, instead of auto-resolving
964 $(LN_S) -f ../../../bin/htools \
965 $(DESTDIR)$(iallocatorsdir)/hail
966 for role in $(HS_BIN_ROLES); do \
967 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
971 # This target cannot be merged with the '$(HS_ALL_PROGS)' target
972 # because 'hs2py-constants' cannot depend on 'Ganeti.Constants'. And
973 # the reason for this is because 'hs2py-constants' needs to generate
974 # Python code, and 'Ganeti.Constants' is generated by Python.
975 src/hs2py-constants: src/hs2py-constants.hs src/AutoConf.hs \
976 src/Ganeti/BasicTypes.hs src/Ganeti/ConstantUtils.hs \
977 src/Ganeti/JSON.hs src/Ganeti/THH.hs \
978 src/Ganeti/Hs2Py/GenConstants.hs \
979 src/Ganeti/Hs2Py/ListConstants.hs \
980 src/Ganeti/HsConstants.hs \
981 src/Ganeti/PyValueInstances.hs \
985 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
986 $(HEXTRA) $(HEXTRA_INT) src/hs2py-constants.hs
988 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) Makefile
989 @if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
990 echo "Error: cannot run unittests without the development" \
991 " libraries (see devnotes.rst)" 1>&2; \
994 @rm -f $(notdir $@).tix
997 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
998 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
999 $(HEXTRA) $(HEXTRA_INT) $@
1002 # for the test/hs/htest binary, we need to enable profiling/coverage
1003 test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
1005 # we compile the hpc-htools binary with the program coverage
1006 test/hs/hpc-htools: HEXTRA_INT=-fhpc
1008 # we compile the hpc-mon-collector binary with the program coverage
1009 test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
1012 test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
1014 # rules for building profiling-enabled versions of the haskell
1015 # programs: hs-prof does the full two-step build, whereas
1016 # hs-prof-quick does only the final rebuild (hs-prof must have been
1018 .PHONY: hs-prof hs-prof-quick
1020 @if [ -z "$(TARGET)" ]; then \
1021 echo "You need to define TARGET when running this rule" 1>&2; \
1024 $(MAKE) $(AM_MAKEFLAGS) clean
1025 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf o"
1026 rm -f $(HS_ALL_PROGS)
1027 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
1030 @if [ -z "$(TARGET)" ]; then \
1031 echo "You need to define TARGET when running this rule" 1>&2; \
1034 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf prof_o -prof -auto-all"
1036 dist_sbin_SCRIPTS = \
1037 tools/ganeti-listrunner
1039 nodist_sbin_SCRIPTS = \
1040 daemons/ganeti-cleaner
1042 # strip path prefixes off the sbin scripts
1043 all_sbin_scripts = \
1044 $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
1045 $(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
1048 src/ganeti-confd: src/hconfd
1051 src/ganeti-luxid: src/hluxid
1054 nodist_sbin_SCRIPTS += src/ganeti-confd
1055 nodist_sbin_SCRIPTS += src/ganeti-luxid
1059 nodist_sbin_SCRIPTS += src/ganeti-mond
1065 tools/cfgupgrade12 \
1066 tools/cluster-merge \
1067 tools/confd-client \
1070 tools/move-instance \
1071 tools/ovfconverter \
1072 tools/sanitize-config
1074 dist_tools_SCRIPTS = \
1075 tools/kvm-console-wrapper \
1076 tools/master-ip-setup \
1077 tools/xen-console-wrapper
1079 dist_tools_python_SCRIPTS = \
1083 nodist_tools_python_SCRIPTS = \
1086 tools_python_basenames = $(patsubst tools/%,%,\
1087 $(dist_tools_python_SCRIPTS) $(nodist_tools_python_SCRIPTS))
1089 nodist_tools_SCRIPTS = \
1091 tools/vcluster-setup
1093 tools_basenames = $(patsubst tools/%,%,$(nodist_tools_SCRIPTS) $(dist_tools_SCRIPTS))
1095 pkglib_python_scripts = \
1096 daemons/import-export \
1097 tools/check-cert-expired
1099 nodist_pkglib_python_scripts = \
1101 tools/node-daemon-setup \
1102 tools/prepare-node-join
1104 pkglib_python_basenames = \
1105 $(patsubst daemons/%,%,$(patsubst tools/%,%,\
1106 $(pkglib_python_scripts) $(nodist_pkglib_python_scripts)))
1108 myexeclib_SCRIPTS = \
1109 daemons/daemon-util \
1113 $(HS_MYEXECLIB_PROGS)
1115 # compute the basenames of the myexeclib_scripts
1116 myexeclib_scripts_basenames = \
1117 $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst src/%,%,$(myexeclib_SCRIPTS))))
1125 autotools/build-bash-completion \
1126 autotools/build-rpc \
1127 autotools/check-header \
1128 autotools/check-imports \
1129 autotools/check-man-dashes \
1130 autotools/check-man-references \
1131 autotools/check-man-warnings \
1132 autotools/check-news \
1133 autotools/check-python-code \
1134 autotools/check-tar \
1135 autotools/check-version \
1136 autotools/convert-constants \
1138 autotools/gen-py-coverage \
1139 autotools/sphinx-wrapper \
1140 autotools/testrunner \
1141 autotools/wrong-hardcoded-paths \
1143 daemons/daemon-util.in \
1144 daemons/ganeti-cleaner.in \
1145 $(pkglib_python_scripts) \
1149 tools/vif-ganeti.in \
1150 tools/net-common.in \
1151 tools/vcluster-setup.in \
1154 $(BUILT_EXAMPLES:%=%.in) \
1155 doc/examples/ganeti.default \
1156 doc/examples/ganeti.default-debug \
1157 doc/examples/hooks/ethers \
1158 doc/examples/gnt-debug/README \
1159 doc/examples/gnt-debug/delay0.json \
1160 doc/examples/gnt-debug/delay50.json \
1161 doc/users/groupmemberships.in \
1162 doc/users/groups.in \
1163 doc/users/users.in \
1166 $(python_test_support) \
1172 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
1175 test/hs/cli-tests-defs.sh \
1176 test/hs/offline-test.sh \
1180 man/ganeti-cleaner.8 \
1181 man/ganeti-confd.8 \
1182 man/ganeti-luxid.8 \
1183 man/ganeti-listrunner.8 \
1184 man/ganeti-masterd.8 \
1186 man/ganeti-noded.8 \
1187 man/ganeti-os-interface.7 \
1188 man/ganeti-extstorage-interface.7 \
1190 man/ganeti-watcher.8 \
1197 man/gnt-instance.8 \
1213 # Remove extensions from all filenames in man_MANS
1214 mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1216 manrst = $(patsubst %,%.rst,$(mannoext))
1217 manhtml = $(patsubst %.rst,%.html,$(manrst))
1218 mangen = $(patsubst %.rst,%.gen,$(manrst))
1220 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1221 $(patsubst %.html,%.html.in,$(manhtml)) \
1224 manfullpath = $(patsubst man/%.1,man1/%.1,\
1225 $(patsubst man/%.7,man7/%.7,\
1226 $(patsubst man/%.8,man8/%.8,$(man_MANS))))
1229 test/autotools/autotools-check-news.test \
1230 test/data/htools/clean-nonzero-score.data \
1231 test/data/htools/common-suffix.data \
1232 test/data/htools/empty-cluster.data \
1233 test/data/htools/hail-alloc-drbd.json \
1234 test/data/htools/hail-alloc-invalid-network.json \
1235 test/data/htools/hail-alloc-invalid-twodisks.json \
1236 test/data/htools/hail-alloc-restricted-network.json \
1237 test/data/htools/hail-alloc-spindles.json \
1238 test/data/htools/hail-alloc-twodisks.json \
1239 test/data/htools/hail-change-group.json \
1240 test/data/htools/hail-invalid-reloc.json \
1241 test/data/htools/hail-node-evac.json \
1242 test/data/htools/hail-reloc-drbd.json \
1243 test/data/htools/hbal-dyn.data \
1244 test/data/htools/hbal-excl-tags.data \
1245 test/data/htools/hbal-split-insts.data \
1246 test/data/htools/hspace-tiered-dualspec-exclusive.data \
1247 test/data/htools/hspace-tiered-dualspec.data \
1248 test/data/htools/hspace-tiered-exclusive.data \
1249 test/data/htools/hspace-tiered-ipolicy.data \
1250 test/data/htools/hspace-tiered-mixed.data \
1251 test/data/htools/hspace-tiered-resourcetypes.data \
1252 test/data/htools/hspace-tiered-vcpu.data \
1253 test/data/htools/hspace-tiered.data \
1254 test/data/htools/invalid-node.data \
1255 test/data/htools/missing-resources.data \
1256 test/data/htools/multiple-master.data \
1257 test/data/htools/multiple-tags.data \
1258 test/data/htools/n1-failure.data \
1259 test/data/htools/rapi/groups.json \
1260 test/data/htools/rapi/info.json \
1261 test/data/htools/rapi/instances.json \
1262 test/data/htools/rapi/nodes.json \
1263 test/data/htools/hroller-full.data \
1264 test/data/htools/hroller-nodegroups.data \
1265 test/data/htools/hroller-nonredundant.data \
1266 test/data/htools/hroller-online.data \
1267 test/data/htools/unique-reboot-order.data \
1268 test/hs/shelltests/htools-balancing.test \
1269 test/hs/shelltests/htools-basic.test \
1270 test/hs/shelltests/htools-dynutil.test \
1271 test/hs/shelltests/htools-excl.test \
1272 test/hs/shelltests/htools-hail.test \
1273 test/hs/shelltests/htools-hroller.test \
1274 test/hs/shelltests/htools-hspace.test \
1275 test/hs/shelltests/htools-invalid.test \
1276 test/hs/shelltests/htools-multi-group.test \
1277 test/hs/shelltests/htools-no-backend.test \
1278 test/hs/shelltests/htools-rapi.test \
1279 test/hs/shelltests/htools-single-group.test \
1280 test/hs/shelltests/htools-text-backend.test \
1281 test/hs/shelltests/htools-mon-collector.test \
1282 test/data/bdev-drbd-8.0.txt \
1283 test/data/bdev-drbd-8.3.txt \
1284 test/data/bdev-drbd-8.4.txt \
1285 test/data/bdev-drbd-8.4-no-disk-params.txt \
1286 test/data/bdev-drbd-disk.txt \
1287 test/data/bdev-drbd-net-ip4.txt \
1288 test/data/bdev-drbd-net-ip6.txt \
1289 test/data/bdev-rbd/json_output_empty.txt \
1290 test/data/bdev-rbd/json_output_extra_matches.txt \
1291 test/data/bdev-rbd/json_output_no_matches.txt \
1292 test/data/bdev-rbd/json_output_ok.txt \
1293 test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1294 test/data/bdev-rbd/plain_output_new_no_matches.txt \
1295 test/data/bdev-rbd/plain_output_new_ok.txt \
1296 test/data/bdev-rbd/plain_output_old_empty.txt \
1297 test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1298 test/data/bdev-rbd/plain_output_old_no_matches.txt \
1299 test/data/bdev-rbd/plain_output_old_ok.txt \
1300 test/data/bdev-rbd/output_invalid.txt \
1301 test/data/cert1.pem \
1302 test/data/cert2.pem \
1303 test/data/cluster_config_2.7.json \
1304 test/data/cluster_config_2.8.json \
1305 test/data/cluster_config_2.9.json \
1306 test/data/instance-minor-pairing.txt \
1307 test/data/instance-prim-sec.txt \
1308 test/data/ip-addr-show-dummy0.txt \
1309 test/data/ip-addr-show-lo-ipv4.txt \
1310 test/data/ip-addr-show-lo-ipv6.txt \
1311 test/data/ip-addr-show-lo-oneline-ipv4.txt \
1312 test/data/ip-addr-show-lo-oneline-ipv6.txt \
1313 test/data/ip-addr-show-lo-oneline.txt \
1314 test/data/ip-addr-show-lo.txt \
1315 test/data/kvm_0.12.5_help.txt \
1316 test/data/kvm_0.15.90_help.txt \
1317 test/data/kvm_0.9.1_help.txt \
1318 test/data/kvm_0.9.1_help_boot_test.txt \
1319 test/data/kvm_1.0_help.txt \
1320 test/data/kvm_1.1.2_help.txt \
1321 test/data/kvm_runtime.json \
1322 test/data/lvs_lv.txt \
1323 test/data/NEWS_OK.txt \
1324 test/data/NEWS_previous_unreleased.txt \
1325 test/data/ovfdata/compr_disk.vmdk.gz \
1326 test/data/ovfdata/config.ini \
1327 test/data/ovfdata/corrupted_resources.ovf \
1328 test/data/ovfdata/empty.ini \
1329 test/data/ovfdata/empty.ovf \
1330 test/data/ovfdata/ganeti.mf \
1331 test/data/ovfdata/ganeti.ovf \
1332 test/data/ovfdata/gzip_disk.ovf \
1333 test/data/ovfdata/new_disk.vmdk \
1334 test/data/ovfdata/no_disk.ini \
1335 test/data/ovfdata/no_disk_in_ref.ovf \
1336 test/data/ovfdata/no_os.ini \
1337 test/data/ovfdata/no_ovf.ova \
1338 test/data/ovfdata/other/rawdisk.raw \
1339 test/data/ovfdata/ova.ova \
1340 test/data/ovfdata/rawdisk.raw \
1341 test/data/ovfdata/second_disk.vmdk \
1342 test/data/ovfdata/unsafe_path.ini \
1343 test/data/ovfdata/virtualbox.ovf \
1344 test/data/ovfdata/wrong_config.ini \
1345 test/data/ovfdata/wrong_extension.ovd \
1346 test/data/ovfdata/wrong_manifest.mf \
1347 test/data/ovfdata/wrong_manifest.ovf \
1348 test/data/ovfdata/wrong_ova.ova \
1349 test/data/ovfdata/wrong_xml.ovf \
1350 test/data/proc_diskstats.txt \
1351 test/data/proc_drbd8.txt \
1352 test/data/proc_drbd80-emptyline.txt \
1353 test/data/proc_drbd80-emptyversion.txt \
1354 test/data/proc_drbd83.txt \
1355 test/data/proc_drbd83_sync.txt \
1356 test/data/proc_drbd83_sync_want.txt \
1357 test/data/proc_drbd83_sync_krnl2.6.39.txt \
1358 test/data/proc_drbd84.txt \
1359 test/data/proc_drbd84_sync.txt \
1360 test/data/proc_meminfo.txt \
1361 test/data/proc_cpuinfo.txt \
1362 test/data/qa-minimal-nodes-instances-only.json \
1363 test/data/sys_drbd_usermode_helper.txt \
1364 test/data/vgreduce-removemissing-2.02.02.txt \
1365 test/data/vgreduce-removemissing-2.02.66-fail.txt \
1366 test/data/vgreduce-removemissing-2.02.66-ok.txt \
1367 test/data/vgs-missing-pvs-2.02.02.txt \
1368 test/data/vgs-missing-pvs-2.02.66.txt \
1369 test/data/xen-xm-info-4.0.1.txt \
1370 test/data/xen-xm-list-4.0.1-dom0-only.txt \
1371 test/data/xen-xm-list-4.0.1-four-instances.txt \
1372 test/data/xen-xm-list-long-4.0.1.txt \
1373 test/data/xen-xm-uptime-4.0.1.txt \
1374 test/py/ganeti-cli.test \
1375 test/py/gnt-cli.test \
1376 test/py/import-export_unittest-helper
1380 doc/examples/rapi_testutils.py \
1381 test/py/cmdlib/backup_unittest.py \
1382 test/py/cmdlib/cluster_unittest.py \
1383 test/py/cmdlib/cmdlib_unittest.py \
1384 test/py/cmdlib/group_unittest.py \
1385 test/py/cmdlib/instance_unittest.py \
1386 test/py/cmdlib/instance_migration_unittest.py \
1387 test/py/cmdlib/instance_query_unittest.py \
1388 test/py/cmdlib/instance_storage_unittest.py \
1389 test/py/cmdlib/node_unittest.py \
1390 test/py/cmdlib/test_unittest.py \
1391 test/py/cfgupgrade_unittest.py \
1392 test/py/docs_unittest.py \
1393 test/py/ganeti.asyncnotifier_unittest.py \
1394 test/py/ganeti.backend_unittest-runasroot.py \
1395 test/py/ganeti.backend_unittest.py \
1396 test/py/ganeti.bootstrap_unittest.py \
1397 test/py/ganeti.cli_unittest.py \
1398 test/py/ganeti.client.gnt_cluster_unittest.py \
1399 test/py/ganeti.client.gnt_instance_unittest.py \
1400 test/py/ganeti.client.gnt_job_unittest.py \
1401 test/py/ganeti.compat_unittest.py \
1402 test/py/ganeti.confd.client_unittest.py \
1403 test/py/ganeti.config_unittest.py \
1404 test/py/ganeti.constants_unittest.py \
1405 test/py/ganeti.daemon_unittest.py \
1406 test/py/ganeti.errors_unittest.py \
1407 test/py/ganeti.hooks_unittest.py \
1408 test/py/ganeti.ht_unittest.py \
1409 test/py/ganeti.http_unittest.py \
1410 test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1411 test/py/ganeti.hypervisor.hv_fake_unittest.py \
1412 test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1413 test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1414 test/py/ganeti.hypervisor.hv_xen_unittest.py \
1415 test/py/ganeti.hypervisor_unittest.py \
1416 test/py/ganeti.impexpd_unittest.py \
1417 test/py/ganeti.jqueue_unittest.py \
1418 test/py/ganeti.jstore_unittest.py \
1419 test/py/ganeti.locking_unittest.py \
1420 test/py/ganeti.luxi_unittest.py \
1421 test/py/ganeti.masterd.iallocator_unittest.py \
1422 test/py/ganeti.masterd.instance_unittest.py \
1423 test/py/ganeti.mcpu_unittest.py \
1424 test/py/ganeti.netutils_unittest.py \
1425 test/py/ganeti.objects_unittest.py \
1426 test/py/ganeti.opcodes_unittest.py \
1427 test/py/ganeti.outils_unittest.py \
1428 test/py/ganeti.ovf_unittest.py \
1429 test/py/ganeti.qlang_unittest.py \
1430 test/py/ganeti.query_unittest.py \
1431 test/py/ganeti.rapi.baserlib_unittest.py \
1432 test/py/ganeti.rapi.client_unittest.py \
1433 test/py/ganeti.rapi.resources_unittest.py \
1434 test/py/ganeti.rapi.rlib2_unittest.py \
1435 test/py/ganeti.rapi.testutils_unittest.py \
1436 test/py/ganeti.rpc_unittest.py \
1437 test/py/ganeti.runtime_unittest.py \
1438 test/py/ganeti.serializer_unittest.py \
1439 test/py/ganeti.server.rapi_unittest.py \
1440 test/py/ganeti.ssconf_unittest.py \
1441 test/py/ganeti.ssh_unittest.py \
1442 test/py/ganeti.storage.bdev_unittest.py \
1443 test/py/ganeti.storage.container_unittest.py \
1444 test/py/ganeti.storage.drbd_unittest.py \
1445 test/py/ganeti.storage.filestorage_unittest.py \
1446 test/py/ganeti.tools.burnin_unittest.py \
1447 test/py/ganeti.tools.ensure_dirs_unittest.py \
1448 test/py/ganeti.tools.node_daemon_setup_unittest.py \
1449 test/py/ganeti.tools.prepare_node_join_unittest.py \
1450 test/py/ganeti.uidpool_unittest.py \
1451 test/py/ganeti.utils.algo_unittest.py \
1452 test/py/ganeti.utils.filelock_unittest.py \
1453 test/py/ganeti.utils.hash_unittest.py \
1454 test/py/ganeti.utils.io_unittest-runasroot.py \
1455 test/py/ganeti.utils.io_unittest.py \
1456 test/py/ganeti.utils.log_unittest.py \
1457 test/py/ganeti.utils.lvm_unittest.py \
1458 test/py/ganeti.utils.mlock_unittest.py \
1459 test/py/ganeti.utils.nodesetup_unittest.py \
1460 test/py/ganeti.utils.process_unittest.py \
1461 test/py/ganeti.utils.retry_unittest.py \
1462 test/py/ganeti.utils.storage_unittest.py \
1463 test/py/ganeti.utils.text_unittest.py \
1464 test/py/ganeti.utils.version_unittest.py \
1465 test/py/ganeti.utils.wrapper_unittest.py \
1466 test/py/ganeti.utils.x509_unittest.py \
1467 test/py/ganeti.utils_unittest.py \
1468 test/py/ganeti.vcluster_unittest.py \
1469 test/py/ganeti.workerpool_unittest.py \
1470 test/py/pycurl_reset_unittest.py \
1471 test/py/qa.qa_config_unittest.py \
1472 test/py/tempfile_fork_unittest.py
1474 python_test_support = \
1475 test/py/__init__.py \
1476 test/py/lockperf.py \
1477 test/py/testutils.py \
1479 test/py/cmdlib/__init__.py \
1480 test/py/cmdlib/testsupport/__init__.py \
1481 test/py/cmdlib/testsupport/cmdlib_testcase.py \
1482 test/py/cmdlib/testsupport/config_mock.py \
1483 test/py/cmdlib/testsupport/iallocator_mock.py \
1484 test/py/cmdlib/testsupport/lock_manager_mock.py \
1485 test/py/cmdlib/testsupport/netutils_mock.py \
1486 test/py/cmdlib/testsupport/processor_mock.py \
1487 test/py/cmdlib/testsupport/rpc_runner_mock.py \
1488 test/py/cmdlib/testsupport/ssh_mock.py \
1489 test/py/cmdlib/testsupport/utils_mock.py \
1490 test/py/cmdlib/testsupport/util.py
1492 haskell_tests = test/hs/htest
1495 test/py/check-cert-expired_unittest.bash \
1496 test/py/daemon-util_unittest.bash \
1497 test/py/ganeti-cleaner_unittest.bash \
1498 test/py/import-export_unittest.bash \
1499 test/py/cli-test.bash \
1500 test/py/bash_completion.bash
1503 dist_TESTS += $(python_tests)
1510 nodist_TESTS += $(haskell_tests)
1511 dist_TESTS += test/hs/offline-test.sh
1513 test/hs/hpc-htools \
1514 test/hs/hpc-mon-collector \
1515 $(HS_BUILT_TEST_HELPERS)
1518 TESTS = $(dist_TESTS) $(nodist_TESTS)
1520 # Environment for all tests
1521 PLAIN_TESTS_ENVIRONMENT = \
1522 PYTHONPATH=.:./test/py \
1523 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1524 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1527 # Environment for tests run by automake
1528 TESTS_ENVIRONMENT = \
1529 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1532 $(dist_sbin_SCRIPTS) \
1534 $(pkglib_python_scripts) \
1535 $(nodist_pkglib_python_scripts) \
1536 $(nodist_tools_python_scripts) \
1537 $(pkgpython_PYTHON) \
1540 $(hypervisor_PYTHON) \
1555 all_python_code += $(python_tests)
1556 all_python_code += $(python_test_support)
1561 test/py/check-cert-expired_unittest.bash \
1562 test/py/daemon-util_unittest.bash \
1563 test/py/ganeti-cleaner_unittest.bash \
1564 test/py/import-export_unittest.bash \
1565 test/py/cli-test.bash \
1566 test/py/bash_completion.bash \
1567 test/hs/offline-test.sh \
1568 test/hs/cli-tests-defs.sh \
1569 $(all_python_code) \
1570 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1573 check_python_code = \
1574 $(BUILD_BASH_COMPLETION) \
1580 lint_python_code = \
1582 ganeti/http/server.py \
1583 $(dist_sbin_SCRIPTS) \
1585 $(pkglib_python_scripts) \
1586 $(BUILD_BASH_COMPLETION) \
1590 $(gnt_python_sbin_SCRIPTS) \
1593 standalone_python_modules = \
1594 lib/rapi/client.py \
1595 tools/ganeti-listrunner
1597 pep8_python_code = \
1599 ganeti/http/server.py \
1600 $(dist_sbin_SCRIPTS) \
1602 $(pkglib_python_scripts) \
1603 $(BUILD_BASH_COMPLETION) \
1606 $(PYTHON_BOOTSTRAP) \
1607 $(gnt_python_sbin_SCRIPTS) \
1609 $(python_test_support)
1611 test/py/daemon-util_unittest.bash: daemons/daemon-util
1613 test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1615 test/py/bash_completion.bash: doc/examples/bash_completion-debug
1617 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1618 sed -f $(REPLACE_VARS_SED) < $< > $@
1621 tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
1622 sed -f $(REPLACE_VARS_SED) < $< > $@
1625 tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
1626 sed -f $(REPLACE_VARS_SED) < $< > $@
1629 tools/users-setup: Makefile $(userspecs)
1631 { echo '#!/bin/sh'; \
1632 echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
1633 echo 'then echo "This will do the following changes"'; \
1634 $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
1635 END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \
1636 $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \
1637 else {print "echo + Will add user",$$1}; count++}\
1638 END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \
1639 $(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \
1641 echo 'echo "OK? (y/n)"'; \
1642 echo 'read confirm'; \
1643 echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
1645 $(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
1646 $(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
1647 $(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
1651 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1652 sed -f $(REPLACE_VARS_SED) < $< > $@
1655 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1656 sed -f $(REPLACE_VARS_SED) < $< > $@
1659 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1660 sed -f $(REPLACE_VARS_SED) < $< > $@
1662 doc/examples/bash_completion: BC_ARGS = --compact
1663 doc/examples/bash_completion-debug: BC_ARGS =
1665 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1666 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1667 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1668 daemons/ganeti-cleaner \
1669 $(GENERATED_FILES) $(HS_GENERATED_FILES)
1670 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1671 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1673 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1674 lib/build/shell_example_lexer.py \
1675 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1676 @echo "Checking $< for hardcoded paths..."
1677 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1678 echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1682 trap 'echo auto-removing $@; rm $@' EXIT; \
1683 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1684 $(CHECK_MAN_REFERENCES) $@; \
1687 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1688 @test -n "$(PANDOC)" || \
1689 { echo 'pandoc' not found during configure; exit 1; }
1690 set -o pipefail -e; \
1691 trap 'echo auto-removing $@; rm $@' EXIT; \
1692 $(PANDOC) -s -f rst -t man $< man/footer.rst | \
1693 sed -e 's/\\@/@/g' > $@; \
1694 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1695 $(CHECK_MAN_DASHES) $@; \
1698 man/%.html.in: man/%.gen man/footer.rst
1699 @test -n "$(PANDOC)" || \
1700 { echo 'pandoc' not found during configure; exit 1; }
1702 $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1703 sed -e 's/\\@/@/g' > $@
1705 man/%: man/%.in $(REPLACE_VARS_SED)
1706 sed -f $(REPLACE_VARS_SED) < $< > $@
1708 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1709 sed -f $(REPLACE_VARS_SED) < $< > $@
1712 if test -d .git; then \
1713 git describe > $@; \
1714 elif test ! -f $@ ; then \
1715 echo "Cannot auto-generate $@ file"; exit 1; \
1718 .PHONY: clean-vcs-version
1722 .PHONY: regen-vcs-version
1726 if test -d .git; then \
1727 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1728 git describe > $$T; \
1729 if ! cmp --quiet $$T vcs-version; then \
1730 mv $$T vcs-version; \
1734 src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1735 vcs-version $(built_base_sources)
1737 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1738 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1740 src/Ganeti/Hs2Py/ListConstants.hs: src/Ganeti/Hs2Py/ListConstants.hs.in \
1741 src/Ganeti/HsConstants.hs \
1745 ## Extract constant names from 'HsConstants.hs' by extracting the left
1746 ## side of all lines containing an equal sign (i.e., '=') and
1747 ## prepending the apostrophe sign (i.e., "'").
1749 ## For example, the constant
1750 ## adminstDown = ...
1753 NAMES=$$(sed -e "/^--/ d" $(abs_top_srcdir)/src/Ganeti/HsConstants.hs |\
1754 sed -n -e "/=/ s/\(.*\) =.*/ '\1:/g p"); \
1755 m4 -DPY_CONSTANT_NAMES="$$NAMES" $(abs_top_srcdir)/$< > $@
1757 src/Ganeti/PyConstants.hs: src/Ganeti/PyConstants.hs.in \
1758 lib/constants.py lib/luxi.py lib/errors.py \
1759 lib/jstore.py $(RUN_IN_TEMPDIR) \
1760 $(CONVERT_CONSTANTS) $(built_base_sources) \
1761 | lib/_vcsversion.py
1764 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
1767 src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
1770 test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1771 $(built_base_sources)
1775 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1776 echo "import $$name ()" ; \
1780 lib/_constants.py: Makefile lib/_constants.py.in src/hs2py-constants \
1782 cat $(abs_top_srcdir)/lib/_constants.py.in > $@
1783 src/hs2py-constants >> $@
1785 lib/constants.py: lib/_constants.py
1787 src/AutoConf.hs: Makefile src/AutoConf.hs.in | stamp-directories
1789 @m4 -DPACKAGE_VERSION="$(PACKAGE_VERSION)" \
1790 -DVERSION_MAJOR="$(VERSION_MAJOR)" \
1791 -DVERSION_MINOR="$(VERSION_MINOR)" \
1792 -DVERSION_REVISION="$(VERSION_REVISION)" \
1793 -DVERSION_SUFFIX="$(VERSION_SUFFIX)" \
1794 -DVERSION_FULL="$(VERSION_FULL)" \
1795 -DDIRVERSION="$(DIRVERSION)" \
1796 -DLOCALSTATEDIR="$(localstatedir)" \
1797 -DSYSCONFDIR="$(sysconfdir)" \
1798 -DSSH_CONFIG_DIR="$(SSH_CONFIG_DIR)" \
1799 -DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \
1800 -DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \
1801 -DEXPORT_DIR="$(EXPORT_DIR)" \
1802 -DOS_SEARCH_PATH="\"$(OS_SEARCH_PATH)\"" \
1803 -DES_SEARCH_PATH="\"$(ES_SEARCH_PATH)\"" \
1804 -DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \
1805 -DXEN_CONFIG_DIR="$(XEN_CONFIG_DIR)" \
1806 -DXEN_KERNEL="$(XEN_KERNEL)" \
1807 -DXEN_INITRD="$(XEN_INITRD)" \
1808 -DKVM_KERNEL="$(KVM_KERNEL)" \
1809 -DSHARED_FILE_STORAGE_DIR="$(SHARED_FILE_STORAGE_DIR)" \
1810 -DIALLOCATOR_SEARCH_PATH="\"$(IALLOCATOR_SEARCH_PATH)\"" \
1811 -DKVM_PATH="$(KVM_PATH)" \
1812 -DIP_PATH="$(IP_PATH)" \
1813 -DSOCAT_PATH="$(SOCAT)" \
1814 -DSOCAT_USE_ESCAPE="$(SOCAT_USE_ESCAPE)" \
1815 -DSOCAT_USE_COMPRESS="$(SOCAT_USE_COMPRESS)" \
1816 -DLVM_STRIPECOUNT="$(LVM_STRIPECOUNT)" \
1817 -DTOOLSDIR="$(libdir)/ganeti/tools" \
1818 -DGNT_SCRIPTS="$(foreach i,$(notdir $(gnt_scripts)),\"$(i)\":)" \
1819 -DHS_HTOOLS_PROGS="$(foreach i,$(HS_HTOOLS_PROGS),\"$(i)\":)" \
1820 -DPKGLIBDIR="$(libdir)/ganeti" \
1821 -DSHAREDIR="$(prefix)/share/ganeti" \
1822 -DVERSIONEDSHAREDIR="$(versionedsharedir)" \
1823 -DDRBD_BARRIERS="$(DRBD_BARRIERS)" \
1824 -DDRBD_NO_META_FLUSH="$(DRBD_NO_META_FLUSH)" \
1825 -DSYSLOG_USAGE="$(SYSLOG_USAGE)" \
1826 -DDAEMONS_GROUP="$(DAEMONS_GROUP)" \
1827 -DADMIN_GROUP="$(ADMIN_GROUP)" \
1828 -DMASTERD_USER="$(MASTERD_USER)" \
1829 -DMASTERD_GROUP="$(MASTERD_GROUP)" \
1830 -DRAPI_USER="$(RAPI_USER)" \
1831 -DRAPI_GROUP="$(RAPI_GROUP)" \
1832 -DCONFD_USER="$(CONFD_USER)" \
1833 -DCONFD_GROUP="$(CONFD_GROUP)" \
1834 -DLUXID_USER="$(LUXID_USER)" \
1835 -DLUXID_GROUP="$(LUXID_GROUP)" \
1836 -DNODED_USER="$(NODED_USER)" \
1837 -DNODED_GROUP="$(NODED_GROUP)" \
1838 -DMOND_USER="$(MOND_USER)" \
1839 -DMOND_GROUP="$(MOND_GROUP)" \
1840 -DDISK_SEPARATOR="$(DISK_SEPARATOR)" \
1841 -DQEMUIMG_PATH="$(QEMUIMG_PATH)" \
1843 -DENABLE_CONFD="$(ENABLE_CONFD)" \
1844 -DXEN_CMD="$(XEN_CMD)" \
1845 -DENABLE_SPLIT_QUERY="$(ENABLE_SPLIT_QUERY)" \
1846 -DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
1847 -DENABLE_MOND="$(ENABLE_MOND)" \
1848 -DHAS_GNU_LN="$(HAS_GNU_LN)" \
1849 -DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \
1850 echo -n "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/("\1",\2):/g'; \
1852 $(abs_top_srcdir)/src/AutoConf.hs.in > $@
1854 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1856 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1857 { echo '# This file is automatically generated, do not edit!'; \
1860 echo '"""Build-time VCS version number for Ganeti.'; \
1862 echo 'This file is autogenerated by the build process.'; \
1863 echo 'For any changes you need to re-run ./configure (and'; \
1864 echo 'not edit by hand).'; \
1868 echo '# pylint: disable=C0301,C0324'; \
1869 echo '# because this is autogenerated, we do not want'; \
1870 echo '# style warnings' ; \
1872 echo "VCS_VERSION = '$$VCSVER'"; \
1875 lib/opcodes.py: Makefile src/hs2py src/Ganeti/PyConstants.hs \
1876 lib/opcodes.py.in_before lib/opcodes.py.in_after \
1878 cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
1880 cat $(abs_top_srcdir)/lib/opcodes.py.in_after >> $@
1882 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1883 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1885 $(SHELL_ENV_INIT): Makefile stamp-directories
1887 { echo '# Allow overriding for tests'; \
1888 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1889 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1891 echo 'readonly PKGLIBDIR=$(libdir)/ganeti'; \
1892 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1893 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1894 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1895 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1898 ## Writes sed script to replace placeholders with build-time values. The
1899 ## additional quotes after the first @ sign are necessary to stop configure
1900 ## from replacing those values as well.
1901 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1903 { echo 's#@''PREFIX@#$(prefix)#g'; \
1904 echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1905 echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1906 echo 's#@''BINDIR@#$(execprefix)/bin#g'; \
1907 echo 's#@''SBINDIR@#$(execprefix)/sbin#g'; \
1908 echo 's#@''LIBDIR@#$(libdir)#g'; \
1909 echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1910 echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1911 echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1912 echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1913 echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1914 echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1915 echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1916 echo 's#@''PKGLIBDIR@#$(libdir)/ganeti#g'; \
1917 echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1918 echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1919 echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1920 echo 's#@''GNTLUXIDUSER@#$(LUXID_USER)#g'; \
1921 echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1922 echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
1923 echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1924 echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1925 echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1926 echo 's#@''GNTLUXIDGROUP@#$(LUXID_GROUP)#g'; \
1927 echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1928 echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
1929 echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1930 echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1931 echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
1932 echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1933 echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1935 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1936 echo ' r $(SHELL_ENV_INIT)'; \
1941 # Using deferred evaluation
1942 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1943 daemons/ganeti-watcher: MODULE = ganeti.watcher
1944 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1945 tools/burnin: MODULE = ganeti.tools.burnin
1946 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1947 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1948 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1949 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1950 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1952 $(PYTHON_BOOTSTRAP) $(gnt_scripts) $(gnt_python_sbin_SCRIPTS): Makefile | stamp-directories
1953 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1955 { echo '#!/usr/bin/python'; \
1956 echo '# This file is automatically generated, do not edit!'; \
1957 echo "# Edit $(MODULE) instead."; \
1959 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1961 echo '# pylint: disable=C0103'; \
1962 echo '# C0103: Invalid name'; \
1964 echo 'import sys'; \
1965 echo 'import $(MODULE) as main'; \
1967 echo '# Temporarily alias commands until bash completion'; \
1968 echo '# generator is changed'; \
1969 echo 'if hasattr(main, "commands"):'; \
1970 echo ' commands = main.commands # pylint: disable=E1101'; \
1971 echo 'if hasattr(main, "aliases"):'; \
1972 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1974 echo 'if __name__ == "__main__":'; \
1975 echo ' sys.exit(main.Main())'; \
1979 $(HS_BUILT_TEST_HELPERS): Makefile
1980 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1982 { echo '#!/bin/sh'; \
1983 echo '# This file is automatically generated, do not edit!'; \
1984 echo "# Edit Makefile.am instead."; \
1986 echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
1990 stamp-directories: Makefile
1991 $(MAKE) $(AM_MAKEFLAGS) ganeti
1992 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1995 # We need to create symlinks because "make distcheck" will not install Python
1996 # files when building.
1997 stamp-srclinks: Makefile | stamp-directories
1999 for i in $(srclink_files); do \
2000 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
2001 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
2008 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
2011 check-dirs: $(GENERATED_FILES)
2013 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
2015 while read dir; do \
2017 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
2018 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
2021 for dir in $(DIRS); do \
2022 if ! test -d "$$dir"; then \
2023 echo "Directory $$dir listed in DIRS does not exist" >&2; \
2027 test -z "$$error"; \
2032 RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
2035 check-local: check-dirs check-news $(GENERATED_FILES)
2036 $(CHECK_PYTHON_CODE) $(check_python_code)
2037 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
2038 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
2039 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
2041 if [ "x`echo $(VERSION_SUFFIX)|grep 'alpha'`" == "x" ]; then \
2042 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
2043 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
2044 echo "Incorrect version in README, expected $$expver" >&2; \
2047 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
2048 doc/security.rst; do \
2049 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
2050 "Documents Ganeti version $$expver"; then \
2051 echo "Incorrect version in $$file, expected $$expver" >&2; \
2055 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
2056 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
2059 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
2060 ".. Last updated for Ganeti $$expver"; then \
2061 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
2065 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
2066 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
2067 echo "Longest line in $$file is longer than 80 characters" >&2; \
2074 hs-test-%: test/hs/htest | $(BUILT_PYTHON_SOURCES)
2079 hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
2084 hs-shell-%: test/hs/hpc-htools test/hs/hpc-mon-collector \
2085 $(HS_BUILT_TEST_HELPERS)
2086 @rm -f hpc-htools.tix hpc-mon-collector.tix
2087 HBINARY="./test/hs/hpc-htools" \
2088 SHELLTESTARGS=$(SHELLTESTARGS) \
2089 ./test/hs/offline-test.sh $*
2092 hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
2093 @rm -f hpc-htools.tix hpc-mon-collector.tix
2094 HBINARY="./test/hs/hpc-htools" \
2095 SHELLTESTARGS=$(SHELLTESTARGS) \
2096 ./test/hs/offline-test.sh
2099 hs-check: hs-tests hs-shell
2101 # E111: indentation is not a multiple of four
2102 # E121: continuation line indentation is not a multiple of four
2103 # (since our indent level is not 4)
2104 # E125: continuation line does not distinguish itself from next logical line
2105 # (since our indent level is not 4)
2106 # E123: closing bracket does not match indentation of opening bracket's line
2107 # E127: continuation line over-indented for visual indent
2108 # (since our indent level is not 4)
2109 # note: do NOT add E128 here; it's a valid style error in most cases!
2110 # I've seen real errors, but also some cases were we indent wrongly
2111 # due to line length; try to rework the cases where it is triggered,
2112 # instead of silencing it
2113 # E261: at least two spaces before inline comment
2114 # E501: line too long (80 characters)
2115 PEP8_IGNORE = E111,E121,E123,E125,E127,E261,E501
2117 # For excluding pep8 expects filenames only, not whole paths
2118 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
2120 LINT_TARGETS = pylint pylint-qa pylint-test
2122 LINT_TARGETS += pep8
2125 LINT_TARGETS += hlint
2129 lint: $(LINT_TARGETS)
2132 pylint: $(GENERATED_FILES)
2133 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2134 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
2137 pylint-qa: $(GENERATED_FILES)
2138 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2139 cd $(top_srcdir)/qa && \
2140 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
2141 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
2142 # FIXME: lint all test code, not just the newly added test support
2143 pylint-test: $(GENERATED_FILES)
2144 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2145 cd $(top_srcdir) && \
2146 PYTHONPATH=.:./test/py $(PYLINT) $(LINT_OPTS) \
2147 --rcfile=pylintrc-test $(python_test_support)
2150 pep8: $(GENERATED_FILES)
2151 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
2152 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
2153 --repeat $(pep8_python_code)
2155 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
2156 HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
2158 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
2159 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
2160 @rm -f doc/hs-lint.html
2161 if tty -s; then C="-c"; else C=""; fi; \
2162 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
2163 --ignore "Use first" \
2164 --ignore "Use &&&" \
2165 --ignore "Use void" \
2166 --ignore "Reduce duplication" \
2167 --hint src/lint-hints \
2168 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
2169 @if [ ! -f doc/hs-lint.html ]; then \
2170 echo "All good" > doc/hs-lint.html; \
2173 # a dist hook rule for updating the vcs-version file; this is
2174 # hardcoded due to where it needs to build the file...
2176 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
2177 rm -f $(top_distdir)/vcs-version
2178 cp -p $(srcdir)/vcs-version $(top_distdir)
2180 # a distcheck hook rule for catching revision control directories
2182 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
2183 echo "Found revision control files in final archive." 1>&2; \
2186 if find $(top_distdir) -name '*.py[co]' | grep .; then \
2187 echo "Found Python byte code in final archive." 1>&2; \
2190 if find $(top_distdir) -name '*~' | grep .; then \
2191 echo "Found backup files in final archive." 1>&2; \
2194 # Empty files or directories should not be distributed. They can cause
2195 # unnecessary warnings for packagers. Directories used by automake during
2196 # distcheck must be excluded.
2197 if find $(top_distdir) -empty -and -not \( \
2198 -path $(top_distdir)/_build -or \
2199 -path $(top_distdir)/_inst \) | grep .; then \
2200 echo "Found empty files or directories in final archive." 1>&2; \
2203 if test -e $(top_distdir)/doc/man-html; then \
2204 echo "Found documentation including man pages in final archive" >&2; \
2208 # Backwards compatible distcheck-release target
2209 distcheck-release: distcheck
2211 distrebuildcheck: dist
2213 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
2214 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
2216 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
2219 $(MAKE) maintainer-clean; \
2220 cp $(abs_srcdir)/vcs-version .; \
2222 $(MAKE) $(AM_MAKEFLAGS)
2226 for i in $(DIST_ARCHIVES); do \
2227 echo -n "Checking $$i ... "; \
2228 autotools/check-tar < $$i; \
2233 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
2234 "$(DESTDIR)${localstatedir}/log/ganeti" \
2235 "$(DESTDIR)${localstatedir}/run/ganeti"
2236 for dir in $(SYMLINK_TARGET_DIRS); do \
2237 @mkdir_p@ $(DESTDIR)$$dir; \
2239 $(LN_S) -f $(sysconfdir)/ganeti/lib $(DESTDIR)$(defaultversiondir)
2240 $(LN_S) -f $(sysconfdir)/ganeti/share $(DESTDIR)$(defaultversionedsharedir)
2241 for prog in $(HS_BIN_ROLES); do \
2242 $(LN_S) -f $(defaultversiondir)$(exec_prefix)/bin/$$prog $(DESTDIR)$(exec_prefix)/bin/$$prog; \
2244 $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
2245 for prog in $(all_sbin_scripts); do \
2246 $(LN_S) -f $(defaultversiondir)$(exec_prefix)/sbin/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
2248 for prog in $(gnt_scripts_basenames); do \
2249 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
2251 for prog in $(pkglib_python_basenames); do \
2252 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2254 for prog in $(tools_python_basenames); do \
2255 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2257 for prog in $(tools_basenames); do \
2258 $(LN_S) -f $(defaultversiondir)/$(libdir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2260 if ! test -n '$(ENABLE_MANPAGES)'; then \
2261 for man in $(manfullpath); do \
2262 $(LN_S) -f $(defaultversionedsharedir)$(datarootdir)/man/$$man $(DESTDIR)$(datarootdir)/man/$$man; \
2265 for prog in $(myexeclib_scripts_basenames); do \
2266 $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2269 $(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share
2270 $(LN_S) -f $(versiondir) $(DESTDIR)$(sysconfdir)/ganeti/lib
2275 apidoc: py-apidoc hs-apidoc
2281 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
2282 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
2283 $(RUN_IN_TEMPDIR) epydoc -v \
2284 --conf $(CURDIR)/epydoc.conf \
2285 --output $(CURDIR)/$(APIDOC_PY_DIR)
2288 hs-apidoc: $(APIDOC_HS_DIR)/index.html
2290 $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
2291 @test -n "$(HSCOLOUR)" || \
2292 { echo 'HsColour' not found during configure; exit 1; }
2293 @test -n "$(HADDOCK)" || \
2294 { echo 'haddock' not found during configure; exit 1; }
2295 rm -rf $(APIDOC_HS_DIR)/*
2296 for i in $(ALL_APIDOC_HS_DIRS); do \
2298 $(HSCOLOUR) -print-css > $$i/hscolour.css; \
2301 export LC_ALL=en_US.UTF-8; \
2302 OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
2303 if [ "$(HS_PARALLEL3)" ]; \
2304 then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
2306 if [ "$(HS_REGEX_PCRE)" ]; \
2307 then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
2309 for file in $(HS_LIBTESTBUILT_SRCS); do \
2310 f_nosrc=$${file##src/}; \
2311 f_notst=$${f_nosrc##test/hs/}; \
2312 f_html=$${f_notst%%.hs}.html; \
2313 $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
2315 $(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
2316 -t ganeti -p src/haddock-prologue \
2317 --source-module="%{MODULE/.//}.html" \
2318 --source-entity="%{MODULE/.//}.html#%{NAME}" \
2320 $(HS_LIBTESTBUILT_SRCS)
2323 TAGS: $(GENERATED_FILES)
2325 $(GHC) -e ":etags" -v0 \
2326 $(filter-out -O -Werror,$(HFLAGS)) \
2327 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
2329 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
2330 -path './daemons/ganeti-*' -o -path './tools/*' -o \
2331 -path './qa/*.py' | \
2332 etags -l python -a -
2338 COVERAGE_TESTS += hs-coverage
2341 COVERAGE_TESTS += py-coverage
2344 coverage: $(COVERAGE_TESTS)
2347 py-coverage: $(GENERATED_FILES) $(python_tests)
2348 @test -n "$(PYCOVERAGE)" || \
2349 { echo 'python-coverage' not found during configure; exit 1; }
2351 COVERAGE=$(PYCOVERAGE) \
2352 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2353 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2354 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2355 $(PLAIN_TESTS_ENVIRONMENT) \
2356 $(abs_top_srcdir)/autotools/gen-py-coverage \
2360 hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2362 $(MAKE) $(AM_MAKEFLAGS) hs-check
2363 @mkdir_p@ $(COVERAGE_HS_DIR)
2364 hpc sum --union $(HPCEXCL) \
2365 htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2366 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2367 hpc report coverage-hs.tix | tee $(COVERAGE_HS_DIR)/report.txt
2368 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2370 # Special "kind-of-QA" target for htools, needs special setup (all
2371 # tools compiled with -fhpc)
2376 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2377 rm -f *.tix *.mix; \
2379 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2380 --output=live-test.tix ; \
2381 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2382 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2383 --srcdir=.. $(HPCEXCL) ; \
2384 hpc report --srcdir=.. live-test $(HPCEXCL)
2386 commit-check: autotools-check distcheck lint apidoc
2389 TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
2390 $(abs_top_srcdir)/test/autotools/*-*.test \
2393 .PHONY: gitignore-check
2395 @if [ -n "`git status --short`" ]; then \
2396 echo "Git status is not clean!" 1>&2 ; \
2397 git status --short; \
2401 # target to rebuild all man pages (both groff and html output)
2403 man: $(man_MANS) $(manhtml)
2405 # Target that builds all binaries (including those that are not
2406 # rebuilt except when running the tests)
2408 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2410 # we don't need the ancient implicit rules:
2417 -include ./Makefile.local