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/HTools \
62 htools/Ganeti/HTools/Program \
67 htest/Test/Ganeti/Confd \
68 htest/Test/Ganeti/HTools \
69 htest/Test/Ganeti/Query
78 doc/examples/gnt-debug \
101 test/data/ovfdata/other \
104 BUILDTIME_DIR_AUTOCREATE = \
108 $(APIDOC_HS_DIR)/Ganeti \
109 $(APIDOC_HS_DIR)/Ganeti/Confd \
110 $(APIDOC_HS_DIR)/Ganeti/HTools \
111 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
112 $(APIDOC_HS_DIR)/Ganeti/Query \
120 $(BUILDTIME_DIR_AUTOCREATE) \
125 ganeti-[0-9]*.[0-9]*.[0-9]* \
129 COVERAGE_DIR = doc/coverage
130 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
131 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
133 APIDOC_PY_DIR = $(APIDOC_DIR)/py
134 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
136 MAINTAINERCLEANFILES = \
139 doc/install-quick.rst \
144 maintainer-clean-local:
145 rm -rf $(BUILDTIME_DIRS)
148 $(addsuffix /*.py[co],$(DIRS)) \
149 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
150 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
151 $(PYTHON_BOOTSTRAP) \
153 $(REPLACE_VARS_SED) \
155 daemons/daemon-util \
156 daemons/ganeti-cleaner \
159 doc/examples/bash_completion \
160 doc/examples/bash_completion-debug \
161 lib/_generated_rpc.py \
165 tools/vcluster-setup \
168 $(nodist_pkgpython_PYTHON) \
169 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
170 $(HS_BUILT_TEST_HELPERS) \
171 htools/ganeti-confd \
172 .hpc/*.mix htools/*.tix htest/*.tix \
176 $(built_base_sources) \
177 $(BUILT_PYTHON_SOURCES) \
180 HTOOLS_GENERATED_FILES =
182 HTOOLS_GENERATED_FILES += $(HS_PROGS)
184 HTOOLS_GENERATED_FILES += htools/hconfd htools/ganeti-confd
188 built_base_sources = \
192 built_python_base_sources = \
196 BUILT_PYTHON_SOURCES = \
197 $(built_python_base_sources) \
198 lib/_generated_rpc.py
200 # Generating the RPC wrappers depends on many things, so make sure
201 # it's built at the end of the built sources
202 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
204 # these are all built from the underlying %.in sources
206 doc/examples/ganeti-kvm-poweroff.initd \
207 doc/examples/ganeti.cron \
208 doc/examples/ganeti.initd \
209 doc/examples/gnt-config-backup \
210 doc/examples/hooks/ipsec
212 nodist_pkgpython_PYTHON = \
213 $(BUILT_PYTHON_SOURCES)
216 lib/build/__init__.py \
217 lib/build/shell_example_lexer.py \
218 lib/build/sphinx_ext.py
222 lib/asyncnotifier.py \
259 lib/client/__init__.py \
260 lib/client/gnt_backup.py \
261 lib/client/gnt_cluster.py \
262 lib/client/gnt_debug.py \
263 lib/client/gnt_group.py \
264 lib/client/gnt_instance.py \
265 lib/client/gnt_job.py \
266 lib/client/gnt_node.py \
269 hypervisor_PYTHON = \
270 lib/hypervisor/__init__.py \
271 lib/hypervisor/hv_base.py \
272 lib/hypervisor/hv_chroot.py \
273 lib/hypervisor/hv_fake.py \
274 lib/hypervisor/hv_kvm.py \
275 lib/hypervisor/hv_lxc.py \
276 lib/hypervisor/hv_xen.py
279 lib/rapi/__init__.py \
280 lib/rapi/baserlib.py \
282 lib/rapi/client_utils.py \
283 lib/rapi/connector.py \
285 lib/rapi/testutils.py
288 lib/http/__init__.py \
294 lib/confd/__init__.py \
298 lib/masterd/__init__.py \
299 lib/masterd/iallocator.py \
300 lib/masterd/instance.py
303 lib/impexpd/__init__.py
306 lib/watcher/__init__.py \
307 lib/watcher/nodemaint.py \
311 lib/server/__init__.py \
312 lib/server/masterd.py \
313 lib/server/noded.py \
317 lib/tools/__init__.py \
318 lib/tools/ensure_dirs.py
321 lib/utils/__init__.py \
323 lib/utils/filelock.py \
328 lib/utils/nodesetup.py \
329 lib/utils/process.py \
332 lib/utils/wrapper.py \
337 doc/cluster-merge.rst \
346 doc/design-autorepair.rst \
347 doc/design-bulk-create.rst \
348 doc/design-chained-jobs.rst \
349 doc/design-cpu-pinning.rst \
350 doc/design-draft.rst \
351 doc/design-htools-2.3.rst \
352 doc/design-http-server.rst \
353 doc/design-impexp2.rst \
354 doc/design-lu-generated-jobs.rst \
355 doc/design-multi-reloc.rst \
356 doc/design-network.rst \
357 doc/design-node-state-cache.rst \
359 doc/design-ovf-support.rst \
360 doc/design-partitioned.rst \
361 doc/design-query-splitting.rst \
362 doc/design-query2.rst \
363 doc/design-remote-commands.rst \
364 doc/design-resource-model.rst \
365 doc/design-shared-storage.rst \
366 doc/design-ssh-setup.rst \
367 doc/design-monitoring-agent.rst \
368 doc/design-virtual-clusters.rst \
369 doc/design-x509-ca.rst \
375 doc/install-quick.rst \
378 doc/move-instance.rst \
380 doc/ovfconverter.rst \
384 doc/virtual-cluster.rst \
387 HS_PROGS = htools/htools
388 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
389 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
398 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
399 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
401 HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
402 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
404 # internal extra flags (used for htest/test mainly)
406 # exclude options for coverage reports
407 HPCEXCL = --exclude Main \
408 --exclude Ganeti.Constants \
409 --exclude Ganeti.HTools.QC \
410 --exclude Ganeti.THH \
411 --exclude Ganeti.Version \
412 --exclude Test.Ganeti.TestCommon \
413 --exclude Test.Ganeti.TestHTools \
414 --exclude Test.Ganeti.TestHelper \
415 --exclude Test.Ganeti.TestImports \
416 $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
419 htools/Ganeti/BasicTypes.hs \
420 htools/Ganeti/Common.hs \
421 htools/Ganeti/Compat.hs \
422 htools/Ganeti/Confd.hs \
423 htools/Ganeti/Confd/Server.hs \
424 htools/Ganeti/Confd/Utils.hs \
425 htools/Ganeti/Config.hs \
426 htools/Ganeti/Daemon.hs \
427 htools/Ganeti/HTools/CLI.hs \
428 htools/Ganeti/HTools/Cluster.hs \
429 htools/Ganeti/HTools/Container.hs \
430 htools/Ganeti/HTools/ExtLoader.hs \
431 htools/Ganeti/HTools/Group.hs \
432 htools/Ganeti/HTools/IAlloc.hs \
433 htools/Ganeti/HTools/Instance.hs \
434 htools/Ganeti/HTools/Loader.hs \
435 htools/Ganeti/HTools/Luxi.hs \
436 htools/Ganeti/HTools/Node.hs \
437 htools/Ganeti/HTools/PeerMap.hs \
438 htools/Ganeti/HTools/Program.hs \
439 htools/Ganeti/HTools/Program/Hail.hs \
440 htools/Ganeti/HTools/Program/Hbal.hs \
441 htools/Ganeti/HTools/Program/Hcheck.hs \
442 htools/Ganeti/HTools/Program/Hinfo.hs \
443 htools/Ganeti/HTools/Program/Hscan.hs \
444 htools/Ganeti/HTools/Program/Hspace.hs \
445 htools/Ganeti/HTools/Rapi.hs \
446 htools/Ganeti/HTools/Simu.hs \
447 htools/Ganeti/HTools/Text.hs \
448 htools/Ganeti/HTools/Types.hs \
449 htools/Ganeti/Hash.hs \
450 htools/Ganeti/JSON.hs \
451 htools/Ganeti/Jobs.hs \
452 htools/Ganeti/Logging.hs \
453 htools/Ganeti/Luxi.hs \
454 htools/Ganeti/Objects.hs \
455 htools/Ganeti/OpCodes.hs \
456 htools/Ganeti/Path.hs \
457 htools/Ganeti/Query/Common.hs \
458 htools/Ganeti/Query/Filter.hs \
459 htools/Ganeti/Query/Group.hs \
460 htools/Ganeti/Query/Language.hs \
461 htools/Ganeti/Query/Node.hs \
462 htools/Ganeti/Query/Query.hs \
463 htools/Ganeti/Query/Server.hs \
464 htools/Ganeti/Query/Types.hs \
465 htools/Ganeti/Rpc.hs \
466 htools/Ganeti/Runtime.hs \
467 htools/Ganeti/Ssconf.hs \
468 htools/Ganeti/THH.hs \
469 htools/Ganeti/Utils.hs
472 htest/Test/Ganeti/BasicTypes.hs \
473 htest/Test/Ganeti/Common.hs \
474 htest/Test/Ganeti/Confd/Utils.hs \
475 htest/Test/Ganeti/Daemon.hs \
476 htest/Test/Ganeti/HTools/CLI.hs \
477 htest/Test/Ganeti/HTools/Cluster.hs \
478 htest/Test/Ganeti/HTools/Container.hs \
479 htest/Test/Ganeti/HTools/Instance.hs \
480 htest/Test/Ganeti/HTools/Loader.hs \
481 htest/Test/Ganeti/HTools/Node.hs \
482 htest/Test/Ganeti/HTools/PeerMap.hs \
483 htest/Test/Ganeti/HTools/Simu.hs \
484 htest/Test/Ganeti/HTools/Text.hs \
485 htest/Test/Ganeti/HTools/Types.hs \
486 htest/Test/Ganeti/JSON.hs \
487 htest/Test/Ganeti/Jobs.hs \
488 htest/Test/Ganeti/Luxi.hs \
489 htest/Test/Ganeti/Objects.hs \
490 htest/Test/Ganeti/OpCodes.hs \
491 htest/Test/Ganeti/Query/Filter.hs \
492 htest/Test/Ganeti/Query/Language.hs \
493 htest/Test/Ganeti/Query/Query.hs \
494 htest/Test/Ganeti/Rpc.hs \
495 htest/Test/Ganeti/Ssconf.hs \
496 htest/Test/Ganeti/TestCommon.hs \
497 htest/Test/Ganeti/TestHTools.hs \
498 htest/Test/Ganeti/TestHelper.hs \
499 htest/Test/Ganeti/Utils.hs
501 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
504 htest/Test/Ganeti/TestImports.hs \
505 htools/Ganeti/Constants.hs \
506 htools/Ganeti/Version.hs
507 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
509 $(RUN_IN_TEMPDIR): | stamp-directories
511 # Note: we use here an order-only prerequisite, as the contents of
512 # _autoconf.py are not actually influencing the html build output: it
513 # has to exist in order for the sphinx module to be loaded
514 # successfully, but we certainly don't want the docs to be rebuilt if
516 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
517 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
518 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
519 | $(BUILT_PYTHON_SOURCES)
520 @test -n "$(SPHINX)" || \
521 { echo 'sphinx-build' not found during configure; exit 1; }
523 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
525 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
526 -D release="$(PACKAGE_VERSION)" \
527 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
528 rm -f doc/html/.buildinfo doc/html/objects.inv
531 doc/html: doc/html/index.html
533 doc/install-quick.rst: INSTALL
535 doc/upgrade.rst: UPGRADE
537 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
539 { echo '.. This file is automatically updated at build time from $<.'; \
540 echo '.. Do not edit.'; \
547 doc/design-2.1-lock-acquire.dot \
548 doc/design-2.1-lock-release.dot
550 docpng = $(patsubst %.dot,%.png,$(docdot))
552 # Things to build but not to install (add it to EXTRA_DIST if it should be
558 doc/examples/bash_completion \
559 doc/examples/bash_completion-debug \
564 scripts/gnt-cluster \
567 scripts/gnt-instance \
572 PYTHON_BOOTSTRAP_SBIN = \
573 daemons/ganeti-masterd \
574 daemons/ganeti-noded \
575 daemons/ganeti-rapi \
576 daemons/ganeti-watcher \
580 $(PYTHON_BOOTSTRAP_SBIN) \
602 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
604 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
605 # FIXME: this is a hardcoded logic, instead of auto-resolving
606 $(LN_S) -f ../../../bin/htools \
607 $(DESTDIR)$(iallocatorsdir)/hail
608 for role in $(HS_BIN_ROLES); do \
610 $(DESTDIR)$(bindir)/$$role ; \
614 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
615 @if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
616 echo "Error: cannot run unittests without the development" \
617 " libraries (see devnotes.rst)" 1>&2; \
620 @rm -f $(notdir $@).tix
623 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
624 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
625 $(HEXTRA) $(HEXTRA_INT) $@
628 # for the htest/test binary, we need to enable profiling/coverage
629 htest/test: HEXTRA_INT=-fhpc -ihtest
631 # we compile the hpc-htools binary with the program coverage
632 htest/hpc-htools: HEXTRA_INT=-fhpc
635 htest/offline-tests.sh: htest/hpc-htools
637 # rules for building profiling-enabled versions of the haskell
638 # programs: hs-prof does the full two-step build, whereas
639 # hs-prof-quick does only the final rebuild (hs-prof must have been
641 .PHONY: hs-prof hs-prof-quick
643 $(MAKE) $(AM_MAKEFLAGS) clean
644 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
645 rm -f $(HS_ALL_PROGS)
646 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
649 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
651 dist_sbin_SCRIPTS = \
652 tools/ganeti-listrunner
654 nodist_sbin_SCRIPTS = \
655 $(PYTHON_BOOTSTRAP_SBIN) \
656 daemons/ganeti-cleaner
659 htools/ganeti-confd: htools/hconfd
662 nodist_sbin_SCRIPTS += htools/ganeti-confd
670 tools/cluster-merge \
674 tools/move-instance \
676 tools/sanitize-config \
679 dist_tools_SCRIPTS = \
681 tools/kvm-console-wrapper \
682 tools/master-ip-setup \
683 tools/xm-console-wrapper
685 nodist_tools_SCRIPTS = \
688 pkglib_python_scripts = \
689 daemons/import-export \
690 tools/check-cert-expired
692 nodist_pkglib_python_scripts = \
695 myexeclib_SCRIPTS = \
696 daemons/daemon-util \
698 $(pkglib_python_scripts)
700 nodist_myexeclib_SCRIPTS = \
701 $(nodist_pkglib_python_scripts)
708 autotools/build-bash-completion \
709 autotools/build-rpc \
710 autotools/check-header \
711 autotools/check-imports \
712 autotools/check-man-dashes \
713 autotools/check-man-warnings \
714 autotools/check-news \
715 autotools/check-python-code \
716 autotools/check-tar \
717 autotools/check-version \
718 autotools/convert-constants \
720 autotools/gen-coverage \
721 autotools/testrunner \
722 autotools/wrong-hardcoded-paths \
724 daemons/daemon-util.in \
725 daemons/ganeti-cleaner.in \
726 $(pkglib_python_scripts) \
729 tools/vcluster-setup.in \
735 $(BUILT_EXAMPLES:%=%.in) \
736 doc/examples/ganeti.default \
737 doc/examples/ganeti.default-debug \
738 doc/examples/hooks/ethers \
739 doc/examples/gnt-debug/README \
740 doc/examples/gnt-debug/delay0.json \
741 doc/examples/gnt-debug/delay50.json \
752 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
754 htools/lint-hints.hs \
755 htest/cli-tests-defs.sh \
756 htest/offline-test.sh
759 man/ganeti-cleaner.8 \
761 man/ganeti-listrunner.8 \
762 man/ganeti-masterd.8 \
764 man/ganeti-os-interface.7 \
766 man/ganeti-watcher.8 \
784 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
785 manhtml = $(patsubst %.rst,%.html,$(manrst))
786 mangen = $(patsubst %.rst,%.gen,$(manrst))
788 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
789 $(patsubst %.html,%.html.in,$(manhtml)) \
790 man/footer.man man/footer.html $(mangen)
793 htest/data/common-suffix.data \
794 htest/data/hail-alloc-drbd.json \
795 htest/data/hail-change-group.json \
796 htest/data/hail-invalid-reloc.json \
797 htest/data/hail-node-evac.json \
798 htest/data/hail-reloc-drbd.json \
799 htest/data/hbal-excl-tags.data \
800 htest/data/hbal-split-insts.data \
801 htest/data/invalid-node.data \
802 htest/data/missing-resources.data \
803 htest/data/rapi/groups.json \
804 htest/data/rapi/info.json \
805 htest/data/rapi/instances.json \
806 htest/data/rapi/nodes.json \
807 htest/shelltests/htools-balancing.test \
808 htest/shelltests/htools-basic.test \
809 htest/shelltests/htools-dynutil.test \
810 htest/shelltests/htools-excl.test \
811 htest/shelltests/htools-hail.test \
812 htest/shelltests/htools-hspace.test \
813 htest/shelltests/htools-invalid.test \
814 htest/shelltests/htools-multi-group.test \
815 htest/shelltests/htools-no-backend.test \
816 htest/shelltests/htools-rapi.test \
817 htest/shelltests/htools-single-group.test \
818 htest/shelltests/htools-text-backend.test \
819 test/data/bdev-drbd-8.0.txt \
820 test/data/bdev-drbd-8.3.txt \
821 test/data/bdev-drbd-disk.txt \
822 test/data/bdev-drbd-net-ip4.txt \
823 test/data/bdev-drbd-net-ip6.txt \
824 test/data/cert1.pem \
825 test/data/ip-addr-show-dummy0.txt \
826 test/data/ip-addr-show-lo-ipv4.txt \
827 test/data/ip-addr-show-lo-ipv6.txt \
828 test/data/ip-addr-show-lo-oneline-ipv4.txt \
829 test/data/ip-addr-show-lo-oneline-ipv6.txt \
830 test/data/ip-addr-show-lo-oneline.txt \
831 test/data/ip-addr-show-lo.txt \
832 test/data/kvm_0.12.5_help.txt \
833 test/data/kvm_0.15.90_help.txt \
834 test/data/kvm_0.9.1_help.txt \
835 test/data/kvm_1.0_help.txt \
836 test/data/ovfdata/compr_disk.vmdk.gz \
837 test/data/ovfdata/config.ini \
838 test/data/ovfdata/corrupted_resources.ovf \
839 test/data/ovfdata/empty.ini \
840 test/data/ovfdata/empty.ovf \
841 test/data/ovfdata/ganeti.mf \
842 test/data/ovfdata/ganeti.ovf \
843 test/data/ovfdata/gzip_disk.ovf \
844 test/data/ovfdata/new_disk.vmdk \
845 test/data/ovfdata/no_disk.ini \
846 test/data/ovfdata/no_disk_in_ref.ovf \
847 test/data/ovfdata/no_os.ini \
848 test/data/ovfdata/no_ovf.ova \
849 test/data/ovfdata/other/rawdisk.raw \
850 test/data/ovfdata/ova.ova \
851 test/data/ovfdata/rawdisk.raw \
852 test/data/ovfdata/second_disk.vmdk \
853 test/data/ovfdata/unsafe_path.ini \
854 test/data/ovfdata/virtualbox.ovf \
855 test/data/ovfdata/wrong_config.ini \
856 test/data/ovfdata/wrong_extension.ovd \
857 test/data/ovfdata/wrong_manifest.mf \
858 test/data/ovfdata/wrong_manifest.ovf \
859 test/data/ovfdata/wrong_ova.ova \
860 test/data/ovfdata/wrong_xml.ovf \
861 test/data/proc_drbd8.txt \
862 test/data/proc_drbd80-emptyline.txt \
863 test/data/proc_drbd83.txt \
864 test/data/proc_drbd83_sync.txt \
865 test/data/proc_drbd83_sync_krnl2.6.39.txt \
866 test/data/sys_drbd_usermode_helper.txt \
867 test/data/vgreduce-removemissing-2.02.02.txt \
868 test/data/vgreduce-removemissing-2.02.66-fail.txt \
869 test/data/vgreduce-removemissing-2.02.66-ok.txt \
870 test/data/vgs-missing-pvs-2.02.02.txt \
871 test/data/vgs-missing-pvs-2.02.66.txt \
872 test/ganeti-cli.test \
874 test/import-export_unittest-helper
877 doc/examples/rapi_testutils.py \
878 test/cfgupgrade_unittest.py \
879 test/docs_unittest.py \
880 test/ganeti.asyncnotifier_unittest.py \
881 test/ganeti.backend_unittest.py \
882 test/ganeti.bdev_unittest.py \
883 test/ganeti.cli_unittest.py \
884 test/ganeti.client.gnt_cluster_unittest.py \
885 test/ganeti.client.gnt_instance_unittest.py \
886 test/ganeti.client.gnt_job_unittest.py \
887 test/ganeti.cmdlib_unittest.py \
888 test/ganeti.compat_unittest.py \
889 test/ganeti.confd.client_unittest.py \
890 test/ganeti.config_unittest.py \
891 test/ganeti.constants_unittest.py \
892 test/ganeti.daemon_unittest.py \
893 test/ganeti.errors_unittest.py \
894 test/ganeti.hooks_unittest.py \
895 test/ganeti.ht_unittest.py \
896 test/ganeti.http_unittest.py \
897 test/ganeti.hypervisor.hv_chroot_unittest.py \
898 test/ganeti.hypervisor.hv_fake_unittest.py \
899 test/ganeti.hypervisor.hv_kvm_unittest.py \
900 test/ganeti.hypervisor.hv_lxc_unittest.py \
901 test/ganeti.hypervisor.hv_xen_unittest.py \
902 test/ganeti.hypervisor_unittest.py \
903 test/ganeti.impexpd_unittest.py \
904 test/ganeti.jqueue_unittest.py \
905 test/ganeti.jstore_unittest.py \
906 test/ganeti.locking_unittest.py \
907 test/ganeti.luxi_unittest.py \
908 test/ganeti.masterd.iallocator_unittest.py \
909 test/ganeti.masterd.instance_unittest.py \
910 test/ganeti.mcpu_unittest.py \
911 test/ganeti.netutils_unittest.py \
912 test/ganeti.objects_unittest.py \
913 test/ganeti.objectutils_unittest.py \
914 test/ganeti.opcodes_unittest.py \
915 test/ganeti.ovf_unittest.py \
916 test/ganeti.qlang_unittest.py \
917 test/ganeti.query_unittest.py \
918 test/ganeti.rapi.baserlib_unittest.py \
919 test/ganeti.rapi.client_unittest.py \
920 test/ganeti.rapi.resources_unittest.py \
921 test/ganeti.rapi.rlib2_unittest.py \
922 test/ganeti.rapi.testutils_unittest.py \
923 test/ganeti.rpc_unittest.py \
924 test/ganeti.runtime_unittest.py \
925 test/ganeti.serializer_unittest.py \
926 test/ganeti.ssh_unittest.py \
927 test/ganeti.storage_unittest.py \
928 test/ganeti.tools.ensure_dirs_unittest.py \
929 test/ganeti.uidpool_unittest.py \
930 test/ganeti.utils.algo_unittest.py \
931 test/ganeti.utils.filelock_unittest.py \
932 test/ganeti.utils.hash_unittest.py \
933 test/ganeti.utils.io_unittest-runasroot.py \
934 test/ganeti.utils.io_unittest.py \
935 test/ganeti.utils.log_unittest.py \
936 test/ganeti.utils.mlock_unittest.py \
937 test/ganeti.utils.nodesetup_unittest.py \
938 test/ganeti.utils.process_unittest.py \
939 test/ganeti.utils.retry_unittest.py \
940 test/ganeti.utils.text_unittest.py \
941 test/ganeti.utils.wrapper_unittest.py \
942 test/ganeti.utils.x509_unittest.py \
943 test/ganeti.utils_unittest.py \
944 test/ganeti.vcluster_unittest.py \
945 test/ganeti.workerpool_unittest.py \
946 test/pycurl_reset_unittest.py \
947 test/qa.qa_config_unittest.py \
948 test/tempfile_fork_unittest.py
950 haskell_tests = htest/test
953 test/check-cert-expired_unittest.bash \
954 test/daemon-util_unittest.bash \
955 test/ganeti-cleaner_unittest.bash \
956 test/import-export_unittest.bash \
958 test/bash_completion.bash \
965 nodist_TESTS += $(haskell_tests)
966 dist_TESTS += htest/offline-test.sh
967 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
970 TESTS = $(dist_TESTS) $(nodist_TESTS)
972 # Environment for all tests
973 PLAIN_TESTS_ENVIRONMENT = \
975 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
976 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
979 # Environment for tests run by automake
980 TESTS_ENVIRONMENT = \
981 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
984 $(dist_sbin_SCRIPTS) \
986 $(pkglib_python_scripts) \
987 $(nodist_pkglib_python_scripts) \
989 $(pkgpython_PYTHON) \
991 $(hypervisor_PYTHON) \
1006 test/check-cert-expired_unittest.bash \
1007 test/daemon-util_unittest.bash \
1008 test/ganeti-cleaner_unittest.bash \
1009 test/import-export_unittest.bash \
1010 test/cli-test.bash \
1011 test/bash_completion.bash \
1012 htest/offline-test.sh \
1013 htest/cli-tests-defs.sh \
1014 $(all_python_code) \
1015 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
1017 check_python_code = \
1018 $(BUILD_BASH_COMPLETION) \
1024 lint_python_code = \
1026 ganeti/http/server.py \
1027 $(dist_sbin_SCRIPTS) \
1029 $(pkglib_python_scripts) \
1030 $(BUILD_BASH_COMPLETION) \
1036 standalone_python_modules = \
1037 lib/rapi/client.py \
1038 tools/ganeti-listrunner
1040 pep8_python_code = \
1042 ganeti/http/server.py \
1043 $(dist_sbin_SCRIPTS) \
1045 $(pkglib_python_scripts) \
1046 $(BUILD_BASH_COMPLETION) \
1049 $(PYTHON_BOOTSTRAP) \
1052 test/daemon-util_unittest.bash: daemons/daemon-util
1054 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1056 test/bash_completion.bash: doc/examples/bash_completion-debug
1058 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1059 sed -f $(REPLACE_VARS_SED) < $< > $@
1062 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
1063 sed -f $(REPLACE_VARS_SED) < $< > $@
1066 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1067 sed -f $(REPLACE_VARS_SED) < $< > $@
1070 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1071 sed -f $(REPLACE_VARS_SED) < $< > $@
1074 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1075 sed -f $(REPLACE_VARS_SED) < $< > $@
1077 doc/examples/bash_completion: BC_ARGS = --compact
1078 doc/examples/bash_completion-debug: BC_ARGS =
1080 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1081 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1082 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1083 daemons/ganeti-cleaner \
1084 $(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1085 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1086 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1088 doc/%.png: doc/%.dot
1089 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1090 $(DOT) -Tpng -o $@ $<
1092 man/footer.man: man/footer.rst
1093 @test -n "$(PANDOC)" || \
1094 { echo 'pandoc' not found during configure; exit 1; }
1095 $(PANDOC) -f rst -t man -o $@ $<
1097 man/footer.html: man/footer.rst
1098 @test -n "$(PANDOC)" || \
1099 { echo 'pandoc' not found during configure; exit 1; }
1100 $(PANDOC) -f rst -t html -o $@ $<
1102 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1103 lib/build/shell_example_lexer.py \
1104 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1105 @echo "Checking $< for hardcoded paths..."
1106 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1107 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1111 trap 'echo auto-removing $@; rm $@' EXIT; \
1112 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1115 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1116 @test -n "$(PANDOC)" || \
1117 { echo 'pandoc' not found during configure; exit 1; }
1119 trap 'echo auto-removing $@; rm $@' EXIT; \
1120 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1121 sed -e 's/\\@/@/g' > $@; \
1122 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1123 $(CHECK_MAN_DASHES) $@; \
1127 man/%.html.in: man/%.gen man/footer.html
1128 @test -n "$(PANDOC)" || \
1129 { echo 'pandoc' not found during configure; exit 1; }
1131 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1132 sed -e 's/\\@/@/g' > $@
1134 man/%: man/%.in $(REPLACE_VARS_SED)
1135 sed -f $(REPLACE_VARS_SED) < $< > $@
1137 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1138 sed -f $(REPLACE_VARS_SED) < $< > $@
1141 if test -d .git; then \
1142 git describe > $@; \
1143 elif test ! -f $@ ; then \
1144 echo "Cannot auto-generate $@ file"; exit 1; \
1147 .PHONY: clean-vcs-version
1151 .PHONY: regen-vcs-version
1155 if test -d .git; then \
1156 $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1157 $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1160 htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1161 vcs-version $(built_base_sources)
1163 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1164 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1166 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1167 lib/constants.py lib/_autoconf.py lib/luxi.py \
1168 $(CONVERT_CONSTANTS) $(built_base_sources) \
1169 | lib/_vcsversion.py
1171 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1173 htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1174 $(built_base_sources)
1178 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1179 echo "import $$name ()" ; \
1183 lib/_autoconf.py: Makefile | stamp-directories
1185 { echo '# This file is automatically generated, do not edit!'; \
1188 echo '"""Build-time configuration for Ganeti.'; \
1190 echo 'This file is autogenerated by the build process.'; \
1191 echo 'For any changes you need to re-run ./configure (and'; \
1192 echo 'not edit by hand).'; \
1196 echo '# pylint: disable=C0301,C0324'; \
1197 echo '# because this is autogenerated, we do not want'; \
1198 echo '# style warnings' ; \
1200 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1201 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1202 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1203 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1204 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1205 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1206 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1207 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1208 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1209 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1210 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1211 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1212 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1213 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1214 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1215 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1216 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1217 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1218 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1219 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1220 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1221 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1222 echo "KVM_PATH = '$(KVM_PATH)'"; \
1223 echo "IP_PATH = '$(IP_PATH)'"; \
1224 echo "SOCAT_PATH = '$(SOCAT)'"; \
1225 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1226 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1227 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1228 echo "TOOLSDIR = '$(toolsdir)'"; \
1229 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1230 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1231 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1232 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1233 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1234 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1235 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1236 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1237 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1238 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1239 echo "RAPI_USER = '$(RAPI_USER)'"; \
1240 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1241 echo "CONFD_USER = '$(CONFD_USER)'"; \
1242 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1243 echo "NODED_USER = '$(NODED_USER)'"; \
1244 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1245 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1246 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1247 echo "HTOOLS = True"; \
1248 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1249 echo "XEN_CMD = '$(XEN_CMD)'"; \
1250 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1253 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1255 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1256 { echo '# This file is automatically generated, do not edit!'; \
1259 echo '"""Build-time VCS version number 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 "VCS_VERSION = '$$VCSVER'"; \
1274 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1275 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1277 $(SHELL_ENV_INIT): Makefile stamp-directories
1279 { echo '# Allow overriding for tests'; \
1280 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1281 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1283 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1284 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1285 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1286 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1287 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1290 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1292 { echo 's#@PREFIX@#$(prefix)#g'; \
1293 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1294 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1295 echo 's#@BINDIR@#$(bindir)#g'; \
1296 echo 's#@SBINDIR@#$(sbindir)#g'; \
1297 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1298 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1299 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1300 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1301 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1302 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1303 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1304 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1305 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1306 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1307 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1308 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1309 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1310 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1311 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1312 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1313 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1314 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1315 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1316 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1317 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1319 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1320 echo ' r $(SHELL_ENV_INIT)'; \
1325 # Using deferred evaluation
1326 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1327 daemons/ganeti-watcher: MODULE = ganeti.watcher
1328 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1329 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1330 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1332 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1333 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1335 { echo '#!/usr/bin/python'; \
1336 echo '# This file is automatically generated, do not edit!'; \
1337 echo "# Edit $(MODULE) instead."; \
1339 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1341 echo '# pylint: disable=C0103'; \
1342 echo '# C0103: Invalid name'; \
1344 echo 'import sys'; \
1345 echo 'import $(MODULE) as main'; \
1347 echo '# Temporarily alias commands until bash completion'; \
1348 echo '# generator is changed'; \
1349 echo 'if hasattr(main, "commands"):'; \
1350 echo ' commands = main.commands # pylint: disable=E1101'; \
1351 echo 'if hasattr(main, "aliases"):'; \
1352 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1354 echo 'if __name__ == "__main__":'; \
1355 echo ' sys.exit(main.Main())'; \
1359 $(HS_BUILT_TEST_HELPERS): Makefile
1360 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1362 { echo '#!/bin/sh'; \
1363 echo '# This file is automatically generated, do not edit!'; \
1364 echo "# Edit Makefile.am instead."; \
1366 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1370 stamp-directories: Makefile
1371 $(MAKE) $(AM_MAKEFLAGS) ganeti
1372 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1375 # We need to create symlinks because "make distcheck" will not install Python
1376 # files when building.
1377 stamp-srclinks: Makefile | stamp-directories
1379 for i in $(srclink_files); do \
1380 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1381 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1388 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1391 check-dirs: $(GENERATED_FILES)
1393 find . -type d \( \( -name . \) -o \( \
1395 -name autom4te.cache \
1396 \) -prune -o -print \) | { \
1398 while read dir; do \
1400 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1401 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1404 for dir in $(DIRS); do \
1405 if ! test -d "$$dir"; then \
1406 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1410 if test -n "$$error"; then exit 1; else exit 0; fi; \
1414 check-local: check-dirs $(GENERATED_FILES)
1415 $(CHECK_PYTHON_CODE) $(check_python_code)
1416 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1417 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1418 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1419 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1420 @expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1421 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1422 echo "Incorrect version in README, expected $$expver"; \
1425 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1426 doc/security.rst; do \
1427 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1428 "Documents Ganeti version $$expver"; then \
1429 echo "Incorrect version in $$file, expected $$expver"; \
1433 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1434 echo "File $(top_srcdir)/doc/design-$$expver.rst not found"; \
1439 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1442 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1444 # E111: indentation is not a multiple of four
1445 # E121: continuation line indentation is not a multiple of four
1446 # (since our indent level is not 4)
1447 # E125: continuation line does not distinguish itself from next logical line
1448 # (since our indent level is not 4)
1449 # E127: continuation line over-indented for visual indent
1450 # (since our indent level is not 4)
1451 # note: do NOT add E128 here; it's a valid style error in most cases!
1452 # I've seen real errors, but also some cases were we indent wrongly
1453 # due to line length; try to rework the cases where it is triggered,
1454 # instead of silencing it
1455 # E261: at least two spaces before inline comment
1456 # E501: line too long (80 characters)
1457 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1459 # For excluding pep8 expects filenames only, not whole paths
1460 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1462 LINT_TARGETS = pylint pylint-qa
1464 LINT_TARGETS += pep8
1467 LINT_TARGETS += hlint
1471 lint: $(LINT_TARGETS)
1474 pylint: $(GENERATED_FILES)
1475 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1476 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1479 pylint-qa: $(GENERATED_FILES)
1480 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1481 cd $(top_srcdir)/qa && \
1482 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1483 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1486 pep8: $(GENERATED_FILES)
1487 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1488 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1489 --repeat $(pep8_python_code)
1491 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1493 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1494 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1495 if tty -s; then C="-c"; else C=""; fi; \
1496 $(HLINT) --report=doc/hs-lint.html --cross $$C \
1497 --ignore "Use first" \
1498 --ignore "Use comparing" \
1500 --ignore "Reduce duplication" \
1501 --ignore "Use &&&" \
1502 --ignore "Use void" \
1503 --hint htools/lint-hints \
1504 $(filter-out htools/Ganeti/THH.hs,$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1506 # a dist hook rule for updating the vcs-version file; this is
1507 # hardcoded due to where it needs to build the file...
1509 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1510 rm -f $(top_distdir)/vcs-version
1511 cp -p $(srcdir)/vcs-version $(top_distdir)
1513 # a distcheck hook rule for catching revision control directories
1515 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1516 echo "Found revision control files in final archive." 1>&2; \
1519 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1520 echo "Found Python byte code in final archive." 1>&2; \
1523 if find $(top_distdir) -name '*~' | grep .; then \
1524 echo "Found backup files in final archive." 1>&2; \
1527 # Empty files or directories should not be distributed. They can cause
1528 # unnecessary warnings for packagers. Directories used by automake during
1529 # distcheck must be excluded.
1530 if find $(top_distdir) -empty -and -not \( \
1531 -path $(top_distdir)/_build -or \
1532 -path $(top_distdir)/_inst \) | grep .; then \
1533 echo "Found empty files or directories in final archive." 1>&2; \
1536 if test -n "$(BUILD_RELEASE)" && \
1537 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1538 echo "Found unreleased version in NEWS." >&2; \
1542 # When building a release, stricter checks should be used
1543 distcheck-release dist-release: export BUILD_RELEASE = 1
1544 distcheck-release: distcheck
1546 distrebuildcheck: dist
1548 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1549 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1551 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1554 $(MAKE) maintainer-clean; \
1555 cp $(abs_srcdir)/vcs-version .; \
1557 $(MAKE) $(AM_MAKEFLAGS)
1561 for i in $(DIST_ARCHIVES); do \
1562 echo -n "Checking $$i ... "; \
1563 autotools/check-tar < $$i; \
1568 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1569 "$(DESTDIR)${localstatedir}/log/ganeti" \
1570 "$(DESTDIR)${localstatedir}/run/ganeti"
1573 if WANT_HTOOLSAPIDOC
1574 apidoc: py-apidoc hs-apidoc
1580 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1581 $(RUN_IN_TEMPDIR) epydoc -v \
1582 --conf $(CURDIR)/epydoc.conf \
1583 --output $(CURDIR)/$(APIDOC_PY_DIR)
1586 hs-apidoc: $(HS_BUILT_SRCS)
1587 @test -n "$(HSCOLOUR)" || \
1588 { echo 'HsColour' not found during configure; exit 1; }
1589 @test -n "$(HADDOCK)" || \
1590 { echo 'haddock' not found during configure; exit 1; }
1591 rm -rf $(APIDOC_HS_DIR)/*
1592 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1593 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1594 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1595 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1596 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1597 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1600 if [ "$(HTOOLS_NOCURL)" ]; \
1601 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1604 if [ "$(HTOOLS_PARALLEL3)" ]; \
1605 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1607 if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1608 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1610 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1611 for file in $$RELSRCS; do \
1612 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1613 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1615 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1616 -t ganeti -p haddock-prologue \
1617 --source-module="%{MODULE/.//}.html" \
1618 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1620 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1623 TAGS: $(GENERATED_FILES)
1625 $(GHC) -e ":etags" -v0 \
1626 $(filter-out -O -Werror,$(HFLAGS)) \
1627 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1629 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1630 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1631 -path './qa/*.py' | \
1632 etags -l python -a -
1636 coverage: py-coverage hs-coverage
1638 coverage: py-coverage
1642 py-coverage: $(GENERATED_FILES) $(python_tests)
1644 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1645 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1646 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1647 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1651 hs-coverage: $(haskell_tests) htest/hpc-htools
1653 $(MAKE) $(AM_MAKEFLAGS) hs-check
1654 @mkdir_p@ $(COVERAGE_HS_DIR)
1655 hpc combine --union $(HPCEXCL) \
1656 test.tix hpc-htools.tix > coverage-htools.tix
1657 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1658 hpc report coverage-htools.tix
1659 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1661 # Special "kind-of-QA" target for htools, needs special setup (all
1662 # tools compiled with -fhpc)
1667 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1668 rm -f *.tix *.mix; \
1670 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1671 --output=live-test.tix ; \
1672 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1673 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1674 --srcdir=.. $(HPCEXCL) ; \
1675 hpc report --srcdir=.. live-test $(HPCEXCL)
1677 commit-check: distcheck lint apidoc
1679 .PHONY: gitignore-check
1681 @if [ -n "`git status --short`" ]; then \
1682 echo "Git status is not clean!" 1>&2 ; \
1683 git status --short; \
1687 # Target that builds all binaries (including those that are not
1688 # rebuilt except when running the tests)
1690 really-all: all $(check_SCRIPTS) $(haskell_tests)
1692 # we don't need the ancient implicit rules:
1699 -include ./Makefile.local