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 ALL_APIDOC_HS_DIRS = \
112 $(APIDOC_HS_DIR)/Ganeti \
113 $(APIDOC_HS_DIR)/Ganeti/Block \
114 $(APIDOC_HS_DIR)/Ganeti/Block/Drbd \
115 $(APIDOC_HS_DIR)/Ganeti/Confd \
116 $(APIDOC_HS_DIR)/Ganeti/HTools \
117 $(APIDOC_HS_DIR)/Ganeti/HTools/Backend \
118 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
119 $(APIDOC_HS_DIR)/Ganeti/Query
121 BUILDTIME_DIR_AUTOCREATE = \
124 $(ALL_APIDOC_HS_DIRS) \
132 $(BUILDTIME_DIR_AUTOCREATE) \
137 ganeti-[0-9]*.[0-9]*.[0-9]* \
142 COVERAGE_DIR = doc/coverage
143 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
144 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
146 APIDOC_PY_DIR = $(APIDOC_DIR)/py
147 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
149 MAINTAINERCLEANFILES = \
152 doc/install-quick.rst \
157 maintainer-clean-local:
158 rm -rf $(BUILDTIME_DIRS)
161 $(addsuffix /*.py[co],$(DIRS)) \
162 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
163 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
164 $(PYTHON_BOOTSTRAP) \
166 $(REPLACE_VARS_SED) \
168 daemons/daemon-util \
169 daemons/ganeti-cleaner \
171 doc/examples/bash_completion \
172 doc/examples/bash_completion-debug \
173 lib/_generated_rpc.py \
177 tools/vcluster-setup \
180 $(nodist_pkgpython_PYTHON) \
181 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
182 $(HS_BUILT_TEST_HELPERS) \
183 htools/ganeti-confd \
184 .hpc/*.mix htools/*.tix htest/*.tix \
188 $(built_base_sources) \
189 $(BUILT_PYTHON_SOURCES) \
192 HTOOLS_GENERATED_FILES =
194 HTOOLS_GENERATED_FILES += $(HS_PROGS)
196 HTOOLS_GENERATED_FILES += htools/hconfd htools/ganeti-confd
200 built_base_sources = \
204 built_python_base_sources = \
208 BUILT_PYTHON_SOURCES = \
209 $(built_python_base_sources) \
210 lib/_generated_rpc.py
212 # Generating the RPC wrappers depends on many things, so make sure
213 # it's built at the end of the built sources
214 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
216 # these are all built from the underlying %.in sources
218 doc/examples/ganeti-kvm-poweroff.initd \
219 doc/examples/ganeti.cron \
220 doc/examples/ganeti.initd \
221 doc/examples/ganeti-master-role.ocf \
222 doc/examples/ganeti-node-role.ocf \
223 doc/examples/gnt-config-backup \
224 doc/examples/hooks/ipsec
226 nodist_pkgpython_PYTHON = \
227 $(BUILT_PYTHON_SOURCES)
230 lib/build/__init__.py \
231 lib/build/shell_example_lexer.py \
232 lib/build/sphinx_ext.py
236 lib/asyncnotifier.py \
274 lib/client/__init__.py \
275 lib/client/gnt_backup.py \
276 lib/client/gnt_cluster.py \
277 lib/client/gnt_debug.py \
278 lib/client/gnt_group.py \
279 lib/client/gnt_instance.py \
280 lib/client/gnt_job.py \
281 lib/client/gnt_node.py \
282 lib/client/gnt_network.py \
285 hypervisor_PYTHON = \
286 lib/hypervisor/__init__.py \
287 lib/hypervisor/hv_base.py \
288 lib/hypervisor/hv_chroot.py \
289 lib/hypervisor/hv_fake.py \
290 lib/hypervisor/hv_kvm.py \
291 lib/hypervisor/hv_lxc.py \
292 lib/hypervisor/hv_xen.py
295 lib/rapi/__init__.py \
296 lib/rapi/baserlib.py \
298 lib/rapi/client_utils.py \
299 lib/rapi/connector.py \
301 lib/rapi/testutils.py
304 lib/http/__init__.py \
310 lib/confd/__init__.py \
314 lib/masterd/__init__.py \
315 lib/masterd/iallocator.py \
316 lib/masterd/instance.py
319 lib/impexpd/__init__.py
322 lib/watcher/__init__.py \
323 lib/watcher/nodemaint.py \
327 lib/server/__init__.py \
328 lib/server/masterd.py \
329 lib/server/noded.py \
333 lib/tools/__init__.py \
334 lib/tools/ensure_dirs.py \
335 lib/tools/prepare_node_join.py
338 lib/utils/__init__.py \
340 lib/utils/filelock.py \
345 lib/utils/nodesetup.py \
346 lib/utils/process.py \
349 lib/utils/wrapper.py \
354 doc/cluster-merge.rst \
363 doc/design-autorepair.rst \
364 doc/design-bulk-create.rst \
365 doc/design-chained-jobs.rst \
366 doc/design-cpu-pinning.rst \
367 doc/design-draft.rst \
368 doc/design-htools-2.3.rst \
369 doc/design-http-server.rst \
370 doc/design-impexp2.rst \
371 doc/design-lu-generated-jobs.rst \
372 doc/design-linuxha.rst \
373 doc/design-multi-reloc.rst \
374 doc/design-network.rst \
375 doc/design-node-add.rst \
377 doc/design-ovf-support.rst \
378 doc/design-opportunistic-locking.rst \
379 doc/design-partitioned.rst \
380 doc/design-query-splitting.rst \
381 doc/design-query2.rst \
382 doc/design-remote-commands.rst \
383 doc/design-resource-model.rst \
384 doc/design-shared-storage.rst \
385 doc/design-monitoring-agent.rst \
386 doc/design-virtual-clusters.rst \
387 doc/design-x509-ca.rst \
393 doc/install-quick.rst \
396 doc/move-instance.rst \
398 doc/ovfconverter.rst \
402 doc/virtual-cluster.rst \
405 HS_PROGS = htools/htools
406 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
407 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
416 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
417 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
420 -O -Wall -Werror -ihtools \
421 -fwarn-monomorphism-restriction \
423 $(GHC_BYVERSION_FLAGS)
425 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
427 # internal extra flags (used for htest/test mainly)
429 # exclude options for coverage reports
430 HPCEXCL = --exclude Main \
431 --exclude Ganeti.Constants \
432 --exclude Ganeti.HTools.QC \
433 --exclude Ganeti.THH \
434 --exclude Ganeti.Version \
435 --exclude Test.Ganeti.Attoparsec \
436 --exclude Test.Ganeti.TestCommon \
437 --exclude Test.Ganeti.TestHTools \
438 --exclude Test.Ganeti.TestHelper \
439 --exclude Test.Ganeti.TestImports \
440 $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
443 htools/Ganeti/Block/Drbd/Types.hs \
444 htools/Ganeti/Block/Drbd/Parser.hs \
445 htools/Ganeti/BasicTypes.hs \
446 htools/Ganeti/Common.hs \
447 htools/Ganeti/Compat.hs \
448 htools/Ganeti/Confd/Server.hs \
449 htools/Ganeti/Confd/Types.hs \
450 htools/Ganeti/Confd/Utils.hs \
451 htools/Ganeti/Config.hs \
452 htools/Ganeti/Daemon.hs \
453 htools/Ganeti/Errors.hs \
454 htools/Ganeti/HTools/Backend/IAlloc.hs \
455 htools/Ganeti/HTools/Backend/Luxi.hs \
456 htools/Ganeti/HTools/Backend/Rapi.hs \
457 htools/Ganeti/HTools/Backend/Simu.hs \
458 htools/Ganeti/HTools/Backend/Text.hs \
459 htools/Ganeti/HTools/CLI.hs \
460 htools/Ganeti/HTools/Cluster.hs \
461 htools/Ganeti/HTools/Container.hs \
462 htools/Ganeti/HTools/ExtLoader.hs \
463 htools/Ganeti/HTools/Graph.hs \
464 htools/Ganeti/HTools/Group.hs \
465 htools/Ganeti/HTools/Instance.hs \
466 htools/Ganeti/HTools/Loader.hs \
467 htools/Ganeti/HTools/Node.hs \
468 htools/Ganeti/HTools/PeerMap.hs \
469 htools/Ganeti/HTools/Program.hs \
470 htools/Ganeti/HTools/Program/Hail.hs \
471 htools/Ganeti/HTools/Program/Hbal.hs \
472 htools/Ganeti/HTools/Program/Hcheck.hs \
473 htools/Ganeti/HTools/Program/Hinfo.hs \
474 htools/Ganeti/HTools/Program/Hscan.hs \
475 htools/Ganeti/HTools/Program/Hspace.hs \
476 htools/Ganeti/HTools/Types.hs \
477 htools/Ganeti/Hash.hs \
478 htools/Ganeti/JSON.hs \
479 htools/Ganeti/Jobs.hs \
480 htools/Ganeti/Logging.hs \
481 htools/Ganeti/Luxi.hs \
482 htools/Ganeti/Objects.hs \
483 htools/Ganeti/OpCodes.hs \
484 htools/Ganeti/OpParams.hs \
485 htools/Ganeti/Path.hs \
486 htools/Ganeti/Query/Common.hs \
487 htools/Ganeti/Query/Filter.hs \
488 htools/Ganeti/Query/Group.hs \
489 htools/Ganeti/Query/Language.hs \
490 htools/Ganeti/Query/Node.hs \
491 htools/Ganeti/Query/Query.hs \
492 htools/Ganeti/Query/Server.hs \
493 htools/Ganeti/Query/Types.hs \
494 htools/Ganeti/Rpc.hs \
495 htools/Ganeti/Runtime.hs \
496 htools/Ganeti/Ssconf.hs \
497 htools/Ganeti/THH.hs \
498 htools/Ganeti/Types.hs \
499 htools/Ganeti/Utils.hs
502 htest/Test/Ganeti/Attoparsec.hs \
503 htest/Test/Ganeti/BasicTypes.hs \
504 htest/Test/Ganeti/Block/Drbd/Parser.hs \
505 htest/Test/Ganeti/Block/Drbd/Types.hs \
506 htest/Test/Ganeti/Common.hs \
507 htest/Test/Ganeti/Confd/Utils.hs \
508 htest/Test/Ganeti/Daemon.hs \
509 htest/Test/Ganeti/Errors.hs \
510 htest/Test/Ganeti/HTools/Backend/Simu.hs \
511 htest/Test/Ganeti/HTools/Backend/Text.hs \
512 htest/Test/Ganeti/HTools/CLI.hs \
513 htest/Test/Ganeti/HTools/Cluster.hs \
514 htest/Test/Ganeti/HTools/Container.hs \
515 htest/Test/Ganeti/HTools/Graph.hs \
516 htest/Test/Ganeti/HTools/Instance.hs \
517 htest/Test/Ganeti/HTools/Loader.hs \
518 htest/Test/Ganeti/HTools/Node.hs \
519 htest/Test/Ganeti/HTools/PeerMap.hs \
520 htest/Test/Ganeti/HTools/Types.hs \
521 htest/Test/Ganeti/JSON.hs \
522 htest/Test/Ganeti/Jobs.hs \
523 htest/Test/Ganeti/Luxi.hs \
524 htest/Test/Ganeti/Objects.hs \
525 htest/Test/Ganeti/OpCodes.hs \
526 htest/Test/Ganeti/Query/Filter.hs \
527 htest/Test/Ganeti/Query/Language.hs \
528 htest/Test/Ganeti/Query/Query.hs \
529 htest/Test/Ganeti/Rpc.hs \
530 htest/Test/Ganeti/Ssconf.hs \
531 htest/Test/Ganeti/THH.hs \
532 htest/Test/Ganeti/TestCommon.hs \
533 htest/Test/Ganeti/TestHTools.hs \
534 htest/Test/Ganeti/TestHelper.hs \
535 htest/Test/Ganeti/Types.hs \
536 htest/Test/Ganeti/Utils.hs
538 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
541 htest/Test/Ganeti/TestImports.hs \
542 htools/Ganeti/Constants.hs \
543 htools/Ganeti/Version.hs
544 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
546 $(RUN_IN_TEMPDIR): | stamp-directories
548 # Note: we use here an order-only prerequisite, as the contents of
549 # _autoconf.py are not actually influencing the html build output: it
550 # has to exist in order for the sphinx module to be loaded
551 # successfully, but we certainly don't want the docs to be rebuilt if
553 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
554 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
555 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
556 | $(BUILT_PYTHON_SOURCES)
557 @test -n "$(SPHINX)" || \
558 { echo 'sphinx-build' not found during configure; exit 1; }
560 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
562 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
563 -D release="$(PACKAGE_VERSION)" \
564 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
565 rm -f doc/html/.buildinfo doc/html/objects.inv
568 doc/html: doc/html/index.html
570 doc/install-quick.rst: INSTALL
572 doc/upgrade.rst: UPGRADE
574 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
576 { echo '.. This file is automatically updated at build time from $<.'; \
577 echo '.. Do not edit.'; \
584 doc/design-2.1-lock-acquire.dot \
585 doc/design-2.1-lock-release.dot
587 docpng = $(patsubst %.dot,%.png,$(docdot))
589 # Things to build but not to install (add it to EXTRA_DIST if it should be
594 doc/examples/bash_completion \
595 doc/examples/bash_completion-debug \
600 scripts/gnt-cluster \
603 scripts/gnt-instance \
605 scripts/gnt-network \
609 PYTHON_BOOTSTRAP_SBIN = \
610 daemons/ganeti-masterd \
611 daemons/ganeti-noded \
612 daemons/ganeti-rapi \
613 daemons/ganeti-watcher \
617 $(PYTHON_BOOTSTRAP_SBIN) \
619 tools/prepare-node-join
640 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
642 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
643 # FIXME: this is a hardcoded logic, instead of auto-resolving
644 $(LN_S) -f ../../../bin/htools \
645 $(DESTDIR)$(iallocatorsdir)/hail
646 for role in $(HS_BIN_ROLES); do \
647 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
651 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
652 @if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
653 echo "Error: cannot run unittests without the development" \
654 " libraries (see devnotes.rst)" 1>&2; \
657 @rm -f $(notdir $@).tix
660 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
661 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
662 $(HEXTRA) $(HEXTRA_INT) $@
665 # for the htest/test binary, we need to enable profiling/coverage
666 htest/test: HEXTRA_INT=-fhpc -ihtest
668 # we compile the hpc-htools binary with the program coverage
669 htest/hpc-htools: HEXTRA_INT=-fhpc
672 htest/offline-tests.sh: htest/hpc-htools
674 # rules for building profiling-enabled versions of the haskell
675 # programs: hs-prof does the full two-step build, whereas
676 # hs-prof-quick does only the final rebuild (hs-prof must have been
678 .PHONY: hs-prof hs-prof-quick
680 $(MAKE) $(AM_MAKEFLAGS) clean
681 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf o"
682 rm -f $(HS_ALL_PROGS)
683 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
686 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf prof_o -prof -auto-all"
688 dist_sbin_SCRIPTS = \
689 tools/ganeti-listrunner
691 nodist_sbin_SCRIPTS = \
692 $(PYTHON_BOOTSTRAP_SBIN) \
693 daemons/ganeti-cleaner
696 htools/ganeti-confd: htools/hconfd
699 nodist_sbin_SCRIPTS += htools/ganeti-confd
707 tools/cluster-merge \
711 tools/move-instance \
713 tools/sanitize-config
715 dist_tools_SCRIPTS = \
717 tools/kvm-console-wrapper \
718 tools/master-ip-setup \
719 tools/xen-console-wrapper
721 nodist_tools_SCRIPTS = \
724 pkglib_python_scripts = \
725 daemons/import-export \
726 tools/check-cert-expired
728 nodist_pkglib_python_scripts = \
730 tools/prepare-node-join
732 myexeclib_SCRIPTS = \
733 daemons/daemon-util \
735 $(pkglib_python_scripts)
737 nodist_myexeclib_SCRIPTS = \
738 $(nodist_pkglib_python_scripts)
745 autotools/build-bash-completion \
746 autotools/build-rpc \
747 autotools/check-header \
748 autotools/check-imports \
749 autotools/check-man-dashes \
750 autotools/check-man-warnings \
751 autotools/check-news \
752 autotools/check-python-code \
753 autotools/check-tar \
754 autotools/check-version \
755 autotools/convert-constants \
757 autotools/gen-coverage \
758 autotools/testrunner \
759 autotools/wrong-hardcoded-paths \
761 daemons/daemon-util.in \
762 daemons/ganeti-cleaner.in \
763 $(pkglib_python_scripts) \
766 tools/vcluster-setup.in \
772 $(BUILT_EXAMPLES:%=%.in) \
773 doc/examples/ganeti.default \
774 doc/examples/ganeti.default-debug \
775 doc/examples/hooks/ethers \
776 doc/examples/gnt-debug/README \
777 doc/examples/gnt-debug/delay0.json \
778 doc/examples/gnt-debug/delay50.json \
789 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
791 htools/lint-hints.hs \
792 htest/cli-tests-defs.sh \
793 htest/offline-test.sh \
797 man/ganeti-cleaner.8 \
799 man/ganeti-listrunner.8 \
800 man/ganeti-masterd.8 \
802 man/ganeti-os-interface.7 \
804 man/ganeti-watcher.8 \
823 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
824 manhtml = $(patsubst %.rst,%.html,$(manrst))
825 mangen = $(patsubst %.rst,%.gen,$(manrst))
827 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
828 $(patsubst %.html,%.html.in,$(manhtml)) \
829 man/footer.man man/footer.html $(mangen)
832 htest/data/common-suffix.data \
833 htest/data/hail-alloc-drbd.json \
834 htest/data/hail-change-group.json \
835 htest/data/hail-invalid-reloc.json \
836 htest/data/hail-node-evac.json \
837 htest/data/hail-reloc-drbd.json \
838 htest/data/hbal-excl-tags.data \
839 htest/data/hbal-split-insts.data \
840 htest/data/invalid-node.data \
841 htest/data/missing-resources.data \
842 htest/data/rapi/groups.json \
843 htest/data/rapi/info.json \
844 htest/data/rapi/instances.json \
845 htest/data/rapi/nodes.json \
846 htest/shelltests/htools-balancing.test \
847 htest/shelltests/htools-basic.test \
848 htest/shelltests/htools-dynutil.test \
849 htest/shelltests/htools-excl.test \
850 htest/shelltests/htools-hail.test \
851 htest/shelltests/htools-hspace.test \
852 htest/shelltests/htools-invalid.test \
853 htest/shelltests/htools-multi-group.test \
854 htest/shelltests/htools-no-backend.test \
855 htest/shelltests/htools-rapi.test \
856 htest/shelltests/htools-single-group.test \
857 htest/shelltests/htools-text-backend.test \
858 test/data/bdev-drbd-8.0.txt \
859 test/data/bdev-drbd-8.3.txt \
860 test/data/bdev-drbd-disk.txt \
861 test/data/bdev-drbd-net-ip4.txt \
862 test/data/bdev-drbd-net-ip6.txt \
863 test/data/cert1.pem \
864 test/data/cert2.pem \
865 test/data/ip-addr-show-dummy0.txt \
866 test/data/ip-addr-show-lo-ipv4.txt \
867 test/data/ip-addr-show-lo-ipv6.txt \
868 test/data/ip-addr-show-lo-oneline-ipv4.txt \
869 test/data/ip-addr-show-lo-oneline-ipv6.txt \
870 test/data/ip-addr-show-lo-oneline.txt \
871 test/data/ip-addr-show-lo.txt \
872 test/data/kvm_0.12.5_help.txt \
873 test/data/kvm_0.15.90_help.txt \
874 test/data/kvm_0.9.1_help.txt \
875 test/data/kvm_1.0_help.txt \
876 test/data/ovfdata/compr_disk.vmdk.gz \
877 test/data/ovfdata/config.ini \
878 test/data/ovfdata/corrupted_resources.ovf \
879 test/data/ovfdata/empty.ini \
880 test/data/ovfdata/empty.ovf \
881 test/data/ovfdata/ganeti.mf \
882 test/data/ovfdata/ganeti.ovf \
883 test/data/ovfdata/gzip_disk.ovf \
884 test/data/ovfdata/new_disk.vmdk \
885 test/data/ovfdata/no_disk.ini \
886 test/data/ovfdata/no_disk_in_ref.ovf \
887 test/data/ovfdata/no_os.ini \
888 test/data/ovfdata/no_ovf.ova \
889 test/data/ovfdata/other/rawdisk.raw \
890 test/data/ovfdata/ova.ova \
891 test/data/ovfdata/rawdisk.raw \
892 test/data/ovfdata/second_disk.vmdk \
893 test/data/ovfdata/unsafe_path.ini \
894 test/data/ovfdata/virtualbox.ovf \
895 test/data/ovfdata/wrong_config.ini \
896 test/data/ovfdata/wrong_extension.ovd \
897 test/data/ovfdata/wrong_manifest.mf \
898 test/data/ovfdata/wrong_manifest.ovf \
899 test/data/ovfdata/wrong_ova.ova \
900 test/data/ovfdata/wrong_xml.ovf \
901 test/data/proc_drbd8.txt \
902 test/data/proc_drbd80-emptyline.txt \
903 test/data/proc_drbd83.txt \
904 test/data/proc_drbd83_sync.txt \
905 test/data/proc_drbd83_sync_want.txt \
906 test/data/proc_drbd83_sync_krnl2.6.39.txt \
907 test/data/sys_drbd_usermode_helper.txt \
908 test/data/vgreduce-removemissing-2.02.02.txt \
909 test/data/vgreduce-removemissing-2.02.66-fail.txt \
910 test/data/vgreduce-removemissing-2.02.66-ok.txt \
911 test/data/vgs-missing-pvs-2.02.02.txt \
912 test/data/vgs-missing-pvs-2.02.66.txt \
913 test/ganeti-cli.test \
915 test/import-export_unittest-helper
918 doc/examples/rapi_testutils.py \
919 test/cfgupgrade_unittest.py \
920 test/docs_unittest.py \
921 test/ganeti.asyncnotifier_unittest.py \
922 test/ganeti.backend_unittest-runasroot.py \
923 test/ganeti.backend_unittest.py \
924 test/ganeti.bdev_unittest.py \
925 test/ganeti.cli_unittest.py \
926 test/ganeti.client.gnt_cluster_unittest.py \
927 test/ganeti.client.gnt_instance_unittest.py \
928 test/ganeti.client.gnt_job_unittest.py \
929 test/ganeti.cmdlib_unittest.py \
930 test/ganeti.compat_unittest.py \
931 test/ganeti.confd.client_unittest.py \
932 test/ganeti.config_unittest.py \
933 test/ganeti.constants_unittest.py \
934 test/ganeti.daemon_unittest.py \
935 test/ganeti.errors_unittest.py \
936 test/ganeti.hooks_unittest.py \
937 test/ganeti.ht_unittest.py \
938 test/ganeti.http_unittest.py \
939 test/ganeti.hypervisor.hv_chroot_unittest.py \
940 test/ganeti.hypervisor.hv_fake_unittest.py \
941 test/ganeti.hypervisor.hv_kvm_unittest.py \
942 test/ganeti.hypervisor.hv_lxc_unittest.py \
943 test/ganeti.hypervisor.hv_xen_unittest.py \
944 test/ganeti.hypervisor_unittest.py \
945 test/ganeti.impexpd_unittest.py \
946 test/ganeti.jqueue_unittest.py \
947 test/ganeti.jstore_unittest.py \
948 test/ganeti.locking_unittest.py \
949 test/ganeti.luxi_unittest.py \
950 test/ganeti.masterd.iallocator_unittest.py \
951 test/ganeti.masterd.instance_unittest.py \
952 test/ganeti.mcpu_unittest.py \
953 test/ganeti.netutils_unittest.py \
954 test/ganeti.objects_unittest.py \
955 test/ganeti.objectutils_unittest.py \
956 test/ganeti.opcodes_unittest.py \
957 test/ganeti.ovf_unittest.py \
958 test/ganeti.qlang_unittest.py \
959 test/ganeti.query_unittest.py \
960 test/ganeti.rapi.baserlib_unittest.py \
961 test/ganeti.rapi.client_unittest.py \
962 test/ganeti.rapi.resources_unittest.py \
963 test/ganeti.rapi.rlib2_unittest.py \
964 test/ganeti.rapi.testutils_unittest.py \
965 test/ganeti.rpc_unittest.py \
966 test/ganeti.runtime_unittest.py \
967 test/ganeti.serializer_unittest.py \
968 test/ganeti.server.rapi_unittest.py \
969 test/ganeti.ssconf_unittest.py \
970 test/ganeti.ssh_unittest.py \
971 test/ganeti.storage_unittest.py \
972 test/ganeti.tools.ensure_dirs_unittest.py \
973 test/ganeti.tools.prepare_node_join_unittest.py \
974 test/ganeti.uidpool_unittest.py \
975 test/ganeti.utils.algo_unittest.py \
976 test/ganeti.utils.filelock_unittest.py \
977 test/ganeti.utils.hash_unittest.py \
978 test/ganeti.utils.io_unittest-runasroot.py \
979 test/ganeti.utils.io_unittest.py \
980 test/ganeti.utils.log_unittest.py \
981 test/ganeti.utils.mlock_unittest.py \
982 test/ganeti.utils.nodesetup_unittest.py \
983 test/ganeti.utils.process_unittest.py \
984 test/ganeti.utils.retry_unittest.py \
985 test/ganeti.utils.text_unittest.py \
986 test/ganeti.utils.wrapper_unittest.py \
987 test/ganeti.utils.x509_unittest.py \
988 test/ganeti.utils_unittest.py \
989 test/ganeti.vcluster_unittest.py \
990 test/ganeti.workerpool_unittest.py \
991 test/pycurl_reset_unittest.py \
992 test/qa.qa_config_unittest.py \
993 test/tempfile_fork_unittest.py
995 haskell_tests = htest/test
998 test/check-cert-expired_unittest.bash \
999 test/daemon-util_unittest.bash \
1000 test/ganeti-cleaner_unittest.bash \
1001 test/import-export_unittest.bash \
1002 test/cli-test.bash \
1003 test/bash_completion.bash \
1010 nodist_TESTS += $(haskell_tests)
1011 dist_TESTS += htest/offline-test.sh
1012 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1015 TESTS = $(dist_TESTS) $(nodist_TESTS)
1017 # Environment for all tests
1018 PLAIN_TESTS_ENVIRONMENT = \
1020 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1021 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1024 # Environment for tests run by automake
1025 TESTS_ENVIRONMENT = \
1026 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1029 $(dist_sbin_SCRIPTS) \
1031 $(pkglib_python_scripts) \
1032 $(nodist_pkglib_python_scripts) \
1034 $(pkgpython_PYTHON) \
1036 $(hypervisor_PYTHON) \
1051 test/check-cert-expired_unittest.bash \
1052 test/daemon-util_unittest.bash \
1053 test/ganeti-cleaner_unittest.bash \
1054 test/import-export_unittest.bash \
1055 test/cli-test.bash \
1056 test/bash_completion.bash \
1057 htest/offline-test.sh \
1058 htest/cli-tests-defs.sh \
1059 $(all_python_code) \
1060 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
1062 check_python_code = \
1063 $(BUILD_BASH_COMPLETION) \
1069 lint_python_code = \
1071 ganeti/http/server.py \
1072 $(dist_sbin_SCRIPTS) \
1074 $(pkglib_python_scripts) \
1075 $(BUILD_BASH_COMPLETION) \
1081 standalone_python_modules = \
1082 lib/rapi/client.py \
1083 tools/ganeti-listrunner
1085 pep8_python_code = \
1087 ganeti/http/server.py \
1088 $(dist_sbin_SCRIPTS) \
1090 $(pkglib_python_scripts) \
1091 $(BUILD_BASH_COMPLETION) \
1094 $(PYTHON_BOOTSTRAP) \
1097 test/daemon-util_unittest.bash: daemons/daemon-util
1099 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1101 test/bash_completion.bash: doc/examples/bash_completion-debug
1103 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1104 sed -f $(REPLACE_VARS_SED) < $< > $@
1107 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1108 sed -f $(REPLACE_VARS_SED) < $< > $@
1111 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1112 sed -f $(REPLACE_VARS_SED) < $< > $@
1115 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1116 sed -f $(REPLACE_VARS_SED) < $< > $@
1118 doc/examples/bash_completion: BC_ARGS = --compact
1119 doc/examples/bash_completion-debug: BC_ARGS =
1121 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1122 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1123 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1124 daemons/ganeti-cleaner \
1125 $(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1126 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1127 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1129 doc/%.png: doc/%.dot
1130 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1131 $(DOT) -Tpng -o $@ $<
1133 man/footer.man: man/footer.rst
1134 @test -n "$(PANDOC)" || \
1135 { echo 'pandoc' not found during configure; exit 1; }
1136 $(PANDOC) -f rst -t man -o $@ $<
1138 man/footer.html: man/footer.rst
1139 @test -n "$(PANDOC)" || \
1140 { echo 'pandoc' not found during configure; exit 1; }
1141 $(PANDOC) -f rst -t html -o $@ $<
1143 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1144 lib/build/shell_example_lexer.py \
1145 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1146 @echo "Checking $< for hardcoded paths..."
1147 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1148 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1152 trap 'echo auto-removing $@; rm $@' EXIT; \
1153 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1156 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1157 @test -n "$(PANDOC)" || \
1158 { echo 'pandoc' not found during configure; exit 1; }
1160 trap 'echo auto-removing $@; rm $@' EXIT; \
1161 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1162 sed -e 's/\\@/@/g' > $@; \
1163 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1164 $(CHECK_MAN_DASHES) $@; \
1168 man/%.html.in: man/%.gen man/footer.html
1169 @test -n "$(PANDOC)" || \
1170 { echo 'pandoc' not found during configure; exit 1; }
1172 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1173 sed -e 's/\\@/@/g' > $@
1175 man/%: man/%.in $(REPLACE_VARS_SED)
1176 sed -f $(REPLACE_VARS_SED) < $< > $@
1178 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1179 sed -f $(REPLACE_VARS_SED) < $< > $@
1182 if test -d .git; then \
1183 git describe > $@; \
1184 elif test ! -f $@ ; then \
1185 echo "Cannot auto-generate $@ file"; exit 1; \
1188 .PHONY: clean-vcs-version
1192 .PHONY: regen-vcs-version
1196 if test -d .git; then \
1197 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1198 git describe > $$T; \
1199 if ! cmp --quiet $$T vcs-version; then \
1200 mv $$T vcs-version; \
1204 htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1205 vcs-version $(built_base_sources)
1207 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1208 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1210 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1211 lib/constants.py lib/_autoconf.py lib/luxi.py \
1212 $(CONVERT_CONSTANTS) $(built_base_sources) \
1213 | lib/_vcsversion.py
1215 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1217 htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1218 $(built_base_sources)
1222 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1223 echo "import $$name ()" ; \
1227 lib/_autoconf.py: Makefile | stamp-directories
1229 { echo '# This file is automatically generated, do not edit!'; \
1232 echo '"""Build-time configuration for Ganeti.'; \
1234 echo 'This file is autogenerated by the build process.'; \
1235 echo 'For any changes you need to re-run ./configure (and'; \
1236 echo 'not edit by hand).'; \
1240 echo '# pylint: disable=C0301,C0324'; \
1241 echo '# because this is autogenerated, we do not want'; \
1242 echo '# style warnings' ; \
1244 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1245 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1246 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1247 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1248 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1249 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1250 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1251 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1252 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1253 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1254 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1255 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1256 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1257 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1258 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1259 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1260 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1261 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1262 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1263 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1264 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1265 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1266 echo "KVM_PATH = '$(KVM_PATH)'"; \
1267 echo "IP_PATH = '$(IP_PATH)'"; \
1268 echo "SOCAT_PATH = '$(SOCAT)'"; \
1269 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1270 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1271 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1272 echo "TOOLSDIR = '$(toolsdir)'"; \
1273 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1274 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1275 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1276 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1277 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1278 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1279 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1280 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1281 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1282 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1283 echo "RAPI_USER = '$(RAPI_USER)'"; \
1284 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1285 echo "CONFD_USER = '$(CONFD_USER)'"; \
1286 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1287 echo "NODED_USER = '$(NODED_USER)'"; \
1288 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1289 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1290 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1291 echo "HTOOLS = True"; \
1292 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1293 echo "XEN_CMD = '$(XEN_CMD)'"; \
1294 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1295 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1298 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1300 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1301 { echo '# This file is automatically generated, do not edit!'; \
1304 echo '"""Build-time VCS version number for Ganeti.'; \
1306 echo 'This file is autogenerated by the build process.'; \
1307 echo 'For any changes you need to re-run ./configure (and'; \
1308 echo 'not edit by hand).'; \
1312 echo '# pylint: disable=C0301,C0324'; \
1313 echo '# because this is autogenerated, we do not want'; \
1314 echo '# style warnings' ; \
1316 echo "VCS_VERSION = '$$VCSVER'"; \
1319 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1320 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1322 $(SHELL_ENV_INIT): Makefile stamp-directories
1324 { echo '# Allow overriding for tests'; \
1325 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1326 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1328 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1329 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1330 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1331 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1332 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1335 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1337 { echo 's#@PREFIX@#$(prefix)#g'; \
1338 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1339 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1340 echo 's#@BINDIR@#$(bindir)#g'; \
1341 echo 's#@SBINDIR@#$(sbindir)#g'; \
1342 echo 's#@LIBDIR@#$(libdir)#g'; \
1343 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1344 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1345 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1346 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1347 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1348 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1349 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1350 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1351 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1352 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1353 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1354 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1355 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1356 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1357 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1358 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1359 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1360 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1361 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1362 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1363 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1365 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1366 echo ' r $(SHELL_ENV_INIT)'; \
1371 # Using deferred evaluation
1372 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1373 daemons/ganeti-watcher: MODULE = ganeti.watcher
1374 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1375 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1376 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1377 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1379 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1380 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1382 { echo '#!/usr/bin/python'; \
1383 echo '# This file is automatically generated, do not edit!'; \
1384 echo "# Edit $(MODULE) instead."; \
1386 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1388 echo '# pylint: disable=C0103'; \
1389 echo '# C0103: Invalid name'; \
1391 echo 'import sys'; \
1392 echo 'import $(MODULE) as main'; \
1394 echo '# Temporarily alias commands until bash completion'; \
1395 echo '# generator is changed'; \
1396 echo 'if hasattr(main, "commands"):'; \
1397 echo ' commands = main.commands # pylint: disable=E1101'; \
1398 echo 'if hasattr(main, "aliases"):'; \
1399 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1401 echo 'if __name__ == "__main__":'; \
1402 echo ' sys.exit(main.Main())'; \
1406 $(HS_BUILT_TEST_HELPERS): Makefile
1407 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1409 { echo '#!/bin/sh'; \
1410 echo '# This file is automatically generated, do not edit!'; \
1411 echo "# Edit Makefile.am instead."; \
1413 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1417 stamp-directories: Makefile
1418 $(MAKE) $(AM_MAKEFLAGS) ganeti
1419 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1422 # We need to create symlinks because "make distcheck" will not install Python
1423 # files when building.
1424 stamp-srclinks: Makefile | stamp-directories
1426 for i in $(srclink_files); do \
1427 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1428 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1435 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1438 check-dirs: $(GENERATED_FILES)
1440 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1442 while read dir; do \
1444 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1445 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1448 for dir in $(DIRS); do \
1449 if ! test -d "$$dir"; then \
1450 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1454 test -z "$$error"; \
1458 check-local: check-dirs $(GENERATED_FILES)
1459 $(CHECK_PYTHON_CODE) $(check_python_code)
1460 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1461 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1462 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1463 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1464 @expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1465 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1466 echo "Incorrect version in README, expected $$expver"; \
1469 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1470 doc/security.rst; do \
1471 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1472 "Documents Ganeti version $$expver"; then \
1473 echo "Incorrect version in $$file, expected $$expver"; \
1477 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1478 echo "File $(top_srcdir)/doc/design-$$expver.rst not found"; \
1482 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1483 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1484 echo "Longest line in $$file is longer than 80 characters" >&2; \
1491 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1494 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1496 # E111: indentation is not a multiple of four
1497 # E121: continuation line indentation is not a multiple of four
1498 # (since our indent level is not 4)
1499 # E125: continuation line does not distinguish itself from next logical line
1500 # (since our indent level is not 4)
1501 # E127: continuation line over-indented for visual indent
1502 # (since our indent level is not 4)
1503 # note: do NOT add E128 here; it's a valid style error in most cases!
1504 # I've seen real errors, but also some cases were we indent wrongly
1505 # due to line length; try to rework the cases where it is triggered,
1506 # instead of silencing it
1507 # E261: at least two spaces before inline comment
1508 # E501: line too long (80 characters)
1509 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1511 # For excluding pep8 expects filenames only, not whole paths
1512 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1514 LINT_TARGETS = pylint pylint-qa
1516 LINT_TARGETS += pep8
1519 LINT_TARGETS += hlint
1523 lint: $(LINT_TARGETS)
1526 pylint: $(GENERATED_FILES)
1527 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1528 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1531 pylint-qa: $(GENERATED_FILES)
1532 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1533 cd $(top_srcdir)/qa && \
1534 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1535 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1538 pep8: $(GENERATED_FILES)
1539 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1540 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1541 --repeat $(pep8_python_code)
1543 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1544 HLINT_EXCLUDES = htools/Ganeti/THH.hs htest/hpc-htools.hs
1546 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1547 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1548 if tty -s; then C="-c"; else C=""; fi; \
1549 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1550 --ignore "Use first" \
1551 --ignore "Use comparing" \
1553 --ignore "Reduce duplication" \
1554 --ignore "Use &&&" \
1555 --ignore "Use void" \
1556 --hint htools/lint-hints \
1557 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1559 # a dist hook rule for updating the vcs-version file; this is
1560 # hardcoded due to where it needs to build the file...
1562 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1563 rm -f $(top_distdir)/vcs-version
1564 cp -p $(srcdir)/vcs-version $(top_distdir)
1566 # a distcheck hook rule for catching revision control directories
1568 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1569 echo "Found revision control files in final archive." 1>&2; \
1572 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1573 echo "Found Python byte code in final archive." 1>&2; \
1576 if find $(top_distdir) -name '*~' | grep .; then \
1577 echo "Found backup files in final archive." 1>&2; \
1580 # Empty files or directories should not be distributed. They can cause
1581 # unnecessary warnings for packagers. Directories used by automake during
1582 # distcheck must be excluded.
1583 if find $(top_distdir) -empty -and -not \( \
1584 -path $(top_distdir)/_build -or \
1585 -path $(top_distdir)/_inst \) | grep .; then \
1586 echo "Found empty files or directories in final archive." 1>&2; \
1589 if test -n "$(BUILD_RELEASE)" && \
1590 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1591 echo "Found unreleased version in NEWS." >&2; \
1595 # When building a release, stricter checks should be used
1596 distcheck-release dist-release: export BUILD_RELEASE = 1
1597 distcheck-release: distcheck
1599 distrebuildcheck: dist
1601 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1602 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1604 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1607 $(MAKE) maintainer-clean; \
1608 cp $(abs_srcdir)/vcs-version .; \
1610 $(MAKE) $(AM_MAKEFLAGS)
1614 for i in $(DIST_ARCHIVES); do \
1615 echo -n "Checking $$i ... "; \
1616 autotools/check-tar < $$i; \
1621 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1622 "$(DESTDIR)${localstatedir}/log/ganeti" \
1623 "$(DESTDIR)${localstatedir}/run/ganeti"
1626 if WANT_HTOOLSAPIDOC
1627 apidoc: py-apidoc hs-apidoc
1633 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1634 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
1635 $(RUN_IN_TEMPDIR) epydoc -v \
1636 --conf $(CURDIR)/epydoc.conf \
1637 --output $(CURDIR)/$(APIDOC_PY_DIR)
1640 hs-apidoc: $(HS_BUILT_SRCS)
1641 @test -n "$(HSCOLOUR)" || \
1642 { echo 'HsColour' not found during configure; exit 1; }
1643 @test -n "$(HADDOCK)" || \
1644 { echo 'haddock' not found during configure; exit 1; }
1645 rm -rf $(APIDOC_HS_DIR)/*
1646 for i in $(ALL_APIDOC_HS_DIRS); do \
1649 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1650 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1651 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1654 if [ "$(HTOOLS_NOCURL)" ]; \
1655 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1658 if [ "$(HTOOLS_PARALLEL3)" ]; \
1659 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1661 if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1662 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1664 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1665 for file in $$RELSRCS; do \
1666 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1667 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1669 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1670 -t ganeti -p haddock-prologue \
1671 --source-module="%{MODULE/.//}.html" \
1672 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1674 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1677 TAGS: $(GENERATED_FILES)
1679 $(GHC) -e ":etags" -v0 \
1680 $(filter-out -O -Werror,$(HFLAGS)) \
1681 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1683 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1684 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1685 -path './qa/*.py' | \
1686 etags -l python -a -
1690 coverage: py-coverage hs-coverage
1692 coverage: py-coverage
1696 py-coverage: $(GENERATED_FILES) $(python_tests)
1697 @test -n "$(PYCOVERAGE)" || \
1698 { echo 'python-coverage' not found during configure; exit 1; }
1700 COVERAGE=$(PYCOVERAGE) \
1701 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1702 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1703 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1704 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1708 hs-coverage: $(haskell_tests) htest/hpc-htools
1710 $(MAKE) $(AM_MAKEFLAGS) hs-check
1711 @mkdir_p@ $(COVERAGE_HS_DIR)
1712 hpc combine --union $(HPCEXCL) \
1713 test.tix hpc-htools.tix > coverage-htools.tix
1714 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1715 hpc report coverage-htools.tix
1716 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1718 # Special "kind-of-QA" target for htools, needs special setup (all
1719 # tools compiled with -fhpc)
1724 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1725 rm -f *.tix *.mix; \
1727 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1728 --output=live-test.tix ; \
1729 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1730 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1731 --srcdir=.. $(HPCEXCL) ; \
1732 hpc report --srcdir=.. live-test $(HPCEXCL)
1734 commit-check: distcheck lint apidoc
1736 .PHONY: gitignore-check
1738 @if [ -n "`git status --short`" ]; then \
1739 echo "Git status is not clean!" 1>&2 ; \
1740 git status --short; \
1744 # Target that builds all binaries (including those that are not
1745 # rebuilt except when running the tests)
1747 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
1749 # we don't need the ancient implicit rules:
1756 -include ./Makefile.local