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 # Use bash in order to be able to use pipefail
20 ACLOCAL_AMFLAGS = -I autotools
21 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
22 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
23 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
24 CHECK_HEADER = $(top_srcdir)/autotools/check-header
25 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
26 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
27 CHECK_VERSION = $(top_srcdir)/autotools/check-version
28 CHECK_NEWS = $(top_srcdir)/autotools/check-news
29 CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
30 DOCPP = $(top_srcdir)/autotools/docpp
31 REPLACE_VARS_SED = autotools/replace_vars.sed
32 CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
33 BUILD_RPC = $(top_srcdir)/autotools/build-rpc
34 SHELL_ENV_INIT = autotools/shell-env-init
36 # Note: these are automake-specific variables, and must be named after
37 # the directory + 'dir' suffix
38 clientdir = $(pkgpythondir)/client
39 hypervisordir = $(pkgpythondir)/hypervisor
40 httpdir = $(pkgpythondir)/http
41 masterddir = $(pkgpythondir)/masterd
42 confddir = $(pkgpythondir)/confd
43 rapidir = $(pkgpythondir)/rapi
44 serverdir = $(pkgpythondir)/server
45 watcherdir = $(pkgpythondir)/watcher
46 impexpddir = $(pkgpythondir)/impexpd
47 utilsdir = $(pkgpythondir)/utils
48 toolsdir = $(pkglibdir)/tools
49 iallocatorsdir = $(pkglibdir)/iallocators
50 pytoolsdir = $(pkgpythondir)/tools
51 docdir = $(datadir)/doc/$(PACKAGE)
52 myexeclibdir = $(pkglibdir)
54 # Delete output file if an error occurred while building it
61 htools/Ganeti/Block/Drbd \
63 htools/Ganeti/HTools \
64 htools/Ganeti/HTools/Backend \
65 htools/Ganeti/HTools/Program \
70 htest/Test/Ganeti/Block \
71 htest/Test/Ganeti/Block/Drbd \
72 htest/Test/Ganeti/Confd \
73 htest/Test/Ganeti/HTools \
74 htest/Test/Ganeti/HTools/Backend \
75 htest/Test/Ganeti/Query
84 doc/examples/gnt-debug \
107 test/data/ovfdata/other \
110 BUILDTIME_DIR_AUTOCREATE = \
114 $(APIDOC_HS_DIR)/Ganeti \
115 $(APIDOC_HS_DIR)/Ganeti/Block \
116 $(APIDOC_HS_DIR)/Ganeti/Block/Drbd \
117 $(APIDOC_HS_DIR)/Ganeti/Confd \
118 $(APIDOC_HS_DIR)/Ganeti/HTools \
119 $(APIDOC_HS_DIR)/Ganeti/HTools/Backend \
120 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
121 $(APIDOC_HS_DIR)/Ganeti/Query \
129 $(BUILDTIME_DIR_AUTOCREATE) \
134 ganeti-[0-9]*.[0-9]*.[0-9]* \
138 COVERAGE_DIR = doc/coverage
139 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
140 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
142 APIDOC_PY_DIR = $(APIDOC_DIR)/py
143 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
145 MAINTAINERCLEANFILES = \
148 doc/install-quick.rst \
153 maintainer-clean-local:
154 rm -rf $(BUILDTIME_DIRS)
157 $(addsuffix /*.py[co],$(DIRS)) \
158 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
159 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
160 $(PYTHON_BOOTSTRAP) \
162 $(REPLACE_VARS_SED) \
164 daemons/daemon-util \
165 daemons/ganeti-cleaner \
167 doc/examples/bash_completion \
168 doc/examples/bash_completion-debug \
169 lib/_generated_rpc.py \
173 tools/vcluster-setup \
176 $(nodist_pkgpython_PYTHON) \
177 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
178 $(HS_BUILT_TEST_HELPERS) \
179 htools/ganeti-confd \
180 .hpc/*.mix htools/*.tix htest/*.tix \
184 $(built_base_sources) \
185 $(BUILT_PYTHON_SOURCES) \
188 HTOOLS_GENERATED_FILES =
190 HTOOLS_GENERATED_FILES += $(HS_PROGS)
192 HTOOLS_GENERATED_FILES += htools/hconfd htools/ganeti-confd
196 built_base_sources = \
200 built_python_base_sources = \
204 BUILT_PYTHON_SOURCES = \
205 $(built_python_base_sources) \
206 lib/_generated_rpc.py
208 # Generating the RPC wrappers depends on many things, so make sure
209 # it's built at the end of the built sources
210 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
212 # these are all built from the underlying %.in sources
214 doc/examples/ganeti-kvm-poweroff.initd \
215 doc/examples/ganeti.cron \
216 doc/examples/ganeti.initd \
217 doc/examples/ganeti-master-role.ocf \
218 doc/examples/ganeti-node-role.ocf \
219 doc/examples/gnt-config-backup \
220 doc/examples/hooks/ipsec
222 nodist_pkgpython_PYTHON = \
223 $(BUILT_PYTHON_SOURCES)
226 lib/build/__init__.py \
227 lib/build/shell_example_lexer.py \
228 lib/build/sphinx_ext.py
232 lib/asyncnotifier.py \
270 lib/client/__init__.py \
271 lib/client/gnt_backup.py \
272 lib/client/gnt_cluster.py \
273 lib/client/gnt_debug.py \
274 lib/client/gnt_group.py \
275 lib/client/gnt_instance.py \
276 lib/client/gnt_job.py \
277 lib/client/gnt_node.py \
278 lib/client/gnt_network.py \
281 hypervisor_PYTHON = \
282 lib/hypervisor/__init__.py \
283 lib/hypervisor/hv_base.py \
284 lib/hypervisor/hv_chroot.py \
285 lib/hypervisor/hv_fake.py \
286 lib/hypervisor/hv_kvm.py \
287 lib/hypervisor/hv_lxc.py \
288 lib/hypervisor/hv_xen.py
291 lib/rapi/__init__.py \
292 lib/rapi/baserlib.py \
294 lib/rapi/client_utils.py \
295 lib/rapi/connector.py \
297 lib/rapi/testutils.py
300 lib/http/__init__.py \
306 lib/confd/__init__.py \
310 lib/masterd/__init__.py \
311 lib/masterd/iallocator.py \
312 lib/masterd/instance.py
315 lib/impexpd/__init__.py
318 lib/watcher/__init__.py \
319 lib/watcher/nodemaint.py \
323 lib/server/__init__.py \
324 lib/server/masterd.py \
325 lib/server/noded.py \
329 lib/tools/__init__.py \
330 lib/tools/ensure_dirs.py \
331 lib/tools/prepare_node_join.py
334 lib/utils/__init__.py \
336 lib/utils/filelock.py \
341 lib/utils/nodesetup.py \
342 lib/utils/process.py \
345 lib/utils/wrapper.py \
350 doc/cluster-merge.rst \
359 doc/design-autorepair.rst \
360 doc/design-bulk-create.rst \
361 doc/design-chained-jobs.rst \
362 doc/design-cpu-pinning.rst \
363 doc/design-draft.rst \
364 doc/design-htools-2.3.rst \
365 doc/design-http-server.rst \
366 doc/design-impexp2.rst \
367 doc/design-lu-generated-jobs.rst \
368 doc/design-linuxha.rst \
369 doc/design-multi-reloc.rst \
370 doc/design-network.rst \
371 doc/design-node-add.rst \
373 doc/design-ovf-support.rst \
374 doc/design-opportunistic-locking.rst \
375 doc/design-partitioned.rst \
376 doc/design-query-splitting.rst \
377 doc/design-query2.rst \
378 doc/design-remote-commands.rst \
379 doc/design-resource-model.rst \
380 doc/design-shared-storage.rst \
381 doc/design-monitoring-agent.rst \
382 doc/design-virtual-clusters.rst \
383 doc/design-x509-ca.rst \
389 doc/install-quick.rst \
392 doc/move-instance.rst \
394 doc/ovfconverter.rst \
398 doc/virtual-cluster.rst \
401 HS_PROGS = htools/htools
402 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
403 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
412 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
413 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
416 -O -Wall -Werror -ihtools \
417 -fwarn-monomorphism-restriction \
419 $(GHC_BYVERSION_FLAGS)
421 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
423 # internal extra flags (used for htest/test mainly)
425 # exclude options for coverage reports
426 HPCEXCL = --exclude Main \
427 --exclude Ganeti.Constants \
428 --exclude Ganeti.HTools.QC \
429 --exclude Ganeti.THH \
430 --exclude Ganeti.Version \
431 --exclude Test.Ganeti.Attoparsec \
432 --exclude Test.Ganeti.TestCommon \
433 --exclude Test.Ganeti.TestHTools \
434 --exclude Test.Ganeti.TestHelper \
435 --exclude Test.Ganeti.TestImports \
436 $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
439 htools/Ganeti/Block/Drbd/Types.hs \
440 htools/Ganeti/Block/Drbd/Parser.hs \
441 htools/Ganeti/BasicTypes.hs \
442 htools/Ganeti/Common.hs \
443 htools/Ganeti/Compat.hs \
444 htools/Ganeti/Confd/Server.hs \
445 htools/Ganeti/Confd/Types.hs \
446 htools/Ganeti/Confd/Utils.hs \
447 htools/Ganeti/Config.hs \
448 htools/Ganeti/Daemon.hs \
449 htools/Ganeti/Errors.hs \
450 htools/Ganeti/HTools/Backend/IAlloc.hs \
451 htools/Ganeti/HTools/Backend/Luxi.hs \
452 htools/Ganeti/HTools/Backend/Rapi.hs \
453 htools/Ganeti/HTools/Backend/Simu.hs \
454 htools/Ganeti/HTools/Backend/Text.hs \
455 htools/Ganeti/HTools/CLI.hs \
456 htools/Ganeti/HTools/Cluster.hs \
457 htools/Ganeti/HTools/Container.hs \
458 htools/Ganeti/HTools/ExtLoader.hs \
459 htools/Ganeti/HTools/Group.hs \
460 htools/Ganeti/HTools/Instance.hs \
461 htools/Ganeti/HTools/Loader.hs \
462 htools/Ganeti/HTools/Node.hs \
463 htools/Ganeti/HTools/PeerMap.hs \
464 htools/Ganeti/HTools/Program.hs \
465 htools/Ganeti/HTools/Program/Hail.hs \
466 htools/Ganeti/HTools/Program/Hbal.hs \
467 htools/Ganeti/HTools/Program/Hcheck.hs \
468 htools/Ganeti/HTools/Program/Hinfo.hs \
469 htools/Ganeti/HTools/Program/Hscan.hs \
470 htools/Ganeti/HTools/Program/Hspace.hs \
471 htools/Ganeti/HTools/Types.hs \
472 htools/Ganeti/Hash.hs \
473 htools/Ganeti/JSON.hs \
474 htools/Ganeti/Jobs.hs \
475 htools/Ganeti/Logging.hs \
476 htools/Ganeti/Luxi.hs \
477 htools/Ganeti/Objects.hs \
478 htools/Ganeti/OpCodes.hs \
479 htools/Ganeti/OpParams.hs \
480 htools/Ganeti/Path.hs \
481 htools/Ganeti/Query/Common.hs \
482 htools/Ganeti/Query/Filter.hs \
483 htools/Ganeti/Query/Group.hs \
484 htools/Ganeti/Query/Language.hs \
485 htools/Ganeti/Query/Node.hs \
486 htools/Ganeti/Query/Query.hs \
487 htools/Ganeti/Query/Server.hs \
488 htools/Ganeti/Query/Types.hs \
489 htools/Ganeti/Rpc.hs \
490 htools/Ganeti/Runtime.hs \
491 htools/Ganeti/Ssconf.hs \
492 htools/Ganeti/THH.hs \
493 htools/Ganeti/Types.hs \
494 htools/Ganeti/Utils.hs
497 htest/Test/Ganeti/Attoparsec.hs \
498 htest/Test/Ganeti/BasicTypes.hs \
499 htest/Test/Ganeti/Block/Drbd/Parser.hs \
500 htest/Test/Ganeti/Block/Drbd/Types.hs \
501 htest/Test/Ganeti/Common.hs \
502 htest/Test/Ganeti/Confd/Utils.hs \
503 htest/Test/Ganeti/Daemon.hs \
504 htest/Test/Ganeti/Errors.hs \
505 htest/Test/Ganeti/HTools/Backend/Simu.hs \
506 htest/Test/Ganeti/HTools/Backend/Text.hs \
507 htest/Test/Ganeti/HTools/CLI.hs \
508 htest/Test/Ganeti/HTools/Cluster.hs \
509 htest/Test/Ganeti/HTools/Container.hs \
510 htest/Test/Ganeti/HTools/Instance.hs \
511 htest/Test/Ganeti/HTools/Loader.hs \
512 htest/Test/Ganeti/HTools/Node.hs \
513 htest/Test/Ganeti/HTools/PeerMap.hs \
514 htest/Test/Ganeti/HTools/Types.hs \
515 htest/Test/Ganeti/JSON.hs \
516 htest/Test/Ganeti/Jobs.hs \
517 htest/Test/Ganeti/Luxi.hs \
518 htest/Test/Ganeti/Objects.hs \
519 htest/Test/Ganeti/OpCodes.hs \
520 htest/Test/Ganeti/Query/Filter.hs \
521 htest/Test/Ganeti/Query/Language.hs \
522 htest/Test/Ganeti/Query/Query.hs \
523 htest/Test/Ganeti/Rpc.hs \
524 htest/Test/Ganeti/Ssconf.hs \
525 htest/Test/Ganeti/THH.hs \
526 htest/Test/Ganeti/TestCommon.hs \
527 htest/Test/Ganeti/TestHTools.hs \
528 htest/Test/Ganeti/TestHelper.hs \
529 htest/Test/Ganeti/Types.hs \
530 htest/Test/Ganeti/Utils.hs
532 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
535 htest/Test/Ganeti/TestImports.hs \
536 htools/Ganeti/Constants.hs \
537 htools/Ganeti/Version.hs
538 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
540 $(RUN_IN_TEMPDIR): | stamp-directories
542 # Note: we use here an order-only prerequisite, as the contents of
543 # _autoconf.py are not actually influencing the html build output: it
544 # has to exist in order for the sphinx module to be loaded
545 # successfully, but we certainly don't want the docs to be rebuilt if
547 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
548 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
549 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
550 | $(BUILT_PYTHON_SOURCES)
551 @test -n "$(SPHINX)" || \
552 { echo 'sphinx-build' not found during configure; exit 1; }
554 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
556 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
557 -D release="$(PACKAGE_VERSION)" \
558 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
559 rm -f doc/html/.buildinfo doc/html/objects.inv
562 doc/html: doc/html/index.html
564 doc/install-quick.rst: INSTALL
566 doc/upgrade.rst: UPGRADE
568 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
570 { echo '.. This file is automatically updated at build time from $<.'; \
571 echo '.. Do not edit.'; \
578 doc/design-2.1-lock-acquire.dot \
579 doc/design-2.1-lock-release.dot
581 docpng = $(patsubst %.dot,%.png,$(docdot))
583 # Things to build but not to install (add it to EXTRA_DIST if it should be
588 doc/examples/bash_completion \
589 doc/examples/bash_completion-debug \
594 scripts/gnt-cluster \
597 scripts/gnt-instance \
599 scripts/gnt-network \
603 PYTHON_BOOTSTRAP_SBIN = \
604 daemons/ganeti-masterd \
605 daemons/ganeti-noded \
606 daemons/ganeti-rapi \
607 daemons/ganeti-watcher \
611 $(PYTHON_BOOTSTRAP_SBIN) \
613 tools/prepare-node-join
634 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
636 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
637 # FIXME: this is a hardcoded logic, instead of auto-resolving
638 $(LN_S) -f ../../../bin/htools \
639 $(DESTDIR)$(iallocatorsdir)/hail
640 for role in $(HS_BIN_ROLES); do \
642 $(DESTDIR)$(bindir)/$$role ; \
646 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
647 @if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
648 echo "Error: cannot run unittests without the development" \
649 " libraries (see devnotes.rst)" 1>&2; \
652 @rm -f $(notdir $@).tix
655 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
656 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
657 $(HEXTRA) $(HEXTRA_INT) $@
660 # for the htest/test binary, we need to enable profiling/coverage
661 htest/test: HEXTRA_INT=-fhpc -ihtest
663 # we compile the hpc-htools binary with the program coverage
664 htest/hpc-htools: HEXTRA_INT=-fhpc
667 htest/offline-tests.sh: htest/hpc-htools
669 # rules for building profiling-enabled versions of the haskell
670 # programs: hs-prof does the full two-step build, whereas
671 # hs-prof-quick does only the final rebuild (hs-prof must have been
673 .PHONY: hs-prof hs-prof-quick
675 $(MAKE) $(AM_MAKEFLAGS) clean
676 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf o"
677 rm -f $(HS_ALL_PROGS)
678 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
681 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf prof_o -prof -auto-all"
683 dist_sbin_SCRIPTS = \
684 tools/ganeti-listrunner
686 nodist_sbin_SCRIPTS = \
687 $(PYTHON_BOOTSTRAP_SBIN) \
688 daemons/ganeti-cleaner
691 htools/ganeti-confd: htools/hconfd
694 nodist_sbin_SCRIPTS += htools/ganeti-confd
702 tools/cluster-merge \
706 tools/move-instance \
708 tools/sanitize-config
710 dist_tools_SCRIPTS = \
712 tools/kvm-console-wrapper \
713 tools/master-ip-setup \
714 tools/xen-console-wrapper
716 nodist_tools_SCRIPTS = \
719 pkglib_python_scripts = \
720 daemons/import-export \
721 tools/check-cert-expired
723 nodist_pkglib_python_scripts = \
725 tools/prepare-node-join
727 myexeclib_SCRIPTS = \
728 daemons/daemon-util \
730 $(pkglib_python_scripts)
732 nodist_myexeclib_SCRIPTS = \
733 $(nodist_pkglib_python_scripts)
740 autotools/build-bash-completion \
741 autotools/build-rpc \
742 autotools/check-header \
743 autotools/check-imports \
744 autotools/check-man-dashes \
745 autotools/check-man-warnings \
746 autotools/check-news \
747 autotools/check-python-code \
748 autotools/check-tar \
749 autotools/check-version \
750 autotools/convert-constants \
752 autotools/gen-coverage \
753 autotools/testrunner \
754 autotools/wrong-hardcoded-paths \
756 daemons/daemon-util.in \
757 daemons/ganeti-cleaner.in \
758 $(pkglib_python_scripts) \
761 tools/vcluster-setup.in \
767 $(BUILT_EXAMPLES:%=%.in) \
768 doc/examples/ganeti.default \
769 doc/examples/ganeti.default-debug \
770 doc/examples/hooks/ethers \
771 doc/examples/gnt-debug/README \
772 doc/examples/gnt-debug/delay0.json \
773 doc/examples/gnt-debug/delay50.json \
784 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
786 htools/lint-hints.hs \
787 htest/cli-tests-defs.sh \
788 htest/offline-test.sh \
792 man/ganeti-cleaner.8 \
794 man/ganeti-listrunner.8 \
795 man/ganeti-masterd.8 \
797 man/ganeti-os-interface.7 \
799 man/ganeti-watcher.8 \
818 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
819 manhtml = $(patsubst %.rst,%.html,$(manrst))
820 mangen = $(patsubst %.rst,%.gen,$(manrst))
822 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
823 $(patsubst %.html,%.html.in,$(manhtml)) \
824 man/footer.man man/footer.html $(mangen)
827 htest/data/common-suffix.data \
828 htest/data/hail-alloc-drbd.json \
829 htest/data/hail-change-group.json \
830 htest/data/hail-invalid-reloc.json \
831 htest/data/hail-node-evac.json \
832 htest/data/hail-reloc-drbd.json \
833 htest/data/hbal-excl-tags.data \
834 htest/data/hbal-split-insts.data \
835 htest/data/invalid-node.data \
836 htest/data/missing-resources.data \
837 htest/data/rapi/groups.json \
838 htest/data/rapi/info.json \
839 htest/data/rapi/instances.json \
840 htest/data/rapi/nodes.json \
841 htest/shelltests/htools-balancing.test \
842 htest/shelltests/htools-basic.test \
843 htest/shelltests/htools-dynutil.test \
844 htest/shelltests/htools-excl.test \
845 htest/shelltests/htools-hail.test \
846 htest/shelltests/htools-hspace.test \
847 htest/shelltests/htools-invalid.test \
848 htest/shelltests/htools-multi-group.test \
849 htest/shelltests/htools-no-backend.test \
850 htest/shelltests/htools-rapi.test \
851 htest/shelltests/htools-single-group.test \
852 htest/shelltests/htools-text-backend.test \
853 test/data/bdev-drbd-8.0.txt \
854 test/data/bdev-drbd-8.3.txt \
855 test/data/bdev-drbd-disk.txt \
856 test/data/bdev-drbd-net-ip4.txt \
857 test/data/bdev-drbd-net-ip6.txt \
858 test/data/cert1.pem \
859 test/data/cert2.pem \
860 test/data/ip-addr-show-dummy0.txt \
861 test/data/ip-addr-show-lo-ipv4.txt \
862 test/data/ip-addr-show-lo-ipv6.txt \
863 test/data/ip-addr-show-lo-oneline-ipv4.txt \
864 test/data/ip-addr-show-lo-oneline-ipv6.txt \
865 test/data/ip-addr-show-lo-oneline.txt \
866 test/data/ip-addr-show-lo.txt \
867 test/data/kvm_0.12.5_help.txt \
868 test/data/kvm_0.15.90_help.txt \
869 test/data/kvm_0.9.1_help.txt \
870 test/data/kvm_1.0_help.txt \
871 test/data/ovfdata/compr_disk.vmdk.gz \
872 test/data/ovfdata/config.ini \
873 test/data/ovfdata/corrupted_resources.ovf \
874 test/data/ovfdata/empty.ini \
875 test/data/ovfdata/empty.ovf \
876 test/data/ovfdata/ganeti.mf \
877 test/data/ovfdata/ganeti.ovf \
878 test/data/ovfdata/gzip_disk.ovf \
879 test/data/ovfdata/new_disk.vmdk \
880 test/data/ovfdata/no_disk.ini \
881 test/data/ovfdata/no_disk_in_ref.ovf \
882 test/data/ovfdata/no_os.ini \
883 test/data/ovfdata/no_ovf.ova \
884 test/data/ovfdata/other/rawdisk.raw \
885 test/data/ovfdata/ova.ova \
886 test/data/ovfdata/rawdisk.raw \
887 test/data/ovfdata/second_disk.vmdk \
888 test/data/ovfdata/unsafe_path.ini \
889 test/data/ovfdata/virtualbox.ovf \
890 test/data/ovfdata/wrong_config.ini \
891 test/data/ovfdata/wrong_extension.ovd \
892 test/data/ovfdata/wrong_manifest.mf \
893 test/data/ovfdata/wrong_manifest.ovf \
894 test/data/ovfdata/wrong_ova.ova \
895 test/data/ovfdata/wrong_xml.ovf \
896 test/data/proc_drbd8.txt \
897 test/data/proc_drbd80-emptyline.txt \
898 test/data/proc_drbd83.txt \
899 test/data/proc_drbd83_sync.txt \
900 test/data/proc_drbd83_sync_want.txt \
901 test/data/proc_drbd83_sync_krnl2.6.39.txt \
902 test/data/sys_drbd_usermode_helper.txt \
903 test/data/vgreduce-removemissing-2.02.02.txt \
904 test/data/vgreduce-removemissing-2.02.66-fail.txt \
905 test/data/vgreduce-removemissing-2.02.66-ok.txt \
906 test/data/vgs-missing-pvs-2.02.02.txt \
907 test/data/vgs-missing-pvs-2.02.66.txt \
908 test/ganeti-cli.test \
910 test/import-export_unittest-helper
913 doc/examples/rapi_testutils.py \
914 test/cfgupgrade_unittest.py \
915 test/docs_unittest.py \
916 test/ganeti.asyncnotifier_unittest.py \
917 test/ganeti.backend_unittest-runasroot.py \
918 test/ganeti.backend_unittest.py \
919 test/ganeti.bdev_unittest.py \
920 test/ganeti.cli_unittest.py \
921 test/ganeti.client.gnt_cluster_unittest.py \
922 test/ganeti.client.gnt_instance_unittest.py \
923 test/ganeti.client.gnt_job_unittest.py \
924 test/ganeti.cmdlib_unittest.py \
925 test/ganeti.compat_unittest.py \
926 test/ganeti.confd.client_unittest.py \
927 test/ganeti.config_unittest.py \
928 test/ganeti.constants_unittest.py \
929 test/ganeti.daemon_unittest.py \
930 test/ganeti.errors_unittest.py \
931 test/ganeti.hooks_unittest.py \
932 test/ganeti.ht_unittest.py \
933 test/ganeti.http_unittest.py \
934 test/ganeti.hypervisor.hv_chroot_unittest.py \
935 test/ganeti.hypervisor.hv_fake_unittest.py \
936 test/ganeti.hypervisor.hv_kvm_unittest.py \
937 test/ganeti.hypervisor.hv_lxc_unittest.py \
938 test/ganeti.hypervisor.hv_xen_unittest.py \
939 test/ganeti.hypervisor_unittest.py \
940 test/ganeti.impexpd_unittest.py \
941 test/ganeti.jqueue_unittest.py \
942 test/ganeti.jstore_unittest.py \
943 test/ganeti.locking_unittest.py \
944 test/ganeti.luxi_unittest.py \
945 test/ganeti.masterd.iallocator_unittest.py \
946 test/ganeti.masterd.instance_unittest.py \
947 test/ganeti.mcpu_unittest.py \
948 test/ganeti.netutils_unittest.py \
949 test/ganeti.objects_unittest.py \
950 test/ganeti.objectutils_unittest.py \
951 test/ganeti.opcodes_unittest.py \
952 test/ganeti.ovf_unittest.py \
953 test/ganeti.qlang_unittest.py \
954 test/ganeti.query_unittest.py \
955 test/ganeti.rapi.baserlib_unittest.py \
956 test/ganeti.rapi.client_unittest.py \
957 test/ganeti.rapi.resources_unittest.py \
958 test/ganeti.rapi.rlib2_unittest.py \
959 test/ganeti.rapi.testutils_unittest.py \
960 test/ganeti.rpc_unittest.py \
961 test/ganeti.runtime_unittest.py \
962 test/ganeti.serializer_unittest.py \
963 test/ganeti.server.rapi_unittest.py \
964 test/ganeti.ssconf_unittest.py \
965 test/ganeti.ssh_unittest.py \
966 test/ganeti.storage_unittest.py \
967 test/ganeti.tools.ensure_dirs_unittest.py \
968 test/ganeti.tools.prepare_node_join_unittest.py \
969 test/ganeti.uidpool_unittest.py \
970 test/ganeti.utils.algo_unittest.py \
971 test/ganeti.utils.filelock_unittest.py \
972 test/ganeti.utils.hash_unittest.py \
973 test/ganeti.utils.io_unittest-runasroot.py \
974 test/ganeti.utils.io_unittest.py \
975 test/ganeti.utils.log_unittest.py \
976 test/ganeti.utils.mlock_unittest.py \
977 test/ganeti.utils.nodesetup_unittest.py \
978 test/ganeti.utils.process_unittest.py \
979 test/ganeti.utils.retry_unittest.py \
980 test/ganeti.utils.text_unittest.py \
981 test/ganeti.utils.wrapper_unittest.py \
982 test/ganeti.utils.x509_unittest.py \
983 test/ganeti.utils_unittest.py \
984 test/ganeti.vcluster_unittest.py \
985 test/ganeti.workerpool_unittest.py \
986 test/pycurl_reset_unittest.py \
987 test/qa.qa_config_unittest.py \
988 test/tempfile_fork_unittest.py
990 haskell_tests = htest/test
993 test/check-cert-expired_unittest.bash \
994 test/daemon-util_unittest.bash \
995 test/ganeti-cleaner_unittest.bash \
996 test/import-export_unittest.bash \
998 test/bash_completion.bash \
1005 nodist_TESTS += $(haskell_tests)
1006 dist_TESTS += htest/offline-test.sh
1007 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1010 TESTS = $(dist_TESTS) $(nodist_TESTS)
1012 # Environment for all tests
1013 PLAIN_TESTS_ENVIRONMENT = \
1015 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1016 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1019 # Environment for tests run by automake
1020 TESTS_ENVIRONMENT = \
1021 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1024 $(dist_sbin_SCRIPTS) \
1026 $(pkglib_python_scripts) \
1027 $(nodist_pkglib_python_scripts) \
1029 $(pkgpython_PYTHON) \
1031 $(hypervisor_PYTHON) \
1046 test/check-cert-expired_unittest.bash \
1047 test/daemon-util_unittest.bash \
1048 test/ganeti-cleaner_unittest.bash \
1049 test/import-export_unittest.bash \
1050 test/cli-test.bash \
1051 test/bash_completion.bash \
1052 htest/offline-test.sh \
1053 htest/cli-tests-defs.sh \
1054 $(all_python_code) \
1055 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
1057 check_python_code = \
1058 $(BUILD_BASH_COMPLETION) \
1064 lint_python_code = \
1066 ganeti/http/server.py \
1067 $(dist_sbin_SCRIPTS) \
1069 $(pkglib_python_scripts) \
1070 $(BUILD_BASH_COMPLETION) \
1076 standalone_python_modules = \
1077 lib/rapi/client.py \
1078 tools/ganeti-listrunner
1080 pep8_python_code = \
1082 ganeti/http/server.py \
1083 $(dist_sbin_SCRIPTS) \
1085 $(pkglib_python_scripts) \
1086 $(BUILD_BASH_COMPLETION) \
1089 $(PYTHON_BOOTSTRAP) \
1092 test/daemon-util_unittest.bash: daemons/daemon-util
1094 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1096 test/bash_completion.bash: doc/examples/bash_completion-debug
1098 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1099 sed -f $(REPLACE_VARS_SED) < $< > $@
1102 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1103 sed -f $(REPLACE_VARS_SED) < $< > $@
1106 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1107 sed -f $(REPLACE_VARS_SED) < $< > $@
1110 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1111 sed -f $(REPLACE_VARS_SED) < $< > $@
1113 doc/examples/bash_completion: BC_ARGS = --compact
1114 doc/examples/bash_completion-debug: BC_ARGS =
1116 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1117 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1118 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1119 daemons/ganeti-cleaner \
1120 $(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1121 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1122 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1124 doc/%.png: doc/%.dot
1125 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1126 $(DOT) -Tpng -o $@ $<
1128 man/footer.man: man/footer.rst
1129 @test -n "$(PANDOC)" || \
1130 { echo 'pandoc' not found during configure; exit 1; }
1131 $(PANDOC) -f rst -t man -o $@ $<
1133 man/footer.html: man/footer.rst
1134 @test -n "$(PANDOC)" || \
1135 { echo 'pandoc' not found during configure; exit 1; }
1136 $(PANDOC) -f rst -t html -o $@ $<
1138 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1139 lib/build/shell_example_lexer.py \
1140 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1141 @echo "Checking $< for hardcoded paths..."
1142 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1143 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1147 trap 'echo auto-removing $@; rm $@' EXIT; \
1148 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1151 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1152 @test -n "$(PANDOC)" || \
1153 { echo 'pandoc' not found during configure; exit 1; }
1155 trap 'echo auto-removing $@; rm $@' EXIT; \
1156 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1157 sed -e 's/\\@/@/g' > $@; \
1158 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1159 $(CHECK_MAN_DASHES) $@; \
1163 man/%.html.in: man/%.gen man/footer.html
1164 @test -n "$(PANDOC)" || \
1165 { echo 'pandoc' not found during configure; exit 1; }
1167 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1168 sed -e 's/\\@/@/g' > $@
1170 man/%: man/%.in $(REPLACE_VARS_SED)
1171 sed -f $(REPLACE_VARS_SED) < $< > $@
1173 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1174 sed -f $(REPLACE_VARS_SED) < $< > $@
1177 if test -d .git; then \
1178 git describe > $@; \
1179 elif test ! -f $@ ; then \
1180 echo "Cannot auto-generate $@ file"; exit 1; \
1183 .PHONY: clean-vcs-version
1187 .PHONY: regen-vcs-version
1191 if test -d .git; then \
1192 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1193 git describe > $$T; \
1194 if ! cmp --quiet $$T vcs-version; then \
1195 mv $$T vcs-version; \
1199 htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1200 vcs-version $(built_base_sources)
1202 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1203 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1205 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1206 lib/constants.py lib/_autoconf.py lib/luxi.py \
1207 $(CONVERT_CONSTANTS) $(built_base_sources) \
1208 | lib/_vcsversion.py
1210 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1212 htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1213 $(built_base_sources)
1217 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1218 echo "import $$name ()" ; \
1222 lib/_autoconf.py: Makefile | stamp-directories
1224 { echo '# This file is automatically generated, do not edit!'; \
1227 echo '"""Build-time configuration for Ganeti.'; \
1229 echo 'This file is autogenerated by the build process.'; \
1230 echo 'For any changes you need to re-run ./configure (and'; \
1231 echo 'not edit by hand).'; \
1235 echo '# pylint: disable=C0301,C0324'; \
1236 echo '# because this is autogenerated, we do not want'; \
1237 echo '# style warnings' ; \
1239 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1240 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1241 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1242 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1243 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1244 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1245 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1246 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1247 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1248 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1249 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1250 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1251 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1252 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1253 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1254 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1255 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1256 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1257 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1258 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1259 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1260 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1261 echo "KVM_PATH = '$(KVM_PATH)'"; \
1262 echo "IP_PATH = '$(IP_PATH)'"; \
1263 echo "SOCAT_PATH = '$(SOCAT)'"; \
1264 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1265 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1266 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1267 echo "TOOLSDIR = '$(toolsdir)'"; \
1268 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1269 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1270 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1271 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1272 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1273 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1274 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1275 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1276 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1277 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1278 echo "RAPI_USER = '$(RAPI_USER)'"; \
1279 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1280 echo "CONFD_USER = '$(CONFD_USER)'"; \
1281 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1282 echo "NODED_USER = '$(NODED_USER)'"; \
1283 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1284 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1285 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1286 echo "HTOOLS = True"; \
1287 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1288 echo "XEN_CMD = '$(XEN_CMD)'"; \
1289 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1290 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1293 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1295 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1296 { echo '# This file is automatically generated, do not edit!'; \
1299 echo '"""Build-time VCS version number for Ganeti.'; \
1301 echo 'This file is autogenerated by the build process.'; \
1302 echo 'For any changes you need to re-run ./configure (and'; \
1303 echo 'not edit by hand).'; \
1307 echo '# pylint: disable=C0301,C0324'; \
1308 echo '# because this is autogenerated, we do not want'; \
1309 echo '# style warnings' ; \
1311 echo "VCS_VERSION = '$$VCSVER'"; \
1314 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1315 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1317 $(SHELL_ENV_INIT): Makefile stamp-directories
1319 { echo '# Allow overriding for tests'; \
1320 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1321 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1323 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1324 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1325 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1326 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1327 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1330 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1332 { echo 's#@PREFIX@#$(prefix)#g'; \
1333 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1334 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1335 echo 's#@BINDIR@#$(bindir)#g'; \
1336 echo 's#@SBINDIR@#$(sbindir)#g'; \
1337 echo 's#@LIBDIR@#$(libdir)#g'; \
1338 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1339 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1340 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1341 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1342 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1343 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1344 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1345 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1346 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1347 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1348 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1349 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1350 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1351 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1352 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1353 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1354 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1355 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1356 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1357 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1358 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1360 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1361 echo ' r $(SHELL_ENV_INIT)'; \
1366 # Using deferred evaluation
1367 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1368 daemons/ganeti-watcher: MODULE = ganeti.watcher
1369 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1370 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1371 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1372 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1374 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1375 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1377 { echo '#!/usr/bin/python'; \
1378 echo '# This file is automatically generated, do not edit!'; \
1379 echo "# Edit $(MODULE) instead."; \
1381 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1383 echo '# pylint: disable=C0103'; \
1384 echo '# C0103: Invalid name'; \
1386 echo 'import sys'; \
1387 echo 'import $(MODULE) as main'; \
1389 echo '# Temporarily alias commands until bash completion'; \
1390 echo '# generator is changed'; \
1391 echo 'if hasattr(main, "commands"):'; \
1392 echo ' commands = main.commands # pylint: disable=E1101'; \
1393 echo 'if hasattr(main, "aliases"):'; \
1394 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1396 echo 'if __name__ == "__main__":'; \
1397 echo ' sys.exit(main.Main())'; \
1401 $(HS_BUILT_TEST_HELPERS): Makefile
1402 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1404 { echo '#!/bin/sh'; \
1405 echo '# This file is automatically generated, do not edit!'; \
1406 echo "# Edit Makefile.am instead."; \
1408 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1412 stamp-directories: Makefile
1413 $(MAKE) $(AM_MAKEFLAGS) ganeti
1414 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1417 # We need to create symlinks because "make distcheck" will not install Python
1418 # files when building.
1419 stamp-srclinks: Makefile | stamp-directories
1421 for i in $(srclink_files); do \
1422 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1423 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1430 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1433 check-dirs: $(GENERATED_FILES)
1435 find . -type d \( \( -name . \) -o \( \
1437 -name autom4te.cache \
1438 \) -prune -o -print \) | { \
1440 while read dir; do \
1442 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1443 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1446 for dir in $(DIRS); do \
1447 if ! test -d "$$dir"; then \
1448 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1452 if test -n "$$error"; then exit 1; else exit 0; fi; \
1456 check-local: check-dirs $(GENERATED_FILES)
1457 $(CHECK_PYTHON_CODE) $(check_python_code)
1458 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1459 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1460 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1461 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1462 @expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1463 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1464 echo "Incorrect version in README, expected $$expver"; \
1467 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1468 doc/security.rst; do \
1469 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1470 "Documents Ganeti version $$expver"; then \
1471 echo "Incorrect version in $$file, expected $$expver"; \
1475 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1476 echo "File $(top_srcdir)/doc/design-$$expver.rst not found"; \
1479 if test $$(wc --max-line-length < $(top_srcdir)/configure.ac) -gt 80; then \
1480 echo 'Longest line in configure.ac is longer than 80 characters' >&2; \
1484 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1487 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1489 # E111: indentation is not a multiple of four
1490 # E121: continuation line indentation is not a multiple of four
1491 # (since our indent level is not 4)
1492 # E125: continuation line does not distinguish itself from next logical line
1493 # (since our indent level is not 4)
1494 # E127: continuation line over-indented for visual indent
1495 # (since our indent level is not 4)
1496 # note: do NOT add E128 here; it's a valid style error in most cases!
1497 # I've seen real errors, but also some cases were we indent wrongly
1498 # due to line length; try to rework the cases where it is triggered,
1499 # instead of silencing it
1500 # E261: at least two spaces before inline comment
1501 # E501: line too long (80 characters)
1502 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1504 # For excluding pep8 expects filenames only, not whole paths
1505 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1507 LINT_TARGETS = pylint pylint-qa
1509 LINT_TARGETS += pep8
1512 LINT_TARGETS += hlint
1516 lint: $(LINT_TARGETS)
1519 pylint: $(GENERATED_FILES)
1520 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1521 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1524 pylint-qa: $(GENERATED_FILES)
1525 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1526 cd $(top_srcdir)/qa && \
1527 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1528 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1531 pep8: $(GENERATED_FILES)
1532 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1533 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1534 --repeat $(pep8_python_code)
1536 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1538 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1539 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1540 if tty -s; then C="-c"; else C=""; fi; \
1541 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1542 --ignore "Use first" \
1543 --ignore "Use comparing" \
1545 --ignore "Reduce duplication" \
1546 --ignore "Use &&&" \
1547 --ignore "Use void" \
1548 --hint htools/lint-hints \
1549 $(filter-out htools/Ganeti/THH.hs,$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1551 # a dist hook rule for updating the vcs-version file; this is
1552 # hardcoded due to where it needs to build the file...
1554 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1555 rm -f $(top_distdir)/vcs-version
1556 cp -p $(srcdir)/vcs-version $(top_distdir)
1558 # a distcheck hook rule for catching revision control directories
1560 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1561 echo "Found revision control files in final archive." 1>&2; \
1564 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1565 echo "Found Python byte code in final archive." 1>&2; \
1568 if find $(top_distdir) -name '*~' | grep .; then \
1569 echo "Found backup files in final archive." 1>&2; \
1572 # Empty files or directories should not be distributed. They can cause
1573 # unnecessary warnings for packagers. Directories used by automake during
1574 # distcheck must be excluded.
1575 if find $(top_distdir) -empty -and -not \( \
1576 -path $(top_distdir)/_build -or \
1577 -path $(top_distdir)/_inst \) | grep .; then \
1578 echo "Found empty files or directories in final archive." 1>&2; \
1581 if test -n "$(BUILD_RELEASE)" && \
1582 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1583 echo "Found unreleased version in NEWS." >&2; \
1587 # When building a release, stricter checks should be used
1588 distcheck-release dist-release: export BUILD_RELEASE = 1
1589 distcheck-release: distcheck
1591 distrebuildcheck: dist
1593 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1594 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1596 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1599 $(MAKE) maintainer-clean; \
1600 cp $(abs_srcdir)/vcs-version .; \
1602 $(MAKE) $(AM_MAKEFLAGS)
1606 for i in $(DIST_ARCHIVES); do \
1607 echo -n "Checking $$i ... "; \
1608 autotools/check-tar < $$i; \
1613 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1614 "$(DESTDIR)${localstatedir}/log/ganeti" \
1615 "$(DESTDIR)${localstatedir}/run/ganeti"
1618 if WANT_HTOOLSAPIDOC
1619 apidoc: py-apidoc hs-apidoc
1625 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1626 $(RUN_IN_TEMPDIR) epydoc -v \
1627 --conf $(CURDIR)/epydoc.conf \
1628 --output $(CURDIR)/$(APIDOC_PY_DIR)
1631 hs-apidoc: $(HS_BUILT_SRCS)
1632 @test -n "$(HSCOLOUR)" || \
1633 { echo 'HsColour' not found during configure; exit 1; }
1634 @test -n "$(HADDOCK)" || \
1635 { echo 'haddock' not found during configure; exit 1; }
1636 rm -rf $(APIDOC_HS_DIR)/*
1637 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Backend
1638 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1639 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Block
1640 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Block/Drbd
1641 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1642 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1643 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1644 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1645 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1648 if [ "$(HTOOLS_NOCURL)" ]; \
1649 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1652 if [ "$(HTOOLS_PARALLEL3)" ]; \
1653 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1655 if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1656 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1658 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1659 for file in $$RELSRCS; do \
1660 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1661 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1663 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1664 -t ganeti -p haddock-prologue \
1665 --source-module="%{MODULE/.//}.html" \
1666 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1668 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1671 TAGS: $(GENERATED_FILES)
1673 $(GHC) -e ":etags" -v0 \
1674 $(filter-out -O -Werror,$(HFLAGS)) \
1675 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1677 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1678 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1679 -path './qa/*.py' | \
1680 etags -l python -a -
1684 coverage: py-coverage hs-coverage
1686 coverage: py-coverage
1690 py-coverage: $(GENERATED_FILES) $(python_tests)
1691 @test -n "$(PYCOVERAGE)" || \
1692 { echo 'python-coverage' not found during configure; exit 1; }
1694 COVERAGE=$(PYCOVERAGE) \
1695 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1696 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1697 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1698 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1702 hs-coverage: $(haskell_tests) htest/hpc-htools
1704 $(MAKE) $(AM_MAKEFLAGS) hs-check
1705 @mkdir_p@ $(COVERAGE_HS_DIR)
1706 hpc combine --union $(HPCEXCL) \
1707 test.tix hpc-htools.tix > coverage-htools.tix
1708 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1709 hpc report coverage-htools.tix
1710 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1712 # Special "kind-of-QA" target for htools, needs special setup (all
1713 # tools compiled with -fhpc)
1718 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1719 rm -f *.tix *.mix; \
1721 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1722 --output=live-test.tix ; \
1723 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1724 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1725 --srcdir=.. $(HPCEXCL) ; \
1726 hpc report --srcdir=.. live-test $(HPCEXCL)
1728 commit-check: distcheck lint apidoc
1730 .PHONY: gitignore-check
1732 @if [ -n "`git status --short`" ]; then \
1733 echo "Git status is not clean!" 1>&2 ; \
1734 git status --short; \
1738 # Target that builds all binaries (including those that are not
1739 # rebuilt except when running the tests)
1741 really-all: all $(check_SCRIPTS) $(haskell_tests)
1743 # we don't need the ancient implicit rules:
1750 -include ./Makefile.local