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
35 # Note: these are automake-specific variables, and must be named after
36 # the directory + 'dir' suffix
37 clientdir = $(pkgpythondir)/client
38 hypervisordir = $(pkgpythondir)/hypervisor
39 httpdir = $(pkgpythondir)/http
40 masterddir = $(pkgpythondir)/masterd
41 confddir = $(pkgpythondir)/confd
42 rapidir = $(pkgpythondir)/rapi
43 serverdir = $(pkgpythondir)/server
44 watcherdir = $(pkgpythondir)/watcher
45 impexpddir = $(pkgpythondir)/impexpd
46 utilsdir = $(pkgpythondir)/utils
47 toolsdir = $(pkglibdir)/tools
48 iallocatorsdir = $(pkglibdir)/iallocators
49 pytoolsdir = $(pkgpythondir)/tools
50 docdir = $(datadir)/doc/$(PACKAGE)
51 myexeclibdir = $(pkglibdir)
53 # Delete output file if an error occurred while building it
60 htools/Ganeti/HTools \
61 htools/Ganeti/HTools/Program
70 doc/examples/gnt-debug \
90 test/data/htools/rapi \
92 test/data/ovfdata/other \
95 BUILDTIME_DIR_AUTOCREATE = \
100 $(APIDOC_HS_DIR)/Ganeti \
101 $(APIDOC_HS_DIR)/Ganeti/Confd \
102 $(APIDOC_HS_DIR)/Ganeti/HTools \
103 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
110 $(BUILDTIME_DIR_AUTOCREATE) \
115 ganeti-[0-9]*.[0-9]*.[0-9]* \
118 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
121 COVERAGE_DIR = doc/coverage
122 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
123 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
125 APIDOC_PY_DIR = $(APIDOC_DIR)/py
126 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
128 MAINTAINERCLEANFILES = \
131 doc/install-quick.rst \
136 maintainer-clean-local:
137 rm -rf $(BUILDTIME_DIRS)
140 $(addsuffix /*.py[co],$(DIRS)) \
141 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
142 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
144 $(PYTHON_BOOTSTRAP) \
146 autotools/replace_vars.sed \
147 daemons/daemon-util \
148 daemons/ganeti-cleaner \
151 doc/examples/bash_completion \
152 lib/_generated_rpc.py \
157 $(nodist_pkgpython_PYTHON) \
158 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
159 $(HS_BUILT_TEST_HELPERS) \
160 .hpc/*.mix htools/*.tix \
163 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
164 # it'll cause the target to rebuild every time.
166 $(built_base_sources) \
167 $(BUILT_PYTHON_SOURCES) \
170 built_base_sources = \
175 built_python_base_sources = \
179 BUILT_PYTHON_SOURCES = \
180 $(built_python_base_sources) \
181 lib/_generated_rpc.py
183 # Generating the RPC wrappers depends on many things, so make sure it's built at
184 # the end of the built sources
185 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
187 # these are all built from the underlying %.in sources
189 doc/examples/ganeti-kvm-poweroff.initd \
190 doc/examples/ganeti.cron \
191 doc/examples/ganeti.initd \
192 doc/examples/gnt-config-backup \
193 doc/examples/hooks/ipsec
195 nodist_pkgpython_PYTHON = \
196 $(BUILT_PYTHON_SOURCES)
199 lib/build/__init__.py \
200 lib/build/sphinx_ext.py \
201 lib/build/shell_example_lexer.py
205 lib/asyncnotifier.py \
239 lib/client/__init__.py \
240 lib/client/gnt_backup.py \
241 lib/client/gnt_cluster.py \
242 lib/client/gnt_debug.py \
243 lib/client/gnt_group.py \
244 lib/client/gnt_instance.py \
245 lib/client/gnt_job.py \
246 lib/client/gnt_node.py \
249 hypervisor_PYTHON = \
250 lib/hypervisor/__init__.py \
251 lib/hypervisor/hv_base.py \
252 lib/hypervisor/hv_chroot.py \
253 lib/hypervisor/hv_fake.py \
254 lib/hypervisor/hv_kvm.py \
255 lib/hypervisor/hv_lxc.py \
256 lib/hypervisor/hv_xen.py
259 lib/rapi/__init__.py \
260 lib/rapi/baserlib.py \
262 lib/rapi/client_utils.py \
263 lib/rapi/connector.py \
265 lib/rapi/testutils.py
268 lib/http/__init__.py \
274 lib/confd/__init__.py \
275 lib/confd/client.py \
276 lib/confd/querylib.py \
280 lib/masterd/__init__.py \
281 lib/masterd/instance.py
284 lib/impexpd/__init__.py
287 lib/watcher/__init__.py \
288 lib/watcher/nodemaint.py \
292 lib/server/__init__.py \
293 lib/server/confd.py \
294 lib/server/masterd.py \
295 lib/server/noded.py \
299 lib/tools/__init__.py \
300 lib/tools/ensure_dirs.py
303 lib/utils/__init__.py \
305 lib/utils/filelock.py \
310 lib/utils/nodesetup.py \
311 lib/utils/process.py \
314 lib/utils/wrapper.py \
323 doc/design-htools-2.3.rst \
326 doc/design-draft.rst \
328 doc/design-cpu-pinning.rst \
329 doc/design-query2.rst \
330 doc/design-x509-ca.rst \
331 doc/design-http-server.rst \
332 doc/design-impexp2.rst \
333 doc/design-lu-generated-jobs.rst \
334 doc/design-multi-reloc.rst \
335 doc/design-network.rst \
336 doc/design-chained-jobs.rst \
337 doc/design-ovf-support.rst \
338 doc/design-resource-model.rst \
339 doc/cluster-merge.rst \
340 doc/design-shared-storage.rst \
341 doc/design-node-state-cache.rst \
342 doc/design-virtual-clusters.rst \
348 doc/install-quick.rst \
351 doc/move-instance.rst \
358 HS_PROGS = htools/htools
359 HS_BIN_ROLES = hbal hscan hspace hinfo
361 HS_ALL_PROGS = $(HS_PROGS) htools/test htools/hpc-htools htools/hconfd
362 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
363 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail
365 HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
366 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
368 # internal extra flags (used for htools/test mainly)
370 # exclude options for coverage reports
371 HPCEXCL = --exclude Main \
372 --exclude Ganeti.Constants \
373 --exclude Ganeti.THH \
374 --exclude Ganeti.HTools.QC \
375 --exclude Ganeti.HTools.QCHelper \
376 --exclude Ganeti.HTools.Version
379 htools/Ganeti/HTools/CLI.hs \
380 htools/Ganeti/HTools/Cluster.hs \
381 htools/Ganeti/HTools/Compat.hs \
382 htools/Ganeti/HTools/Container.hs \
383 htools/Ganeti/HTools/ExtLoader.hs \
384 htools/Ganeti/HTools/Group.hs \
385 htools/Ganeti/HTools/IAlloc.hs \
386 htools/Ganeti/HTools/Instance.hs \
387 htools/Ganeti/HTools/JSON.hs \
388 htools/Ganeti/HTools/Loader.hs \
389 htools/Ganeti/HTools/Luxi.hs \
390 htools/Ganeti/HTools/Node.hs \
391 htools/Ganeti/HTools/PeerMap.hs \
392 htools/Ganeti/HTools/QC.hs \
393 htools/Ganeti/HTools/QCHelper.hs \
394 htools/Ganeti/HTools/Rapi.hs \
395 htools/Ganeti/HTools/Simu.hs \
396 htools/Ganeti/HTools/Text.hs \
397 htools/Ganeti/HTools/Types.hs \
398 htools/Ganeti/HTools/Utils.hs \
399 htools/Ganeti/HTools/Program.hs \
400 htools/Ganeti/HTools/Program/Hail.hs \
401 htools/Ganeti/HTools/Program/Hbal.hs \
402 htools/Ganeti/HTools/Program/Hinfo.hs \
403 htools/Ganeti/HTools/Program/Hscan.hs \
404 htools/Ganeti/HTools/Program/Hspace.hs \
405 htools/Ganeti/BasicTypes.hs \
406 htools/Ganeti/Confd.hs \
407 htools/Ganeti/Confd/Server.hs \
408 htools/Ganeti/Config.hs \
409 htools/Ganeti/Daemon.hs \
410 htools/Ganeti/Hash.hs \
411 htools/Ganeti/Jobs.hs \
412 htools/Ganeti/Logging.hs \
413 htools/Ganeti/Luxi.hs \
414 htools/Ganeti/Objects.hs \
415 htools/Ganeti/OpCodes.hs \
416 htools/Ganeti/Runtime.hs \
417 htools/Ganeti/Ssconf.hs \
420 HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
421 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
423 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
425 # Note: we use here an order-only prerequisite, as the contents of
426 # _autoconf.py are not actually influencing the html build output: it
427 # has to exist in order for the sphinx module to be loaded
428 # successfully, but we certainly don't want the docs to be rebuilt if
430 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
431 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
432 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
433 | $(BUILT_PYTHON_SOURCES)
434 @test -n "$(SPHINX)" || \
435 { echo 'sphinx-build' not found during configure; exit 1; }
437 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
439 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
440 -D release="$(PACKAGE_VERSION)" \
441 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
442 rm -f doc/html/.buildinfo doc/html/objects.inv
445 doc/html: doc/html/index.html
447 doc/install-quick.rst: INSTALL
449 doc/upgrade.rst: UPGRADE
451 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
453 { echo '.. This file is automatically updated at build time from $<.'; \
454 echo '.. Do not edit.'; \
461 doc/design-2.1-lock-acquire.dot \
462 doc/design-2.1-lock-release.dot
464 docpng = $(patsubst %.dot,%.png,$(docdot))
466 # Things to build but not to install (add it to EXTRA_DIST if it should be
472 doc/examples/bash_completion \
477 scripts/gnt-cluster \
480 scripts/gnt-instance \
485 PYTHON_BOOTSTRAP_SBIN = \
486 daemons/ganeti-masterd \
487 daemons/ganeti-noded \
488 daemons/ganeti-watcher \
489 daemons/ganeti-rapi \
493 PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
497 $(PYTHON_BOOTSTRAP_SBIN) \
518 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
520 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
521 # FIXME: this is a hardcoded logic, instead of auto-resolving
522 $(LN_S) -f ../../../bin/htools \
523 $(DESTDIR)$(iallocatorsdir)/hail
524 for role in $(HS_BIN_ROLES); do \
526 $(DESTDIR)$(bindir)/$$role ; \
529 mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
533 $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
534 @if [ -z "$(HTOOLS)" ]; then \
535 echo "Error: htools compilation disabled at configure time" 1>&2 ;\
538 @BINARY=$(@:htools/%=%); \
539 if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
540 echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
543 rm -f $(@:htools/%=%).tix
544 BINARY=$(@:htools/%=%); $(GHC) --make \
546 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
547 -osuf $$BINARY.o -hisuf $$BINARY.hi \
548 $(HEXTRA) $(HEXTRA_INT) $@
549 # for the htools/test binary, we need to enable profiling/coverage
550 htools/test: HEXTRA_INT=-fhpc -Wwarn -fno-warn-missing-signatures \
551 -fno-warn-monomorphism-restriction -fno-warn-orphans \
552 -fno-warn-missing-methods -fno-warn-unused-imports
554 # we compile the hpc-htools binary with the program coverage
555 htools/hpc-htools: HEXTRA_INT=-fhpc
558 htools/offline-tests.sh: htools/hpc-htools
560 # rules for building profiling-enabled versions of the haskell
561 # programs: hs-prof does the full two-step build, whereas
562 # hs-prof-quick does only the final rebuild (hs-prof must have been
564 .PHONY: hs-prof hs-prof-quick
567 $(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
568 rm -f $(HS_ALL_PROGS)
569 $(MAKE) hs-prof-quick
572 $(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
574 dist_sbin_SCRIPTS = \
575 tools/ganeti-listrunner
577 nodist_sbin_SCRIPTS = \
578 $(PYTHON_BOOTSTRAP_SBIN) \
579 daemons/ganeti-cleaner
582 nodist_sbin_SCRIPTS += htools/hconfd
590 tools/cluster-merge \
594 tools/move-instance \
597 tools/sanitize-config
599 dist_tools_SCRIPTS = \
601 tools/kvm-console-wrapper \
602 tools/xm-console-wrapper \
603 tools/master-ip-setup
605 pkglib_python_scripts = \
606 daemons/import-export \
607 tools/check-cert-expired
609 nodist_pkglib_python_scripts = \
612 myexeclib_SCRIPTS = \
613 daemons/daemon-util \
615 $(pkglib_python_scripts)
617 nodist_myexeclib_SCRIPTS = \
618 $(nodist_pkglib_python_scripts)
625 autotools/build-bash-completion \
626 autotools/build-rpc \
627 autotools/check-header \
628 autotools/check-python-code \
629 autotools/check-imports \
630 autotools/check-man-dashes \
631 autotools/check-man-warnings \
632 autotools/check-news \
633 autotools/check-tar \
634 autotools/check-version \
635 autotools/convert-constants \
637 autotools/gen-coverage \
638 autotools/testrunner \
640 daemons/daemon-util.in \
641 daemons/ganeti-cleaner.in \
642 $(pkglib_python_scripts) \
650 $(BUILT_EXAMPLES:%=%.in) \
651 doc/examples/ganeti.default \
652 doc/examples/ganeti.default-debug \
653 doc/examples/hooks/ethers \
654 doc/examples/gnt-debug/README \
655 doc/examples/gnt-debug/delay0.json \
656 doc/examples/gnt-debug/delay50.json \
667 $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
669 htools/lint-hints.hs \
670 htools/cli-tests-defs.sh \
671 htools/offline-test.sh
675 man/ganeti-cleaner.8 \
677 man/ganeti-listrunner.8 \
678 man/ganeti-masterd.8 \
680 man/ganeti-os-interface.7 \
682 man/ganeti-watcher.8 \
698 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
699 manhtml = $(patsubst %.rst,%.html,$(manrst))
700 mangen = $(patsubst %.rst,%.gen,$(manrst))
702 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
703 $(patsubst %.html,%.html.in,$(manhtml)) \
704 man/footer.man man/footer.html $(mangen)
707 test/data/bdev-drbd-8.0.txt \
708 test/data/bdev-drbd-8.3.txt \
709 test/data/bdev-drbd-disk.txt \
710 test/data/bdev-drbd-net-ip4.txt \
711 test/data/bdev-drbd-net-ip6.txt \
712 test/data/cert1.pem \
713 test/data/ip-addr-show-dummy0.txt \
714 test/data/ip-addr-show-lo-ipv4.txt \
715 test/data/ip-addr-show-lo-ipv6.txt \
716 test/data/ip-addr-show-lo-oneline-ipv4.txt \
717 test/data/ip-addr-show-lo-oneline-ipv6.txt \
718 test/data/ip-addr-show-lo-oneline.txt \
719 test/data/ip-addr-show-lo.txt \
720 test/data/proc_drbd8.txt \
721 test/data/proc_drbd80-emptyline.txt \
722 test/data/proc_drbd83.txt \
723 test/data/proc_drbd83_sync.txt \
724 test/data/proc_drbd83_sync_krnl2.6.39.txt \
725 test/data/kvm_1.0_help.txt \
726 test/data/kvm_0.15.90_help.txt \
727 test/data/kvm_0.12.5_help.txt \
728 test/data/kvm_0.9.1_help.txt \
729 test/data/sys_drbd_usermode_helper.txt \
730 test/data/htools/hail-alloc-drbd.json \
731 test/data/htools/hail-change-group.json \
732 test/data/htools/hail-invalid-reloc.json \
733 test/data/htools/hail-node-evac.json \
734 test/data/htools/hail-reloc-drbd.json \
735 test/data/htools/common-suffix.data \
736 test/data/htools/invalid-node.data \
737 test/data/htools/missing-resources.data \
738 test/data/htools/rapi/groups.json \
739 test/data/htools/rapi/info.json \
740 test/data/htools/rapi/instances.json \
741 test/data/htools/rapi/nodes.json \
742 test/data/ovfdata/compr_disk.vmdk.gz \
743 test/data/ovfdata/config.ini \
744 test/data/ovfdata/corrupted_resources.ovf \
745 test/data/ovfdata/empty.ini \
746 test/data/ovfdata/empty.ovf \
747 test/data/ovfdata/ganeti.mf \
748 test/data/ovfdata/ganeti.ovf \
749 test/data/ovfdata/gzip_disk.ovf \
750 test/data/ovfdata/new_disk.vmdk \
751 test/data/ovfdata/no_disk.ini \
752 test/data/ovfdata/no_disk_in_ref.ovf \
753 test/data/ovfdata/no_os.ini \
754 test/data/ovfdata/no_ovf.ova \
755 test/data/ovfdata/ova.ova \
756 test/data/ovfdata/second_disk.vmdk \
757 test/data/ovfdata/rawdisk.raw \
758 test/data/ovfdata/unsafe_path.ini \
759 test/data/ovfdata/virtualbox.ovf \
760 test/data/ovfdata/wrong_extension.ovd \
761 test/data/ovfdata/wrong_config.ini \
762 test/data/ovfdata/wrong_manifest.mf \
763 test/data/ovfdata/wrong_manifest.ovf \
764 test/data/ovfdata/wrong_ova.ova \
765 test/data/ovfdata/wrong_xml.ovf \
766 test/data/ovfdata/other/rawdisk.raw \
767 test/data/vgreduce-removemissing-2.02.02.txt \
768 test/data/vgreduce-removemissing-2.02.66-fail.txt \
769 test/data/vgreduce-removemissing-2.02.66-ok.txt \
770 test/data/vgs-missing-pvs-2.02.02.txt \
771 test/data/vgs-missing-pvs-2.02.66.txt \
772 test/import-export_unittest-helper \
774 test/ganeti-cli.test \
775 test/htools-balancing.test \
776 test/htools-basic.test \
777 test/htools-dynutil.test \
778 test/htools-excl.test \
779 test/htools-hail.test \
780 test/htools-hspace.test \
781 test/htools-invalid.test \
782 test/htools-multi-group.test \
783 test/htools-no-backend.test \
784 test/htools-rapi.test \
785 test/htools-single-group.test \
786 test/htools-text-backend.test
789 test/ganeti.asyncnotifier_unittest.py \
790 test/ganeti.backend_unittest.py \
791 test/ganeti.bdev_unittest.py \
792 test/ganeti.cli_unittest.py \
793 test/ganeti.client.gnt_cluster_unittest.py \
794 test/ganeti.client.gnt_instance_unittest.py \
795 test/ganeti.daemon_unittest.py \
796 test/ganeti.cmdlib_unittest.py \
797 test/ganeti.compat_unittest.py \
798 test/ganeti.confd.client_unittest.py \
799 test/ganeti.config_unittest.py \
800 test/ganeti.constants_unittest.py \
801 test/ganeti.errors_unittest.py \
802 test/ganeti.hooks_unittest.py \
803 test/ganeti.ht_unittest.py \
804 test/ganeti.http_unittest.py \
805 test/ganeti.hypervisor_unittest.py \
806 test/ganeti.hypervisor.hv_chroot_unittest.py \
807 test/ganeti.hypervisor.hv_fake_unittest.py \
808 test/ganeti.hypervisor.hv_kvm_unittest.py \
809 test/ganeti.hypervisor.hv_lxc_unittest.py \
810 test/ganeti.hypervisor.hv_xen_unittest.py \
811 test/ganeti.impexpd_unittest.py \
812 test/ganeti.jqueue_unittest.py \
813 test/ganeti.locking_unittest.py \
814 test/ganeti.luxi_unittest.py \
815 test/ganeti.masterd.instance_unittest.py \
816 test/ganeti.mcpu_unittest.py \
817 test/ganeti.netutils_unittest.py \
818 test/ganeti.objects_unittest.py \
819 test/ganeti.opcodes_unittest.py \
820 test/ganeti.ovf_unittest.py \
821 test/ganeti.qlang_unittest.py \
822 test/ganeti.query_unittest.py \
823 test/ganeti.rapi.baserlib_unittest.py \
824 test/ganeti.rapi.client_unittest.py \
825 test/ganeti.rapi.resources_unittest.py \
826 test/ganeti.rapi.rlib2_unittest.py \
827 test/ganeti.rapi.testutils_unittest.py \
828 test/ganeti.rpc_unittest.py \
829 test/ganeti.runtime_unittest.py \
830 test/ganeti.serializer_unittest.py \
831 test/ganeti.ssh_unittest.py \
832 test/ganeti.storage_unittest.py \
833 test/ganeti.tools.ensure_dirs_unittest.py \
834 test/ganeti.uidpool_unittest.py \
835 test/ganeti.utils.algo_unittest.py \
836 test/ganeti.utils.filelock_unittest.py \
837 test/ganeti.utils.hash_unittest.py \
838 test/ganeti.utils.io_unittest.py \
839 test/ganeti.utils.log_unittest.py \
840 test/ganeti.utils.mlock_unittest.py \
841 test/ganeti.utils.nodesetup_unittest.py \
842 test/ganeti.utils.process_unittest.py \
843 test/ganeti.utils.retry_unittest.py \
844 test/ganeti.utils.text_unittest.py \
845 test/ganeti.utils.wrapper_unittest.py \
846 test/ganeti.utils.x509_unittest.py \
847 test/ganeti.utils_unittest.py \
848 test/ganeti.workerpool_unittest.py \
849 test/cfgupgrade_unittest.py \
850 test/docs_unittest.py \
851 test/pycurl_reset_unittest.py \
852 test/tempfile_fork_unittest.py
854 python_tests += test/ganeti.utils.io_unittest-runasroot.py
857 haskell_tests = htools/test
860 test/check-cert-expired_unittest.bash \
861 test/daemon-util_unittest.bash \
862 test/ganeti-cleaner_unittest.bash \
863 test/import-export_unittest.bash \
871 nodist_TESTS += $(haskell_tests)
872 dist_TESTS += htools/offline-test.sh
873 check_SCRIPTS += htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
876 TESTS = $(dist_TESTS) $(nodist_TESTS)
878 # Environment for all tests
879 PLAIN_TESTS_ENVIRONMENT = \
881 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
882 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
885 # Environment for tests run by automake
886 TESTS_ENVIRONMENT = \
887 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
890 $(dist_sbin_SCRIPTS) \
892 $(pkglib_python_scripts) \
893 $(nodist_pkglib_python_scripts) \
895 $(pkgpython_PYTHON) \
897 $(hypervisor_PYTHON) \
912 test/check-cert-expired_unittest.bash \
913 test/daemon-util_unittest.bash \
914 test/ganeti-cleaner_unittest.bash \
915 test/import-export_unittest.bash \
917 htools/offline-test.sh \
918 htools/cli-tests-defs.sh \
920 $(HS_LIB_SRCS) $(HS_PROG_SRCS)
922 check_python_code = \
923 $(BUILD_BASH_COMPLETION) \
931 ganeti/http/server.py \
932 $(dist_sbin_SCRIPTS) \
934 $(pkglib_python_scripts) \
935 $(BUILD_BASH_COMPLETION) \
941 standalone_python_modules = \
943 tools/ganeti-listrunner
947 ganeti/http/server.py \
948 $(dist_sbin_SCRIPTS) \
950 $(pkglib_python_scripts) \
951 $(BUILD_BASH_COMPLETION) \
954 $(PYTHON_BOOTSTRAP) \
957 test/daemon-util_unittest.bash: daemons/daemon-util
959 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
961 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
962 sed -f $(REPLACE_VARS_SED) < $< > $@
965 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
966 sed -f $(REPLACE_VARS_SED) < $< > $@
969 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
970 sed -f $(REPLACE_VARS_SED) < $< > $@
973 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
974 sed -f $(REPLACE_VARS_SED) < $< > $@
976 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
977 sed -f $(REPLACE_VARS_SED) < $< > $@
979 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
980 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
981 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
984 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
985 $(DOT) -Tpng -o $@ $<
987 man/footer.man: man/footer.rst
988 @test -n "$(PANDOC)" || \
989 { echo 'pandoc' not found during configure; exit 1; }
990 $(PANDOC) -f rst -t man -o $@ $<
992 man/footer.html: man/footer.rst
993 @test -n "$(PANDOC)" || \
994 { echo 'pandoc' not found during configure; exit 1; }
995 $(PANDOC) -f rst -t html -o $@ $<
997 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
998 lib/build/shell_example_lexer.py
999 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
1001 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1002 @test -n "$(PANDOC)" || \
1003 { echo 'pandoc' not found during configure; exit 1; }
1005 trap 'echo auto-removing $@; rm $@' EXIT; \
1006 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1007 sed -e 's/\\@/@/g' > $@; \
1008 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1009 $(CHECK_MAN_DASHES) $@; \
1013 man/%.html.in: man/%.gen man/footer.html
1014 @test -n "$(PANDOC)" || \
1015 { echo 'pandoc' not found during configure; exit 1; }
1017 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1018 sed -e 's/\\@/@/g' > $@
1020 man/%.1: man/%.1.in $(REPLACE_VARS_SED)
1021 sed -f $(REPLACE_VARS_SED) < $< > $@
1023 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
1024 sed -f $(REPLACE_VARS_SED) < $< > $@
1026 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
1027 sed -f $(REPLACE_VARS_SED) < $< > $@
1029 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
1030 sed -f $(REPLACE_VARS_SED) < $< > $@
1032 epydoc.conf: epydoc.conf.in Makefile
1033 sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
1036 if test -d .git; then \
1037 git describe > $@; \
1038 elif test ! -f $@ ; then \
1039 echo "Cannot auto-generate $@ file"; exit 1; \
1042 .PHONY: regen-vcs-version
1046 if test -d .git; then \
1047 rm -f vcs-version; \
1048 $(MAKE) vcs-version; \
1051 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
1053 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1054 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1056 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1057 lib/constants.py lib/_autoconf.py $(CONVERT_CONSTANTS) \
1058 | lib/_vcsversion.py
1060 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1062 lib/_autoconf.py: Makefile | lib/.dir
1064 { echo '# This file is automatically generated, do not edit!'; \
1067 echo '"""Build-time configuration for Ganeti.'; \
1069 echo 'This file is autogenerated by the build process.'; \
1070 echo 'For any changes you need to re-run ./configure (and'; \
1071 echo 'not edit by hand).'; \
1075 echo '# pylint: disable=C0301,C0324'; \
1076 echo '# because this is autogenerated, we do not want'; \
1077 echo '# style warnings' ; \
1079 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1080 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1081 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1082 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1083 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1084 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1085 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1086 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1087 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1088 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1089 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1090 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1091 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1092 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1093 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1094 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1095 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1096 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1097 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1098 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1099 echo "KVM_PATH = '$(KVM_PATH)'"; \
1100 echo "IP_PATH = '$(IP_PATH)'"; \
1101 echo "SOCAT_PATH = '$(SOCAT)'"; \
1102 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1103 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1104 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1105 echo "TOOLSDIR = '$(toolsdir)'"; \
1106 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1107 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1108 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1109 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1110 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1111 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1112 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1113 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1114 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1115 echo "RAPI_USER = '$(RAPI_USER)'"; \
1116 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1117 echo "CONFD_USER = '$(CONFD_USER)'"; \
1118 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1119 echo "NODED_USER = '$(NODED_USER)'"; \
1120 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1121 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1122 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1123 if [ "$(HTOOLS)" ]; then \
1124 echo "HTOOLS = True"; \
1126 echo "HTOOLS = False"; \
1128 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1129 echo "PY_CONFD = $(PY_CONFD)"; \
1130 echo "HS_CONFD = $(HS_CONFD)"; \
1133 lib/_vcsversion.py: Makefile vcs-version | lib/.dir
1135 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1136 { echo '# This file is automatically generated, do not edit!'; \
1139 echo '"""Build-time VCS version number for Ganeti.'; \
1141 echo 'This file is autogenerated by the build process.'; \
1142 echo 'For any changes you need to re-run ./configure (and'; \
1143 echo 'not edit by hand).'; \
1147 echo '# pylint: disable=C0301,C0324'; \
1148 echo '# because this is autogenerated, we do not want'; \
1149 echo '# style warnings' ; \
1151 echo "VCS_VERSION = '$$VCSVER'"; \
1154 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1155 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1157 $(REPLACE_VARS_SED): Makefile
1159 { echo 's#@PREFIX@#$(prefix)#g'; \
1160 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1161 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1162 echo 's#@BINDIR@#$(bindir)#g'; \
1163 echo 's#@SBINDIR@#$(sbindir)#g'; \
1164 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1165 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1166 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1167 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1168 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1169 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1170 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1171 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1172 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1173 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1174 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1175 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1176 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1177 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1178 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1179 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1180 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1181 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1182 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1185 # Using deferred evaluation
1186 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1187 daemons/ganeti-watcher: MODULE = ganeti.watcher
1188 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1189 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1190 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/%,%,$@)
1192 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
1193 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1195 { echo '#!/usr/bin/python'; \
1196 echo '# This file is automatically generated, do not edit!'; \
1197 echo "# Edit $(MODULE) instead."; \
1199 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1201 echo '# pylint: disable=C0103'; \
1202 echo '# C0103: Invalid name'; \
1204 echo 'import sys'; \
1205 echo 'import $(MODULE) as main'; \
1207 echo '# Temporarily alias commands until bash completion'; \
1208 echo '# generator is changed'; \
1209 echo 'if hasattr(main, "commands"):'; \
1210 echo ' commands = main.commands # pylint: disable=E1101'; \
1211 echo 'if hasattr(main, "aliases"):'; \
1212 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1214 echo 'if __name__ == "__main__":'; \
1215 echo ' sys.exit(main.Main())'; \
1219 $(HS_BUILT_TEST_HELPERS): Makefile
1220 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1222 { echo '#!/bin/sh'; \
1223 echo '# This file is automatically generated, do not edit!'; \
1224 echo "# Edit Makefile.am instead."; \
1226 echo "HTOOLS=$(TESTROLE) exec ./htools/hpc-htools \"\$$@\""; \
1230 # We need to create symlinks because "make distcheck" will not install Python
1231 # files when building.
1232 stamp-srclinks: Makefile | $(all_dirfiles)
1234 for i in $(srclink_files); do \
1235 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1236 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1243 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1246 check-dirs: $(BUILT_SOURCES)
1248 find . -type d \( \( -name . \) -o \( \
1250 -name autom4te.cache \
1251 \) -prune -o -print \) | { \
1253 while read dir; do \
1255 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1256 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1259 for dir in $(DIRS); do \
1260 if ! test -d "$$dir"; then \
1261 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1265 if test -n "$$error"; then exit 1; else exit 0; fi; \
1269 check-local: check-dirs $(BUILT_SOURCES)
1270 $(CHECK_PYTHON_CODE) $(check_python_code)
1271 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1272 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1273 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1274 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1275 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1276 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1277 echo "Incorrect version in README, expected $$expver"; \
1280 for file in doc/iallocator.rst doc/hooks.rst; do \
1281 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1282 "Documents Ganeti version $$expver"; then \
1283 echo "Incorrect version in $$file, expected $$expver"; \
1289 hs-check: htools/test htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
1292 HBINARY="./htools/hpc-htools" ./htools/offline-test.sh
1294 # E111: indentation is not a multiple of four
1295 # E261: at least two spaces before inline comment
1296 # E501: line too long (80 characters)
1297 PEP8_IGNORE = E111,E261,E501
1299 # For excluding pep8 expects filenames only, not whole paths
1300 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1303 lint: $(BUILT_SOURCES)
1304 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1305 if test -z "$(PEP8)"; then \
1306 echo '"pep8" not found during configure' >&2; \
1308 $(PEP8) --repeat --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1309 $(pep8_python_code); \
1311 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1312 cd $(top_srcdir)/qa && \
1313 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1314 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1317 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1318 if tty -s; then C="-c"; else C=""; fi; \
1319 hlint --report=doc/hs-lint.html --cross $$C \
1320 --ignore "Use first" \
1321 --ignore "Use comparing" \
1323 --ignore "Use Control.Exception.catch" \
1324 --ignore "Reduce duplication" \
1325 --hint htools/lint-hints \
1326 $(filter-out htools/Ganeti/THH.hs,$(HS_LIB_SRCS))
1328 # a dist hook rule for updating the vcs-version file; this is
1329 # hardcoded due to where it needs to build the file...
1331 $(MAKE) regen-vcs-version && \
1332 rm -f $(top_distdir)/vcs-version && \
1333 cp -p $(srcdir)/vcs-version $(top_distdir)
1335 # a distcheck hook rule for catching revision control directories
1337 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1338 echo "Found revision control files in final archive." 1>&2; \
1341 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1342 echo "Found Python byte code in final archive." 1>&2; \
1345 if find $(top_distdir) -name '*~' | grep .; then \
1346 echo "Found backup files in final archive." 1>&2; \
1349 # Empty files or directories should not be distributed. They can cause
1350 # unnecessary warnings for packagers. Directories used by automake during
1351 # distcheck must be excluded.
1352 if find $(top_distdir) -empty -and -not \( \
1353 -path $(top_distdir)/_build -or \
1354 -path $(top_distdir)/_inst \) | grep .; then \
1355 echo "Found empty files or directories in final archive." 1>&2; \
1358 if test -n "$(BUILD_RELEASE)" && \
1359 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1360 echo "Found unreleased version in NEWS." >&2; \
1364 # When building a release, stricter checks should be used
1365 distcheck-release dist-release: export BUILD_RELEASE = 1
1366 distcheck-release: distcheck
1370 for i in $(DIST_ARCHIVES); do \
1371 echo -n "Checking $$i ... "; \
1372 autotools/check-tar < $$i; \
1377 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1378 "$(DESTDIR)${localstatedir}/log/ganeti" \
1379 "$(DESTDIR)${localstatedir}/run/ganeti"
1381 # To avoid conflicts between directory names and other targets, a file inside
1382 # the directory is used to ensure its existence.
1384 @mkdir_p@ $* && touch $@
1387 if WANT_HTOOLSAPIDOC
1388 apidoc: py-apidoc hs-apidoc
1394 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1395 $(RUN_IN_TEMPDIR) epydoc -v \
1396 --conf $(CURDIR)/epydoc.conf \
1397 --output $(CURDIR)/$(APIDOC_PY_DIR)
1400 hs-apidoc: $(HS_BUILT_SRCS)
1401 @test -n "$(HSCOLOUR)" || \
1402 { echo 'HsColour' not found during configure; exit 1; }
1403 @test -n "$(HADDOCK)" || \
1404 { echo 'haddock' not found during configure; exit 1; }
1405 rm -rf $(APIDOC_HS_DIR)/*
1406 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1407 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1408 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1409 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1410 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1413 if [ "$(HTOOLS_NOCURL)" ]; \
1414 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1417 if [ "$(HTOOLS_PARALLEL3)" ]; \
1418 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1420 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \
1421 for file in $$RELSRCS; do \
1422 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1423 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1425 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1426 -t ganeti-htools -p haddock-prologue \
1427 --source-module="%{MODULE/.//}.html" \
1428 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1430 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1433 TAGS: $(BUILT_SOURCES)
1435 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1436 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1437 -path './qa/*.py' | \
1442 coverage: py-coverage hs-coverage
1444 coverage: py-coverage
1448 py-coverage: $(BUILT_SOURCES) $(python_tests)
1450 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1451 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1452 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1453 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1457 hs-coverage: $(haskell_tests) htools/hpc-htools
1458 rm -f *.tix && $(MAKE) hs-check
1459 @mkdir_p@ $(COVERAGE_HS_DIR)
1460 hpc combine $(HPCEXCL) test.tix hpc-htools.tix > coverage-htools.tix
1461 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1462 hpc report coverage-htools.tix
1463 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1465 # Special "kind-of-QA" target for htools, needs special setup (all
1466 # tools compiled with -fhpc)
1471 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1472 rm -f *.tix *.mix; \
1474 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1475 --output=live-test.tix ; \
1476 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1477 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1478 --srcdir=.. $(HPCEXCL) ; \
1479 hpc report --srcdir=.. live-test $(HPCEXCL)
1481 commit-check: distcheck lint apidoc
1483 -include ./Makefile.local