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/DataCollectors \
64 htools/Ganeti/HTools \
65 htools/Ganeti/HTools/Backend \
66 htools/Ganeti/HTools/Program \
71 htest/Test/Ganeti/Block \
72 htest/Test/Ganeti/Block/Drbd \
73 htest/Test/Ganeti/Confd \
74 htest/Test/Ganeti/HTools \
75 htest/Test/Ganeti/HTools/Backend \
76 htest/Test/Ganeti/Query
85 doc/examples/gnt-debug \
108 test/data/ovfdata/other \
111 ALL_APIDOC_HS_DIRS = \
113 $(APIDOC_HS_DIR)/Ganeti \
114 $(APIDOC_HS_DIR)/Ganeti/Block \
115 $(APIDOC_HS_DIR)/Ganeti/Block/Drbd \
116 $(APIDOC_HS_DIR)/Ganeti/Confd \
117 $(APIDOC_HS_DIR)/Ganeti/DataCollectors \
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
123 BUILDTIME_DIR_AUTOCREATE = \
126 $(ALL_APIDOC_HS_DIRS) \
134 $(BUILDTIME_DIR_AUTOCREATE) \
139 ganeti-[0-9]*.[0-9]*.[0-9]* \
144 COVERAGE_DIR = doc/coverage
145 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
146 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
148 APIDOC_PY_DIR = $(APIDOC_DIR)/py
149 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
151 MAINTAINERCLEANFILES = \
154 doc/install-quick.rst \
159 maintainer-clean-local:
160 rm -rf $(BUILDTIME_DIRS)
163 $(addsuffix /*.py[co],$(DIRS)) \
164 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
165 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
166 $(PYTHON_BOOTSTRAP) \
168 $(REPLACE_VARS_SED) \
170 daemons/daemon-util \
171 daemons/ganeti-cleaner \
173 doc/examples/bash_completion \
174 doc/examples/bash_completion-debug \
175 lib/_generated_rpc.py \
179 tools/vcluster-setup \
182 $(nodist_pkgpython_PYTHON) \
183 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
184 $(HS_BUILT_TEST_HELPERS) \
185 htools/ganeti-confd \
186 .hpc/*.mix htools/*.tix htest/*.tix \
190 $(built_base_sources) \
191 $(BUILT_PYTHON_SOURCES) \
194 HTOOLS_GENERATED_FILES =
196 HTOOLS_GENERATED_FILES += $(HS_PROGS)
198 HTOOLS_GENERATED_FILES += htools/hconfd htools/ganeti-confd
202 built_base_sources = \
206 built_python_base_sources = \
210 BUILT_PYTHON_SOURCES = \
211 $(built_python_base_sources) \
212 lib/_generated_rpc.py
214 # Generating the RPC wrappers depends on many things, so make sure
215 # it's built at the end of the built sources
216 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
218 # these are all built from the underlying %.in sources
220 doc/examples/ganeti-kvm-poweroff.initd \
221 doc/examples/ganeti.cron \
222 doc/examples/ganeti.initd \
223 doc/examples/ganeti-master-role.ocf \
224 doc/examples/ganeti-node-role.ocf \
225 doc/examples/gnt-config-backup \
226 doc/examples/hooks/ipsec
228 nodist_pkgpython_PYTHON = \
229 $(BUILT_PYTHON_SOURCES)
232 lib/build/__init__.py \
233 lib/build/shell_example_lexer.py \
234 lib/build/sphinx_ext.py
238 lib/asyncnotifier.py \
276 lib/client/__init__.py \
277 lib/client/gnt_backup.py \
278 lib/client/gnt_cluster.py \
279 lib/client/gnt_debug.py \
280 lib/client/gnt_group.py \
281 lib/client/gnt_instance.py \
282 lib/client/gnt_job.py \
283 lib/client/gnt_node.py \
284 lib/client/gnt_network.py \
287 hypervisor_PYTHON = \
288 lib/hypervisor/__init__.py \
289 lib/hypervisor/hv_base.py \
290 lib/hypervisor/hv_chroot.py \
291 lib/hypervisor/hv_fake.py \
292 lib/hypervisor/hv_kvm.py \
293 lib/hypervisor/hv_lxc.py \
294 lib/hypervisor/hv_xen.py
297 lib/rapi/__init__.py \
298 lib/rapi/baserlib.py \
300 lib/rapi/client_utils.py \
301 lib/rapi/connector.py \
303 lib/rapi/testutils.py
306 lib/http/__init__.py \
312 lib/confd/__init__.py \
316 lib/masterd/__init__.py \
317 lib/masterd/iallocator.py \
318 lib/masterd/instance.py
321 lib/impexpd/__init__.py
324 lib/watcher/__init__.py \
325 lib/watcher/nodemaint.py \
329 lib/server/__init__.py \
330 lib/server/masterd.py \
331 lib/server/noded.py \
335 lib/tools/__init__.py \
336 lib/tools/ensure_dirs.py \
337 lib/tools/node_cleanup.py \
338 lib/tools/node_daemon_setup.py \
339 lib/tools/prepare_node_join.py
342 lib/utils/__init__.py \
344 lib/utils/filelock.py \
349 lib/utils/nodesetup.py \
350 lib/utils/process.py \
353 lib/utils/wrapper.py \
358 doc/cluster-merge.rst \
367 doc/design-autorepair.rst \
368 doc/design-bulk-create.rst \
369 doc/design-chained-jobs.rst \
370 doc/design-cpu-pinning.rst \
371 doc/design-draft.rst \
372 doc/design-htools-2.3.rst \
373 doc/design-http-server.rst \
374 doc/design-impexp2.rst \
375 doc/design-lu-generated-jobs.rst \
376 doc/design-linuxha.rst \
377 doc/design-multi-reloc.rst \
378 doc/design-network.rst \
379 doc/design-node-add.rst \
381 doc/design-ovf-support.rst \
382 doc/design-opportunistic-locking.rst \
383 doc/design-partitioned.rst \
384 doc/design-query-splitting.rst \
385 doc/design-query2.rst \
386 doc/design-remote-commands.rst \
387 doc/design-resource-model.rst \
388 doc/design-shared-storage.rst \
389 doc/design-monitoring-agent.rst \
390 doc/design-virtual-clusters.rst \
391 doc/design-x509-ca.rst \
397 doc/install-quick.rst \
400 doc/move-instance.rst \
402 doc/ovfconverter.rst \
406 doc/virtual-cluster.rst \
409 HS_PROGS = htools/htools htools/mon-collector
410 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
411 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
416 htest/hpc-mon-collector \
421 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
422 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
425 -O -Wall -Werror -ihtools \
426 -fwarn-monomorphism-restriction \
428 $(GHC_BYVERSION_FLAGS)
430 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
432 # internal extra flags (used for htest/test mainly)
434 # exclude options for coverage reports
435 HPCEXCL = --exclude Main \
436 --exclude Ganeti.Constants \
437 --exclude Ganeti.HTools.QC \
438 --exclude Ganeti.THH \
439 --exclude Ganeti.Version \
440 --exclude Test.Ganeti.Attoparsec \
441 --exclude Test.Ganeti.TestCommon \
442 --exclude Test.Ganeti.TestHTools \
443 --exclude Test.Ganeti.TestHelper \
444 --exclude Test.Ganeti.TestImports \
445 $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
448 htools/Ganeti/Block/Drbd/Types.hs \
449 htools/Ganeti/Block/Drbd/Parser.hs \
450 htools/Ganeti/BasicTypes.hs \
451 htools/Ganeti/Common.hs \
452 htools/Ganeti/Compat.hs \
453 htools/Ganeti/Confd/Server.hs \
454 htools/Ganeti/Confd/Types.hs \
455 htools/Ganeti/Confd/Utils.hs \
456 htools/Ganeti/Config.hs \
457 htools/Ganeti/Daemon.hs \
458 htools/Ganeti/DataCollectors/Drbd.hs \
459 htools/Ganeti/DataCollectors/Program.hs \
460 htools/Ganeti/Errors.hs \
461 htools/Ganeti/HTools/Backend/IAlloc.hs \
462 htools/Ganeti/HTools/Backend/Luxi.hs \
463 htools/Ganeti/HTools/Backend/Rapi.hs \
464 htools/Ganeti/HTools/Backend/Simu.hs \
465 htools/Ganeti/HTools/Backend/Text.hs \
466 htools/Ganeti/HTools/CLI.hs \
467 htools/Ganeti/HTools/Cluster.hs \
468 htools/Ganeti/HTools/Container.hs \
469 htools/Ganeti/HTools/ExtLoader.hs \
470 htools/Ganeti/HTools/Graph.hs \
471 htools/Ganeti/HTools/Group.hs \
472 htools/Ganeti/HTools/Instance.hs \
473 htools/Ganeti/HTools/Loader.hs \
474 htools/Ganeti/HTools/Node.hs \
475 htools/Ganeti/HTools/PeerMap.hs \
476 htools/Ganeti/HTools/Program.hs \
477 htools/Ganeti/HTools/Program/Hail.hs \
478 htools/Ganeti/HTools/Program/Hbal.hs \
479 htools/Ganeti/HTools/Program/Hcheck.hs \
480 htools/Ganeti/HTools/Program/Hinfo.hs \
481 htools/Ganeti/HTools/Program/Hscan.hs \
482 htools/Ganeti/HTools/Program/Hspace.hs \
483 htools/Ganeti/HTools/Types.hs \
484 htools/Ganeti/Hash.hs \
485 htools/Ganeti/JSON.hs \
486 htools/Ganeti/Jobs.hs \
487 htools/Ganeti/Logging.hs \
488 htools/Ganeti/Luxi.hs \
489 htools/Ganeti/Network.hs \
490 htools/Ganeti/Objects.hs \
491 htools/Ganeti/OpCodes.hs \
492 htools/Ganeti/OpParams.hs \
493 htools/Ganeti/Path.hs \
494 htools/Ganeti/Query/Common.hs \
495 htools/Ganeti/Query/Filter.hs \
496 htools/Ganeti/Query/Group.hs \
497 htools/Ganeti/Query/Language.hs \
498 htools/Ganeti/Query/Node.hs \
499 htools/Ganeti/Query/Query.hs \
500 htools/Ganeti/Query/Server.hs \
501 htools/Ganeti/Query/Types.hs \
502 htools/Ganeti/Rpc.hs \
503 htools/Ganeti/Runtime.hs \
504 htools/Ganeti/Ssconf.hs \
505 htools/Ganeti/THH.hs \
506 htools/Ganeti/Types.hs \
507 htools/Ganeti/Utils.hs
510 htest/Test/Ganeti/Attoparsec.hs \
511 htest/Test/Ganeti/BasicTypes.hs \
512 htest/Test/Ganeti/Block/Drbd/Parser.hs \
513 htest/Test/Ganeti/Block/Drbd/Types.hs \
514 htest/Test/Ganeti/Common.hs \
515 htest/Test/Ganeti/Confd/Utils.hs \
516 htest/Test/Ganeti/Daemon.hs \
517 htest/Test/Ganeti/Errors.hs \
518 htest/Test/Ganeti/HTools/Backend/Simu.hs \
519 htest/Test/Ganeti/HTools/Backend/Text.hs \
520 htest/Test/Ganeti/HTools/CLI.hs \
521 htest/Test/Ganeti/HTools/Cluster.hs \
522 htest/Test/Ganeti/HTools/Container.hs \
523 htest/Test/Ganeti/HTools/Graph.hs \
524 htest/Test/Ganeti/HTools/Instance.hs \
525 htest/Test/Ganeti/HTools/Loader.hs \
526 htest/Test/Ganeti/HTools/Node.hs \
527 htest/Test/Ganeti/HTools/PeerMap.hs \
528 htest/Test/Ganeti/HTools/Types.hs \
529 htest/Test/Ganeti/JSON.hs \
530 htest/Test/Ganeti/Jobs.hs \
531 htest/Test/Ganeti/Luxi.hs \
532 htest/Test/Ganeti/Network.hs \
533 htest/Test/Ganeti/Objects.hs \
534 htest/Test/Ganeti/OpCodes.hs \
535 htest/Test/Ganeti/Query/Filter.hs \
536 htest/Test/Ganeti/Query/Language.hs \
537 htest/Test/Ganeti/Query/Query.hs \
538 htest/Test/Ganeti/Rpc.hs \
539 htest/Test/Ganeti/Ssconf.hs \
540 htest/Test/Ganeti/THH.hs \
541 htest/Test/Ganeti/TestCommon.hs \
542 htest/Test/Ganeti/TestHTools.hs \
543 htest/Test/Ganeti/TestHelper.hs \
544 htest/Test/Ganeti/Types.hs \
545 htest/Test/Ganeti/Utils.hs
547 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
550 htest/Test/Ganeti/TestImports.hs \
551 htools/Ganeti/Constants.hs \
552 htools/Ganeti/Version.hs
553 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
555 $(RUN_IN_TEMPDIR): | stamp-directories
557 # Note: we use here an order-only prerequisite, as the contents of
558 # _autoconf.py are not actually influencing the html build output: it
559 # has to exist in order for the sphinx module to be loaded
560 # successfully, but we certainly don't want the docs to be rebuilt if
562 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
563 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
564 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
565 | $(BUILT_PYTHON_SOURCES)
566 @test -n "$(SPHINX)" || \
567 { echo 'sphinx-build' not found during configure; exit 1; }
569 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
571 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
572 -D release="$(PACKAGE_VERSION)" \
573 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
574 rm -f doc/html/.buildinfo doc/html/objects.inv
577 doc/html: doc/html/index.html
579 doc/install-quick.rst: INSTALL
581 doc/upgrade.rst: UPGRADE
583 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
585 { echo '.. This file is automatically updated at build time from $<.'; \
586 echo '.. Do not edit.'; \
593 doc/design-2.1-lock-acquire.dot \
594 doc/design-2.1-lock-release.dot
596 docpng = $(patsubst %.dot,%.png,$(docdot))
598 # Things to build but not to install (add it to EXTRA_DIST if it should be
603 doc/examples/bash_completion \
604 doc/examples/bash_completion-debug \
609 scripts/gnt-cluster \
612 scripts/gnt-instance \
614 scripts/gnt-network \
618 PYTHON_BOOTSTRAP_SBIN = \
619 daemons/ganeti-masterd \
620 daemons/ganeti-noded \
621 daemons/ganeti-rapi \
622 daemons/ganeti-watcher \
626 $(PYTHON_BOOTSTRAP_SBIN) \
629 tools/node-daemon-setup \
630 tools/prepare-node-join
651 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
653 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
654 # FIXME: this is a hardcoded logic, instead of auto-resolving
655 $(LN_S) -f ../../../bin/htools \
656 $(DESTDIR)$(iallocatorsdir)/hail
657 for role in $(HS_BIN_ROLES); do \
658 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
662 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
663 @if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
664 echo "Error: cannot run unittests without the development" \
665 " libraries (see devnotes.rst)" 1>&2; \
668 @rm -f $(notdir $@).tix
671 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
672 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
673 $(HEXTRA) $(HEXTRA_INT) $@
676 # for the htest/test binary, we need to enable profiling/coverage
677 htest/test: HEXTRA_INT=-fhpc -ihtest
679 # we compile the hpc-htools binary with the program coverage
680 htest/hpc-htools: HEXTRA_INT=-fhpc
682 # we compile the hpc-mon-collector binary with the program coverage
683 htest/hpc-mon-collector: HEXTRA_INT=-fhpc
686 htest/offline-tests.sh: htest/hpc-htools htest/hpc-mon-collector
688 # rules for building profiling-enabled versions of the haskell
689 # programs: hs-prof does the full two-step build, whereas
690 # hs-prof-quick does only the final rebuild (hs-prof must have been
692 .PHONY: hs-prof hs-prof-quick
694 $(MAKE) $(AM_MAKEFLAGS) clean
695 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf o"
696 rm -f $(HS_ALL_PROGS)
697 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
700 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf prof_o -prof -auto-all"
702 dist_sbin_SCRIPTS = \
703 tools/ganeti-listrunner
705 nodist_sbin_SCRIPTS = \
706 $(PYTHON_BOOTSTRAP_SBIN) \
707 daemons/ganeti-cleaner
710 htools/ganeti-confd: htools/hconfd
713 nodist_sbin_SCRIPTS += htools/ganeti-confd
721 tools/cluster-merge \
725 tools/move-instance \
727 tools/sanitize-config
729 dist_tools_SCRIPTS = \
731 tools/kvm-console-wrapper \
732 tools/master-ip-setup \
733 tools/xen-console-wrapper
735 nodist_tools_python_scripts = \
738 nodist_tools_SCRIPTS = \
739 $(nodist_tools_python_scripts) \
742 pkglib_python_scripts = \
743 daemons/import-export \
744 tools/check-cert-expired
746 nodist_pkglib_python_scripts = \
748 tools/node-daemon-setup \
749 tools/prepare-node-join
751 myexeclib_SCRIPTS = \
752 daemons/daemon-util \
754 $(pkglib_python_scripts) \
757 nodist_myexeclib_SCRIPTS = \
758 $(nodist_pkglib_python_scripts)
765 autotools/build-bash-completion \
766 autotools/build-rpc \
767 autotools/check-header \
768 autotools/check-imports \
769 autotools/check-man-dashes \
770 autotools/check-man-warnings \
771 autotools/check-news \
772 autotools/check-python-code \
773 autotools/check-tar \
774 autotools/check-version \
775 autotools/convert-constants \
777 autotools/gen-coverage \
778 autotools/testrunner \
779 autotools/wrong-hardcoded-paths \
781 daemons/daemon-util.in \
782 daemons/ganeti-cleaner.in \
783 $(pkglib_python_scripts) \
786 tools/vcluster-setup.in \
792 $(BUILT_EXAMPLES:%=%.in) \
793 doc/examples/ganeti.default \
794 doc/examples/ganeti.default-debug \
795 doc/examples/hooks/ethers \
796 doc/examples/gnt-debug/README \
797 doc/examples/gnt-debug/delay0.json \
798 doc/examples/gnt-debug/delay50.json \
809 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
811 htools/lint-hints.hs \
812 htest/cli-tests-defs.sh \
813 htest/offline-test.sh \
817 man/ganeti-cleaner.8 \
819 man/ganeti-listrunner.8 \
820 man/ganeti-masterd.8 \
822 man/ganeti-os-interface.7 \
824 man/ganeti-watcher.8 \
844 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
845 manhtml = $(patsubst %.rst,%.html,$(manrst))
846 mangen = $(patsubst %.rst,%.gen,$(manrst))
848 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
849 $(patsubst %.html,%.html.in,$(manhtml)) \
850 man/footer.man man/footer.html $(mangen)
853 htest/data/common-suffix.data \
854 htest/data/hail-alloc-drbd.json \
855 htest/data/hail-change-group.json \
856 htest/data/hail-invalid-reloc.json \
857 htest/data/hail-node-evac.json \
858 htest/data/hail-reloc-drbd.json \
859 htest/data/hbal-excl-tags.data \
860 htest/data/hbal-split-insts.data \
861 htest/data/invalid-node.data \
862 htest/data/missing-resources.data \
863 htest/data/rapi/groups.json \
864 htest/data/rapi/info.json \
865 htest/data/rapi/instances.json \
866 htest/data/rapi/nodes.json \
867 htest/shelltests/htools-balancing.test \
868 htest/shelltests/htools-basic.test \
869 htest/shelltests/htools-dynutil.test \
870 htest/shelltests/htools-excl.test \
871 htest/shelltests/htools-hail.test \
872 htest/shelltests/htools-hspace.test \
873 htest/shelltests/htools-invalid.test \
874 htest/shelltests/htools-multi-group.test \
875 htest/shelltests/htools-no-backend.test \
876 htest/shelltests/htools-rapi.test \
877 htest/shelltests/htools-single-group.test \
878 htest/shelltests/htools-text-backend.test \
879 htest/shelltests/htools-mon-collector.test \
880 test/data/bdev-drbd-8.0.txt \
881 test/data/bdev-drbd-8.3.txt \
882 test/data/bdev-drbd-disk.txt \
883 test/data/bdev-drbd-net-ip4.txt \
884 test/data/bdev-drbd-net-ip6.txt \
885 test/data/cert1.pem \
886 test/data/cert2.pem \
887 test/data/ip-addr-show-dummy0.txt \
888 test/data/ip-addr-show-lo-ipv4.txt \
889 test/data/ip-addr-show-lo-ipv6.txt \
890 test/data/ip-addr-show-lo-oneline-ipv4.txt \
891 test/data/ip-addr-show-lo-oneline-ipv6.txt \
892 test/data/ip-addr-show-lo-oneline.txt \
893 test/data/ip-addr-show-lo.txt \
894 test/data/kvm_0.12.5_help.txt \
895 test/data/kvm_0.15.90_help.txt \
896 test/data/kvm_0.9.1_help.txt \
897 test/data/kvm_1.0_help.txt \
898 test/data/ovfdata/compr_disk.vmdk.gz \
899 test/data/ovfdata/config.ini \
900 test/data/ovfdata/corrupted_resources.ovf \
901 test/data/ovfdata/empty.ini \
902 test/data/ovfdata/empty.ovf \
903 test/data/ovfdata/ganeti.mf \
904 test/data/ovfdata/ganeti.ovf \
905 test/data/ovfdata/gzip_disk.ovf \
906 test/data/ovfdata/new_disk.vmdk \
907 test/data/ovfdata/no_disk.ini \
908 test/data/ovfdata/no_disk_in_ref.ovf \
909 test/data/ovfdata/no_os.ini \
910 test/data/ovfdata/no_ovf.ova \
911 test/data/ovfdata/other/rawdisk.raw \
912 test/data/ovfdata/ova.ova \
913 test/data/ovfdata/rawdisk.raw \
914 test/data/ovfdata/second_disk.vmdk \
915 test/data/ovfdata/unsafe_path.ini \
916 test/data/ovfdata/virtualbox.ovf \
917 test/data/ovfdata/wrong_config.ini \
918 test/data/ovfdata/wrong_extension.ovd \
919 test/data/ovfdata/wrong_manifest.mf \
920 test/data/ovfdata/wrong_manifest.ovf \
921 test/data/ovfdata/wrong_ova.ova \
922 test/data/ovfdata/wrong_xml.ovf \
923 test/data/proc_drbd8.txt \
924 test/data/proc_drbd80-emptyline.txt \
925 test/data/proc_drbd83.txt \
926 test/data/proc_drbd83_sync.txt \
927 test/data/proc_drbd83_sync_want.txt \
928 test/data/proc_drbd83_sync_krnl2.6.39.txt \
929 test/data/sys_drbd_usermode_helper.txt \
930 test/data/vgreduce-removemissing-2.02.02.txt \
931 test/data/vgreduce-removemissing-2.02.66-fail.txt \
932 test/data/vgreduce-removemissing-2.02.66-ok.txt \
933 test/data/vgs-missing-pvs-2.02.02.txt \
934 test/data/vgs-missing-pvs-2.02.66.txt \
935 test/ganeti-cli.test \
937 test/import-export_unittest-helper
940 doc/examples/rapi_testutils.py \
941 test/cfgupgrade_unittest.py \
942 test/docs_unittest.py \
943 test/ganeti.asyncnotifier_unittest.py \
944 test/ganeti.backend_unittest-runasroot.py \
945 test/ganeti.backend_unittest.py \
946 test/ganeti.bdev_unittest.py \
947 test/ganeti.cli_unittest.py \
948 test/ganeti.client.gnt_cluster_unittest.py \
949 test/ganeti.client.gnt_instance_unittest.py \
950 test/ganeti.client.gnt_job_unittest.py \
951 test/ganeti.cmdlib_unittest.py \
952 test/ganeti.compat_unittest.py \
953 test/ganeti.confd.client_unittest.py \
954 test/ganeti.config_unittest.py \
955 test/ganeti.constants_unittest.py \
956 test/ganeti.daemon_unittest.py \
957 test/ganeti.errors_unittest.py \
958 test/ganeti.hooks_unittest.py \
959 test/ganeti.ht_unittest.py \
960 test/ganeti.http_unittest.py \
961 test/ganeti.hypervisor.hv_chroot_unittest.py \
962 test/ganeti.hypervisor.hv_fake_unittest.py \
963 test/ganeti.hypervisor.hv_kvm_unittest.py \
964 test/ganeti.hypervisor.hv_lxc_unittest.py \
965 test/ganeti.hypervisor.hv_xen_unittest.py \
966 test/ganeti.hypervisor_unittest.py \
967 test/ganeti.impexpd_unittest.py \
968 test/ganeti.jqueue_unittest.py \
969 test/ganeti.jstore_unittest.py \
970 test/ganeti.locking_unittest.py \
971 test/ganeti.luxi_unittest.py \
972 test/ganeti.masterd.iallocator_unittest.py \
973 test/ganeti.masterd.instance_unittest.py \
974 test/ganeti.mcpu_unittest.py \
975 test/ganeti.netutils_unittest.py \
976 test/ganeti.objects_unittest.py \
977 test/ganeti.objectutils_unittest.py \
978 test/ganeti.opcodes_unittest.py \
979 test/ganeti.ovf_unittest.py \
980 test/ganeti.qlang_unittest.py \
981 test/ganeti.query_unittest.py \
982 test/ganeti.rapi.baserlib_unittest.py \
983 test/ganeti.rapi.client_unittest.py \
984 test/ganeti.rapi.resources_unittest.py \
985 test/ganeti.rapi.rlib2_unittest.py \
986 test/ganeti.rapi.testutils_unittest.py \
987 test/ganeti.rpc_unittest.py \
988 test/ganeti.runtime_unittest.py \
989 test/ganeti.serializer_unittest.py \
990 test/ganeti.server.rapi_unittest.py \
991 test/ganeti.ssconf_unittest.py \
992 test/ganeti.ssh_unittest.py \
993 test/ganeti.storage_unittest.py \
994 test/ganeti.tools.ensure_dirs_unittest.py \
995 test/ganeti.tools.node_daemon_setup_unittest.py \
996 test/ganeti.tools.prepare_node_join_unittest.py \
997 test/ganeti.uidpool_unittest.py \
998 test/ganeti.utils.algo_unittest.py \
999 test/ganeti.utils.filelock_unittest.py \
1000 test/ganeti.utils.hash_unittest.py \
1001 test/ganeti.utils.io_unittest-runasroot.py \
1002 test/ganeti.utils.io_unittest.py \
1003 test/ganeti.utils.log_unittest.py \
1004 test/ganeti.utils.mlock_unittest.py \
1005 test/ganeti.utils.nodesetup_unittest.py \
1006 test/ganeti.utils.process_unittest.py \
1007 test/ganeti.utils.retry_unittest.py \
1008 test/ganeti.utils.text_unittest.py \
1009 test/ganeti.utils.wrapper_unittest.py \
1010 test/ganeti.utils.x509_unittest.py \
1011 test/ganeti.utils_unittest.py \
1012 test/ganeti.vcluster_unittest.py \
1013 test/ganeti.workerpool_unittest.py \
1014 test/pycurl_reset_unittest.py \
1015 test/qa.qa_config_unittest.py \
1016 test/tempfile_fork_unittest.py
1018 haskell_tests = htest/test
1021 test/check-cert-expired_unittest.bash \
1022 test/daemon-util_unittest.bash \
1023 test/ganeti-cleaner_unittest.bash \
1024 test/import-export_unittest.bash \
1025 test/cli-test.bash \
1026 test/bash_completion.bash \
1033 nodist_TESTS += $(haskell_tests)
1034 dist_TESTS += htest/offline-test.sh
1037 htest/hpc-mon-collector \
1038 $(HS_BUILT_TEST_HELPERS)
1041 TESTS = $(dist_TESTS) $(nodist_TESTS)
1043 # Environment for all tests
1044 PLAIN_TESTS_ENVIRONMENT = \
1046 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1047 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1050 # Environment for tests run by automake
1051 TESTS_ENVIRONMENT = \
1052 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1055 $(dist_sbin_SCRIPTS) \
1057 $(pkglib_python_scripts) \
1058 $(nodist_pkglib_python_scripts) \
1059 $(nodist_tools_python_scripts) \
1061 $(pkgpython_PYTHON) \
1063 $(hypervisor_PYTHON) \
1078 test/check-cert-expired_unittest.bash \
1079 test/daemon-util_unittest.bash \
1080 test/ganeti-cleaner_unittest.bash \
1081 test/import-export_unittest.bash \
1082 test/cli-test.bash \
1083 test/bash_completion.bash \
1084 htest/offline-test.sh \
1085 htest/cli-tests-defs.sh \
1086 $(all_python_code) \
1087 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
1089 check_python_code = \
1090 $(BUILD_BASH_COMPLETION) \
1096 lint_python_code = \
1098 ganeti/http/server.py \
1099 $(dist_sbin_SCRIPTS) \
1101 $(pkglib_python_scripts) \
1102 $(BUILD_BASH_COMPLETION) \
1108 standalone_python_modules = \
1109 lib/rapi/client.py \
1110 tools/ganeti-listrunner
1112 pep8_python_code = \
1114 ganeti/http/server.py \
1115 $(dist_sbin_SCRIPTS) \
1117 $(pkglib_python_scripts) \
1118 $(BUILD_BASH_COMPLETION) \
1121 $(PYTHON_BOOTSTRAP) \
1124 test/daemon-util_unittest.bash: daemons/daemon-util
1126 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1128 test/bash_completion.bash: doc/examples/bash_completion-debug
1130 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1131 sed -f $(REPLACE_VARS_SED) < $< > $@
1134 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1135 sed -f $(REPLACE_VARS_SED) < $< > $@
1138 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1139 sed -f $(REPLACE_VARS_SED) < $< > $@
1142 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1143 sed -f $(REPLACE_VARS_SED) < $< > $@
1145 doc/examples/bash_completion: BC_ARGS = --compact
1146 doc/examples/bash_completion-debug: BC_ARGS =
1148 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1149 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1150 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1151 daemons/ganeti-cleaner \
1152 $(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1153 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1154 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1156 doc/%.png: doc/%.dot
1157 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1158 $(DOT) -Tpng -o $@ $<
1160 man/footer.man: man/footer.rst
1161 @test -n "$(PANDOC)" || \
1162 { echo 'pandoc' not found during configure; exit 1; }
1163 $(PANDOC) -f rst -t man -o $@ $<
1165 man/footer.html: man/footer.rst
1166 @test -n "$(PANDOC)" || \
1167 { echo 'pandoc' not found during configure; exit 1; }
1168 $(PANDOC) -f rst -t html -o $@ $<
1170 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1171 lib/build/shell_example_lexer.py \
1172 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1173 @echo "Checking $< for hardcoded paths..."
1174 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1175 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1179 trap 'echo auto-removing $@; rm $@' EXIT; \
1180 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1183 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1184 @test -n "$(PANDOC)" || \
1185 { echo 'pandoc' not found during configure; exit 1; }
1187 trap 'echo auto-removing $@; rm $@' EXIT; \
1188 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1189 sed -e 's/\\@/@/g' > $@; \
1190 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1191 $(CHECK_MAN_DASHES) $@; \
1195 man/%.html.in: man/%.gen man/footer.html
1196 @test -n "$(PANDOC)" || \
1197 { echo 'pandoc' not found during configure; exit 1; }
1199 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1200 sed -e 's/\\@/@/g' > $@
1202 man/%: man/%.in $(REPLACE_VARS_SED)
1203 sed -f $(REPLACE_VARS_SED) < $< > $@
1205 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1206 sed -f $(REPLACE_VARS_SED) < $< > $@
1209 if test -d .git; then \
1210 git describe > $@; \
1211 elif test ! -f $@ ; then \
1212 echo "Cannot auto-generate $@ file"; exit 1; \
1215 .PHONY: clean-vcs-version
1219 .PHONY: regen-vcs-version
1223 if test -d .git; then \
1224 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1225 git describe > $$T; \
1226 if ! cmp --quiet $$T vcs-version; then \
1227 mv $$T vcs-version; \
1231 htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1232 vcs-version $(built_base_sources)
1234 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1235 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1237 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1238 lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
1239 $(CONVERT_CONSTANTS) $(built_base_sources) \
1240 | lib/_vcsversion.py
1242 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1244 htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1245 $(built_base_sources)
1249 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1250 echo "import $$name ()" ; \
1254 lib/_autoconf.py: Makefile | stamp-directories
1256 { echo '# This file is automatically generated, do not edit!'; \
1259 echo '"""Build-time configuration for Ganeti.'; \
1261 echo 'This file is autogenerated by the build process.'; \
1262 echo 'For any changes you need to re-run ./configure (and'; \
1263 echo 'not edit by hand).'; \
1267 echo '# pylint: disable=C0301,C0324'; \
1268 echo '# because this is autogenerated, we do not want'; \
1269 echo '# style warnings' ; \
1271 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1272 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1273 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1274 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1275 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1276 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1277 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1278 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1279 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1280 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1281 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1282 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1283 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1284 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1285 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1286 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1287 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1288 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1289 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1290 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1291 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1292 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1293 echo "KVM_PATH = '$(KVM_PATH)'"; \
1294 echo "IP_PATH = '$(IP_PATH)'"; \
1295 echo "SOCAT_PATH = '$(SOCAT)'"; \
1296 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1297 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1298 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1299 echo "TOOLSDIR = '$(toolsdir)'"; \
1300 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1301 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1302 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1303 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1304 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1305 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1306 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1307 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1308 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1309 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1310 echo "RAPI_USER = '$(RAPI_USER)'"; \
1311 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1312 echo "CONFD_USER = '$(CONFD_USER)'"; \
1313 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1314 echo "NODED_USER = '$(NODED_USER)'"; \
1315 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1316 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1317 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1318 echo "HTOOLS = True"; \
1319 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1320 echo "XEN_CMD = '$(XEN_CMD)'"; \
1321 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1322 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1325 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1327 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1328 { echo '# This file is automatically generated, do not edit!'; \
1331 echo '"""Build-time VCS version number for Ganeti.'; \
1333 echo 'This file is autogenerated by the build process.'; \
1334 echo 'For any changes you need to re-run ./configure (and'; \
1335 echo 'not edit by hand).'; \
1339 echo '# pylint: disable=C0301,C0324'; \
1340 echo '# because this is autogenerated, we do not want'; \
1341 echo '# style warnings' ; \
1343 echo "VCS_VERSION = '$$VCSVER'"; \
1346 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1347 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1349 $(SHELL_ENV_INIT): Makefile stamp-directories
1351 { echo '# Allow overriding for tests'; \
1352 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1353 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1355 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1356 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1357 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1358 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1359 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1362 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1364 { echo 's#@PREFIX@#$(prefix)#g'; \
1365 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1366 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1367 echo 's#@BINDIR@#$(bindir)#g'; \
1368 echo 's#@SBINDIR@#$(sbindir)#g'; \
1369 echo 's#@LIBDIR@#$(libdir)#g'; \
1370 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1371 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1372 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1373 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1374 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1375 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1376 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1377 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1378 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1379 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1380 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1381 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1382 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1383 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1384 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1385 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1386 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1387 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1388 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1389 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1390 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1392 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1393 echo ' r $(SHELL_ENV_INIT)'; \
1398 # Using deferred evaluation
1399 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1400 daemons/ganeti-watcher: MODULE = ganeti.watcher
1401 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1402 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1403 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1404 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1405 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1406 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1408 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1409 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1411 { echo '#!/usr/bin/python'; \
1412 echo '# This file is automatically generated, do not edit!'; \
1413 echo "# Edit $(MODULE) instead."; \
1415 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1417 echo '# pylint: disable=C0103'; \
1418 echo '# C0103: Invalid name'; \
1420 echo 'import sys'; \
1421 echo 'import $(MODULE) as main'; \
1423 echo '# Temporarily alias commands until bash completion'; \
1424 echo '# generator is changed'; \
1425 echo 'if hasattr(main, "commands"):'; \
1426 echo ' commands = main.commands # pylint: disable=E1101'; \
1427 echo 'if hasattr(main, "aliases"):'; \
1428 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1430 echo 'if __name__ == "__main__":'; \
1431 echo ' sys.exit(main.Main())'; \
1435 $(HS_BUILT_TEST_HELPERS): Makefile
1436 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1438 { echo '#!/bin/sh'; \
1439 echo '# This file is automatically generated, do not edit!'; \
1440 echo "# Edit Makefile.am instead."; \
1442 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1446 stamp-directories: Makefile
1447 $(MAKE) $(AM_MAKEFLAGS) ganeti
1448 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1451 # We need to create symlinks because "make distcheck" will not install Python
1452 # files when building.
1453 stamp-srclinks: Makefile | stamp-directories
1455 for i in $(srclink_files); do \
1456 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1457 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1464 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1467 check-dirs: $(GENERATED_FILES)
1469 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1471 while read dir; do \
1473 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1474 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1477 for dir in $(DIRS); do \
1478 if ! test -d "$$dir"; then \
1479 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1483 test -z "$$error"; \
1487 check-local: check-dirs $(GENERATED_FILES)
1488 $(CHECK_PYTHON_CODE) $(check_python_code)
1489 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1490 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1491 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1492 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1493 @expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1495 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1496 echo "Incorrect version in README, expected $$expver" >&2; \
1499 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1500 doc/security.rst; do \
1501 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1502 "Documents Ganeti version $$expver"; then \
1503 echo "Incorrect version in $$file, expected $$expver" >&2; \
1507 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1508 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
1511 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
1512 ".. Last updated for Ganeti $$expver"; then \
1513 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
1516 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1517 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1518 echo "Longest line in $$file is longer than 80 characters" >&2; \
1525 hs-check: htest/test htest/hpc-htools htest/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
1528 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1530 # E111: indentation is not a multiple of four
1531 # E121: continuation line indentation is not a multiple of four
1532 # (since our indent level is not 4)
1533 # E125: continuation line does not distinguish itself from next logical line
1534 # (since our indent level is not 4)
1535 # E127: continuation line over-indented for visual indent
1536 # (since our indent level is not 4)
1537 # note: do NOT add E128 here; it's a valid style error in most cases!
1538 # I've seen real errors, but also some cases were we indent wrongly
1539 # due to line length; try to rework the cases where it is triggered,
1540 # instead of silencing it
1541 # E261: at least two spaces before inline comment
1542 # E501: line too long (80 characters)
1543 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1545 # For excluding pep8 expects filenames only, not whole paths
1546 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1548 LINT_TARGETS = pylint pylint-qa
1550 LINT_TARGETS += pep8
1553 LINT_TARGETS += hlint
1557 lint: $(LINT_TARGETS)
1560 pylint: $(GENERATED_FILES)
1561 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1562 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1565 pylint-qa: $(GENERATED_FILES)
1566 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1567 cd $(top_srcdir)/qa && \
1568 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1569 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1572 pep8: $(GENERATED_FILES)
1573 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1574 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1575 --repeat $(pep8_python_code)
1577 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1578 HLINT_EXCLUDES = htools/Ganeti/THH.hs htest/hpc-htools.hs
1580 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1581 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1582 if tty -s; then C="-c"; else C=""; fi; \
1583 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1584 --ignore "Use first" \
1585 --ignore "Use comparing" \
1587 --ignore "Reduce duplication" \
1588 --ignore "Use &&&" \
1589 --ignore "Use void" \
1590 --hint htools/lint-hints \
1591 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1593 # a dist hook rule for updating the vcs-version file; this is
1594 # hardcoded due to where it needs to build the file...
1596 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1597 rm -f $(top_distdir)/vcs-version
1598 cp -p $(srcdir)/vcs-version $(top_distdir)
1600 # a distcheck hook rule for catching revision control directories
1602 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1603 echo "Found revision control files in final archive." 1>&2; \
1606 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1607 echo "Found Python byte code in final archive." 1>&2; \
1610 if find $(top_distdir) -name '*~' | grep .; then \
1611 echo "Found backup files in final archive." 1>&2; \
1614 # Empty files or directories should not be distributed. They can cause
1615 # unnecessary warnings for packagers. Directories used by automake during
1616 # distcheck must be excluded.
1617 if find $(top_distdir) -empty -and -not \( \
1618 -path $(top_distdir)/_build -or \
1619 -path $(top_distdir)/_inst \) | grep .; then \
1620 echo "Found empty files or directories in final archive." 1>&2; \
1623 if test -n "$(BUILD_RELEASE)" && \
1624 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1625 echo "Found unreleased version in NEWS." >&2; \
1629 # When building a release, stricter checks should be used
1630 distcheck-release dist-release: export BUILD_RELEASE = 1
1631 distcheck-release: distcheck
1633 distrebuildcheck: dist
1635 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1636 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1638 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1641 $(MAKE) maintainer-clean; \
1642 cp $(abs_srcdir)/vcs-version .; \
1644 $(MAKE) $(AM_MAKEFLAGS)
1648 for i in $(DIST_ARCHIVES); do \
1649 echo -n "Checking $$i ... "; \
1650 autotools/check-tar < $$i; \
1655 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1656 "$(DESTDIR)${localstatedir}/log/ganeti" \
1657 "$(DESTDIR)${localstatedir}/run/ganeti"
1660 if WANT_HTOOLSAPIDOC
1661 apidoc: py-apidoc hs-apidoc
1667 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1668 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
1669 $(RUN_IN_TEMPDIR) epydoc -v \
1670 --conf $(CURDIR)/epydoc.conf \
1671 --output $(CURDIR)/$(APIDOC_PY_DIR)
1674 hs-apidoc: $(HS_BUILT_SRCS)
1675 @test -n "$(HSCOLOUR)" || \
1676 { echo 'HsColour' not found during configure; exit 1; }
1677 @test -n "$(HADDOCK)" || \
1678 { echo 'haddock' not found during configure; exit 1; }
1679 rm -rf $(APIDOC_HS_DIR)/*
1680 for i in $(ALL_APIDOC_HS_DIRS); do \
1683 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1684 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1685 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1688 if [ "$(HTOOLS_NOCURL)" ]; \
1689 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1692 if [ "$(HTOOLS_PARALLEL3)" ]; \
1693 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1695 if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1696 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1698 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1699 for file in $$RELSRCS; do \
1700 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1701 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1703 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1704 -t ganeti -p haddock-prologue \
1705 --source-module="%{MODULE/.//}.html" \
1706 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1708 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1711 TAGS: $(GENERATED_FILES)
1713 $(GHC) -e ":etags" -v0 \
1714 $(filter-out -O -Werror,$(HFLAGS)) \
1715 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1717 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1718 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1719 -path './qa/*.py' | \
1720 etags -l python -a -
1724 coverage: py-coverage hs-coverage
1726 coverage: py-coverage
1730 py-coverage: $(GENERATED_FILES) $(python_tests)
1731 @test -n "$(PYCOVERAGE)" || \
1732 { echo 'python-coverage' not found during configure; exit 1; }
1734 COVERAGE=$(PYCOVERAGE) \
1735 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1736 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1737 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1738 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1742 hs-coverage: $(haskell_tests) htest/hpc-htools htest/hpc-mon-collector
1744 $(MAKE) $(AM_MAKEFLAGS) hs-check
1745 @mkdir_p@ $(COVERAGE_HS_DIR)
1746 hpc sum --union $(HPCEXCL) \
1747 test.tix hpc-htools.tix hpc-mon-collector.tix > coverage-htools.tix
1748 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1749 hpc report coverage-htools.tix
1750 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1752 # Special "kind-of-QA" target for htools, needs special setup (all
1753 # tools compiled with -fhpc)
1758 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1759 rm -f *.tix *.mix; \
1761 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1762 --output=live-test.tix ; \
1763 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1764 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1765 --srcdir=.. $(HPCEXCL) ; \
1766 hpc report --srcdir=.. live-test $(HPCEXCL)
1768 commit-check: distcheck lint apidoc
1770 .PHONY: gitignore-check
1772 @if [ -n "`git status --short`" ]; then \
1773 echo "Git status is not clean!" 1>&2 ; \
1774 git status --short; \
1778 # Target that builds all binaries (including those that are not
1779 # rebuilt except when running the tests)
1781 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
1783 # we don't need the ancient implicit rules:
1790 -include ./Makefile.local