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 \
74 doc/examples/gnt-debug \
94 test/data/ovfdata/other \
99 BUILDTIME_DIR_AUTOCREATE = \
104 $(APIDOC_HS_DIR)/Ganeti \
105 $(APIDOC_HS_DIR)/Ganeti/Confd \
106 $(APIDOC_HS_DIR)/Ganeti/HTools \
107 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
114 $(BUILDTIME_DIR_AUTOCREATE) \
119 ganeti-[0-9]*.[0-9]*.[0-9]* \
123 COVERAGE_DIR = doc/coverage
124 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
125 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
127 APIDOC_PY_DIR = $(APIDOC_DIR)/py
128 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
130 MAINTAINERCLEANFILES = \
133 doc/install-quick.rst \
138 maintainer-clean-local:
139 rm -rf $(BUILDTIME_DIRS)
142 $(addsuffix /*.py[co],$(DIRS)) \
143 $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
144 $(addsuffix /*.o,$(HTOOLS_DIRS)) \
145 $(PYTHON_BOOTSTRAP) \
147 $(REPLACE_VARS_SED) \
148 daemons/daemon-util \
149 daemons/ganeti-cleaner \
152 doc/examples/bash_completion \
153 lib/_generated_rpc.py \
159 $(nodist_pkgpython_PYTHON) \
160 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
161 $(HS_BUILT_TEST_HELPERS) \
162 .hpc/*.mix htools/*.tix htest/*.tix \
166 $(built_base_sources) \
167 $(BUILT_PYTHON_SOURCES) \
170 built_base_sources = \
174 built_python_base_sources = \
178 BUILT_PYTHON_SOURCES = \
179 $(built_python_base_sources) \
180 lib/_generated_rpc.py
182 # Generating the RPC wrappers depends on many things, so make sure
183 # it's built at the end of the built sources
184 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
186 # these are all built from the underlying %.in sources
188 doc/examples/ganeti-kvm-poweroff.initd \
189 doc/examples/ganeti.cron \
190 doc/examples/ganeti.initd \
191 doc/examples/gnt-config-backup \
192 doc/examples/hooks/ipsec
194 nodist_pkgpython_PYTHON = \
195 $(BUILT_PYTHON_SOURCES)
198 lib/build/__init__.py \
199 lib/build/sphinx_ext.py \
200 lib/build/shell_example_lexer.py
204 lib/asyncnotifier.py \
238 lib/client/__init__.py \
239 lib/client/gnt_backup.py \
240 lib/client/gnt_cluster.py \
241 lib/client/gnt_debug.py \
242 lib/client/gnt_group.py \
243 lib/client/gnt_instance.py \
244 lib/client/gnt_job.py \
245 lib/client/gnt_node.py \
248 hypervisor_PYTHON = \
249 lib/hypervisor/__init__.py \
250 lib/hypervisor/hv_base.py \
251 lib/hypervisor/hv_chroot.py \
252 lib/hypervisor/hv_fake.py \
253 lib/hypervisor/hv_kvm.py \
254 lib/hypervisor/hv_lxc.py \
255 lib/hypervisor/hv_xen.py
258 lib/rapi/__init__.py \
259 lib/rapi/baserlib.py \
261 lib/rapi/client_utils.py \
262 lib/rapi/connector.py \
264 lib/rapi/testutils.py
267 lib/http/__init__.py \
273 lib/confd/__init__.py \
274 lib/confd/client.py \
275 lib/confd/querylib.py \
279 lib/masterd/__init__.py \
280 lib/masterd/instance.py
283 lib/impexpd/__init__.py
286 lib/watcher/__init__.py \
287 lib/watcher/nodemaint.py \
291 lib/server/__init__.py \
292 lib/server/confd.py \
293 lib/server/masterd.py \
294 lib/server/noded.py \
298 lib/tools/__init__.py \
299 lib/tools/ensure_dirs.py
302 lib/utils/__init__.py \
304 lib/utils/filelock.py \
309 lib/utils/nodesetup.py \
310 lib/utils/process.py \
313 lib/utils/wrapper.py \
322 doc/design-htools-2.3.rst \
325 doc/design-draft.rst \
327 doc/design-cpu-pinning.rst \
328 doc/design-query2.rst \
329 doc/design-x509-ca.rst \
330 doc/design-http-server.rst \
331 doc/design-impexp2.rst \
332 doc/design-lu-generated-jobs.rst \
333 doc/design-multi-reloc.rst \
334 doc/design-network.rst \
335 doc/design-chained-jobs.rst \
336 doc/design-ovf-support.rst \
337 doc/design-autorepair.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 \
343 doc/design-bulk-create.rst \
344 doc/design-query-splitting.rst \
350 doc/install-quick.rst \
353 doc/move-instance.rst \
355 doc/ovfconverter.rst \
361 HS_PROGS = htools/htools
362 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
364 HS_ALL_PROGS = $(HS_PROGS) htest/test htest/hpc-htools htools/hconfd
365 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
366 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
368 HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
369 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
371 # internal extra flags (used for htest/test mainly)
373 # exclude options for coverage reports
374 HPCEXCL = --exclude Main \
375 --exclude Ganeti.Constants \
376 --exclude Ganeti.THH \
377 --exclude Ganeti.HTools.QC \
378 --exclude Ganeti.HTools.Version \
379 --exclude Test.Ganeti.TestHelper \
380 $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(filter-out htest/%,$(HS_LIB_SRCS)))))
383 htools/Ganeti/HTools/CLI.hs \
384 htools/Ganeti/HTools/Cluster.hs \
385 htools/Ganeti/HTools/Compat.hs \
386 htools/Ganeti/HTools/Container.hs \
387 htools/Ganeti/HTools/ExtLoader.hs \
388 htools/Ganeti/HTools/Group.hs \
389 htools/Ganeti/HTools/IAlloc.hs \
390 htools/Ganeti/HTools/Instance.hs \
391 htools/Ganeti/HTools/JSON.hs \
392 htools/Ganeti/HTools/Loader.hs \
393 htools/Ganeti/HTools/Luxi.hs \
394 htools/Ganeti/HTools/Node.hs \
395 htools/Ganeti/HTools/PeerMap.hs \
396 htools/Ganeti/HTools/QC.hs \
397 htools/Ganeti/HTools/Rapi.hs \
398 htools/Ganeti/HTools/Simu.hs \
399 htools/Ganeti/HTools/Text.hs \
400 htools/Ganeti/HTools/Types.hs \
401 htools/Ganeti/HTools/Utils.hs \
402 htools/Ganeti/HTools/Program.hs \
403 htools/Ganeti/HTools/Program/Hail.hs \
404 htools/Ganeti/HTools/Program/Hbal.hs \
405 htools/Ganeti/HTools/Program/Hcheck.hs \
406 htools/Ganeti/HTools/Program/Hinfo.hs \
407 htools/Ganeti/HTools/Program/Hscan.hs \
408 htools/Ganeti/HTools/Program/Hspace.hs \
409 htools/Ganeti/BasicTypes.hs \
410 htools/Ganeti/Confd.hs \
411 htools/Ganeti/Confd/Server.hs \
412 htools/Ganeti/Confd/Utils.hs \
413 htools/Ganeti/Config.hs \
414 htools/Ganeti/Daemon.hs \
415 htools/Ganeti/Hash.hs \
416 htools/Ganeti/Jobs.hs \
417 htools/Ganeti/Logging.hs \
418 htools/Ganeti/Luxi.hs \
419 htools/Ganeti/Objects.hs \
420 htools/Ganeti/OpCodes.hs \
421 htools/Ganeti/Query/Common.hs \
422 htools/Ganeti/Query/Filter.hs \
423 htools/Ganeti/Query/Language.hs \
424 htools/Ganeti/Query/Node.hs \
425 htools/Ganeti/Query/Query.hs \
426 htools/Ganeti/Query/Server.hs \
427 htools/Ganeti/Query/Types.hs \
428 htools/Ganeti/Rpc.hs \
429 htools/Ganeti/Runtime.hs \
430 htools/Ganeti/Ssconf.hs \
431 htools/Ganeti/THH.hs \
432 htest/Test/Ganeti/TestHelper.hs \
433 htest/Test/Ganeti/Objects.hs
436 HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
437 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
439 $(RUN_IN_TEMPDIR): | stamp-directories
441 # Note: we use here an order-only prerequisite, as the contents of
442 # _autoconf.py are not actually influencing the html build output: it
443 # has to exist in order for the sphinx module to be loaded
444 # successfully, but we certainly don't want the docs to be rebuilt if
446 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
447 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
448 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
449 | $(BUILT_PYTHON_SOURCES)
450 @test -n "$(SPHINX)" || \
451 { echo 'sphinx-build' not found during configure; exit 1; }
453 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
455 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
456 -D release="$(PACKAGE_VERSION)" \
457 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
458 rm -f doc/html/.buildinfo doc/html/objects.inv
461 doc/html: doc/html/index.html
463 doc/install-quick.rst: INSTALL
465 doc/upgrade.rst: UPGRADE
467 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
469 { echo '.. This file is automatically updated at build time from $<.'; \
470 echo '.. Do not edit.'; \
477 doc/design-2.1-lock-acquire.dot \
478 doc/design-2.1-lock-release.dot
480 docpng = $(patsubst %.dot,%.png,$(docdot))
482 # Things to build but not to install (add it to EXTRA_DIST if it should be
488 doc/examples/bash_completion \
493 scripts/gnt-cluster \
496 scripts/gnt-instance \
501 PYTHON_BOOTSTRAP_SBIN = \
502 daemons/ganeti-masterd \
503 daemons/ganeti-noded \
504 daemons/ganeti-watcher \
505 daemons/ganeti-rapi \
509 PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
513 $(PYTHON_BOOTSTRAP_SBIN) \
535 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
537 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
538 # FIXME: this is a hardcoded logic, instead of auto-resolving
539 $(LN_S) -f ../../../bin/htools \
540 $(DESTDIR)$(iallocatorsdir)/hail
541 for role in $(HS_BIN_ROLES); do \
543 $(DESTDIR)$(bindir)/$$role ; \
546 mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
550 $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
551 @if [ -z "$(HTOOLS)" ]; then \
552 echo "Error: htools compilation disabled at configure time" 1>&2 ;\
555 @if [ "$(notdir $@)" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
556 echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
559 @rm -f $(notdir $@).tix
562 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
563 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
564 $(HEXTRA) $(HEXTRA_INT) $@
567 # for the htest/test binary, we need to enable profiling/coverage
568 htest/test: HEXTRA_INT=-fhpc -ihtest
570 # we compile the hpc-htools binary with the program coverage
571 htest/hpc-htools: HEXTRA_INT=-fhpc
574 htest/offline-tests.sh: htest/hpc-htools
576 # rules for building profiling-enabled versions of the haskell
577 # programs: hs-prof does the full two-step build, whereas
578 # hs-prof-quick does only the final rebuild (hs-prof must have been
580 .PHONY: hs-prof hs-prof-quick
582 $(MAKE) $(AM_MAKEFLAGS) clean
583 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
584 rm -f $(HS_ALL_PROGS)
585 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
588 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
590 dist_sbin_SCRIPTS = \
591 tools/ganeti-listrunner
593 nodist_sbin_SCRIPTS = \
594 $(PYTHON_BOOTSTRAP_SBIN) \
595 daemons/ganeti-cleaner
598 nodist_sbin_SCRIPTS += htools/hconfd
606 tools/cluster-merge \
610 tools/move-instance \
613 tools/sanitize-config
615 dist_tools_SCRIPTS = \
617 tools/kvm-console-wrapper \
618 tools/xm-console-wrapper \
619 tools/master-ip-setup
621 pkglib_python_scripts = \
622 daemons/import-export \
623 tools/check-cert-expired
625 nodist_pkglib_python_scripts = \
628 myexeclib_SCRIPTS = \
629 daemons/daemon-util \
631 $(pkglib_python_scripts)
633 nodist_myexeclib_SCRIPTS = \
634 $(nodist_pkglib_python_scripts)
641 autotools/build-bash-completion \
642 autotools/build-rpc \
643 autotools/check-header \
644 autotools/check-python-code \
645 autotools/check-imports \
646 autotools/check-man-dashes \
647 autotools/check-man-warnings \
648 autotools/check-news \
649 autotools/check-tar \
650 autotools/check-version \
651 autotools/convert-constants \
653 autotools/gen-coverage \
654 autotools/testrunner \
655 autotools/wrong-hardcoded-paths \
657 daemons/daemon-util.in \
658 daemons/ganeti-cleaner.in \
659 $(pkglib_python_scripts) \
667 $(BUILT_EXAMPLES:%=%.in) \
668 doc/examples/ganeti.default \
669 doc/examples/ganeti.default-debug \
670 doc/examples/hooks/ethers \
671 doc/examples/gnt-debug/README \
672 doc/examples/gnt-debug/delay0.json \
673 doc/examples/gnt-debug/delay50.json \
684 $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
686 htools/lint-hints.hs \
687 htest/cli-tests-defs.sh \
688 htest/offline-test.sh
692 man/ganeti-cleaner.8 \
694 man/ganeti-listrunner.8 \
695 man/ganeti-masterd.8 \
697 man/ganeti-os-interface.7 \
699 man/ganeti-watcher.8 \
716 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
717 manhtml = $(patsubst %.rst,%.html,$(manrst))
718 mangen = $(patsubst %.rst,%.gen,$(manrst))
720 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
721 $(patsubst %.html,%.html.in,$(manhtml)) \
722 man/footer.man man/footer.html $(mangen)
725 test/data/bdev-drbd-8.0.txt \
726 test/data/bdev-drbd-8.3.txt \
727 test/data/bdev-drbd-disk.txt \
728 test/data/bdev-drbd-net-ip4.txt \
729 test/data/bdev-drbd-net-ip6.txt \
730 test/data/cert1.pem \
731 test/data/ip-addr-show-dummy0.txt \
732 test/data/ip-addr-show-lo-ipv4.txt \
733 test/data/ip-addr-show-lo-ipv6.txt \
734 test/data/ip-addr-show-lo-oneline-ipv4.txt \
735 test/data/ip-addr-show-lo-oneline-ipv6.txt \
736 test/data/ip-addr-show-lo-oneline.txt \
737 test/data/ip-addr-show-lo.txt \
738 test/data/proc_drbd8.txt \
739 test/data/proc_drbd80-emptyline.txt \
740 test/data/proc_drbd83.txt \
741 test/data/proc_drbd83_sync.txt \
742 test/data/proc_drbd83_sync_krnl2.6.39.txt \
743 test/data/kvm_1.0_help.txt \
744 test/data/kvm_0.15.90_help.txt \
745 test/data/kvm_0.12.5_help.txt \
746 test/data/kvm_0.9.1_help.txt \
747 test/data/sys_drbd_usermode_helper.txt \
748 test/data/ovfdata/compr_disk.vmdk.gz \
749 test/data/ovfdata/config.ini \
750 test/data/ovfdata/corrupted_resources.ovf \
751 test/data/ovfdata/empty.ini \
752 test/data/ovfdata/empty.ovf \
753 test/data/ovfdata/ganeti.mf \
754 test/data/ovfdata/ganeti.ovf \
755 test/data/ovfdata/gzip_disk.ovf \
756 test/data/ovfdata/new_disk.vmdk \
757 test/data/ovfdata/no_disk.ini \
758 test/data/ovfdata/no_disk_in_ref.ovf \
759 test/data/ovfdata/no_os.ini \
760 test/data/ovfdata/no_ovf.ova \
761 test/data/ovfdata/ova.ova \
762 test/data/ovfdata/second_disk.vmdk \
763 test/data/ovfdata/rawdisk.raw \
764 test/data/ovfdata/unsafe_path.ini \
765 test/data/ovfdata/virtualbox.ovf \
766 test/data/ovfdata/wrong_extension.ovd \
767 test/data/ovfdata/wrong_config.ini \
768 test/data/ovfdata/wrong_manifest.mf \
769 test/data/ovfdata/wrong_manifest.ovf \
770 test/data/ovfdata/wrong_ova.ova \
771 test/data/ovfdata/wrong_xml.ovf \
772 test/data/ovfdata/other/rawdisk.raw \
773 test/data/vgreduce-removemissing-2.02.02.txt \
774 test/data/vgreduce-removemissing-2.02.66-fail.txt \
775 test/data/vgreduce-removemissing-2.02.66-ok.txt \
776 test/data/vgs-missing-pvs-2.02.02.txt \
777 test/data/vgs-missing-pvs-2.02.66.txt \
778 test/import-export_unittest-helper \
780 test/ganeti-cli.test \
781 htest/shelltests/htools-balancing.test \
782 htest/shelltests/htools-basic.test \
783 htest/shelltests/htools-dynutil.test \
784 htest/shelltests/htools-excl.test \
785 htest/shelltests/htools-hail.test \
786 htest/shelltests/htools-hspace.test \
787 htest/shelltests/htools-invalid.test \
788 htest/shelltests/htools-multi-group.test \
789 htest/shelltests/htools-no-backend.test \
790 htest/shelltests/htools-rapi.test \
791 htest/shelltests/htools-single-group.test \
792 htest/shelltests/htools-text-backend.test \
793 htest/data/hail-alloc-drbd.json \
794 htest/data/hail-change-group.json \
795 htest/data/hail-invalid-reloc.json \
796 htest/data/hail-node-evac.json \
797 htest/data/hail-reloc-drbd.json \
798 htest/data/hbal-split-insts.data \
799 htest/data/common-suffix.data \
800 htest/data/invalid-node.data \
801 htest/data/missing-resources.data \
802 htest/data/rapi/groups.json \
803 htest/data/rapi/info.json \
804 htest/data/rapi/instances.json \
805 htest/data/rapi/nodes.json
808 doc/examples/rapi_testutils.py \
809 test/ganeti.asyncnotifier_unittest.py \
810 test/ganeti.backend_unittest.py \
811 test/ganeti.bdev_unittest.py \
812 test/ganeti.cli_unittest.py \
813 test/ganeti.client.gnt_cluster_unittest.py \
814 test/ganeti.client.gnt_instance_unittest.py \
815 test/ganeti.daemon_unittest.py \
816 test/ganeti.cmdlib_unittest.py \
817 test/ganeti.compat_unittest.py \
818 test/ganeti.confd.client_unittest.py \
819 test/ganeti.config_unittest.py \
820 test/ganeti.constants_unittest.py \
821 test/ganeti.errors_unittest.py \
822 test/ganeti.hooks_unittest.py \
823 test/ganeti.ht_unittest.py \
824 test/ganeti.http_unittest.py \
825 test/ganeti.hypervisor_unittest.py \
826 test/ganeti.hypervisor.hv_chroot_unittest.py \
827 test/ganeti.hypervisor.hv_fake_unittest.py \
828 test/ganeti.hypervisor.hv_kvm_unittest.py \
829 test/ganeti.hypervisor.hv_lxc_unittest.py \
830 test/ganeti.hypervisor.hv_xen_unittest.py \
831 test/ganeti.impexpd_unittest.py \
832 test/ganeti.jqueue_unittest.py \
833 test/ganeti.jstore_unittest.py \
834 test/ganeti.locking_unittest.py \
835 test/ganeti.luxi_unittest.py \
836 test/ganeti.masterd.instance_unittest.py \
837 test/ganeti.mcpu_unittest.py \
838 test/ganeti.netutils_unittest.py \
839 test/ganeti.objects_unittest.py \
840 test/ganeti.opcodes_unittest.py \
841 test/ganeti.ovf_unittest.py \
842 test/ganeti.qlang_unittest.py \
843 test/ganeti.query_unittest.py \
844 test/ganeti.rapi.baserlib_unittest.py \
845 test/ganeti.rapi.client_unittest.py \
846 test/ganeti.rapi.resources_unittest.py \
847 test/ganeti.rapi.rlib2_unittest.py \
848 test/ganeti.rapi.testutils_unittest.py \
849 test/ganeti.rpc_unittest.py \
850 test/ganeti.runtime_unittest.py \
851 test/ganeti.serializer_unittest.py \
852 test/ganeti.ssh_unittest.py \
853 test/ganeti.storage_unittest.py \
854 test/ganeti.tools.ensure_dirs_unittest.py \
855 test/ganeti.uidpool_unittest.py \
856 test/ganeti.utils.algo_unittest.py \
857 test/ganeti.utils.filelock_unittest.py \
858 test/ganeti.utils.hash_unittest.py \
859 test/ganeti.utils.io_unittest.py \
860 test/ganeti.utils.log_unittest.py \
861 test/ganeti.utils.mlock_unittest.py \
862 test/ganeti.utils.nodesetup_unittest.py \
863 test/ganeti.utils.process_unittest.py \
864 test/ganeti.utils.retry_unittest.py \
865 test/ganeti.utils.text_unittest.py \
866 test/ganeti.utils.wrapper_unittest.py \
867 test/ganeti.utils.x509_unittest.py \
868 test/ganeti.utils_unittest.py \
869 test/ganeti.workerpool_unittest.py \
870 test/qa.qa_config_unittest.py \
871 test/cfgupgrade_unittest.py \
872 test/docs_unittest.py \
873 test/pycurl_reset_unittest.py \
874 test/tempfile_fork_unittest.py
876 python_tests += test/ganeti.utils.io_unittest-runasroot.py
879 haskell_tests = htest/test
882 test/check-cert-expired_unittest.bash \
883 test/daemon-util_unittest.bash \
884 test/ganeti-cleaner_unittest.bash \
885 test/import-export_unittest.bash \
893 nodist_TESTS += $(haskell_tests)
894 dist_TESTS += htest/offline-test.sh
895 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
898 TESTS = $(dist_TESTS) $(nodist_TESTS)
900 # Environment for all tests
901 PLAIN_TESTS_ENVIRONMENT = \
903 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
904 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
907 # Environment for tests run by automake
908 TESTS_ENVIRONMENT = \
909 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
912 $(dist_sbin_SCRIPTS) \
914 $(pkglib_python_scripts) \
915 $(nodist_pkglib_python_scripts) \
917 $(pkgpython_PYTHON) \
919 $(hypervisor_PYTHON) \
934 test/check-cert-expired_unittest.bash \
935 test/daemon-util_unittest.bash \
936 test/ganeti-cleaner_unittest.bash \
937 test/import-export_unittest.bash \
939 htest/offline-test.sh \
940 htest/cli-tests-defs.sh \
942 $(HS_LIB_SRCS) $(HS_PROG_SRCS)
944 check_python_code = \
945 $(BUILD_BASH_COMPLETION) \
953 ganeti/http/server.py \
954 $(dist_sbin_SCRIPTS) \
956 $(pkglib_python_scripts) \
957 $(BUILD_BASH_COMPLETION) \
963 standalone_python_modules = \
965 tools/ganeti-listrunner
969 ganeti/http/server.py \
970 $(dist_sbin_SCRIPTS) \
972 $(pkglib_python_scripts) \
973 $(BUILD_BASH_COMPLETION) \
976 $(PYTHON_BOOTSTRAP) \
979 test/daemon-util_unittest.bash: daemons/daemon-util
981 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
983 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
984 sed -f $(REPLACE_VARS_SED) < $< > $@
987 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
988 sed -f $(REPLACE_VARS_SED) < $< > $@
991 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
992 sed -f $(REPLACE_VARS_SED) < $< > $@
995 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
996 sed -f $(REPLACE_VARS_SED) < $< > $@
998 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
999 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1001 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
1003 doc/%.png: doc/%.dot
1004 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1005 $(DOT) -Tpng -o $@ $<
1007 man/footer.man: man/footer.rst
1008 @test -n "$(PANDOC)" || \
1009 { echo 'pandoc' not found during configure; exit 1; }
1010 $(PANDOC) -f rst -t man -o $@ $<
1012 man/footer.html: man/footer.rst
1013 @test -n "$(PANDOC)" || \
1014 { echo 'pandoc' not found during configure; exit 1; }
1015 $(PANDOC) -f rst -t html -o $@ $<
1017 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1018 lib/build/shell_example_lexer.py \
1019 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1020 @echo "Checking $< for hardcoded paths..."
1021 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1022 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1026 trap 'echo auto-removing $@; rm $@' EXIT; \
1027 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1030 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1031 @test -n "$(PANDOC)" || \
1032 { echo 'pandoc' not found during configure; exit 1; }
1034 trap 'echo auto-removing $@; rm $@' EXIT; \
1035 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1036 sed -e 's/\\@/@/g' > $@; \
1037 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1038 $(CHECK_MAN_DASHES) $@; \
1042 man/%.html.in: man/%.gen man/footer.html
1043 @test -n "$(PANDOC)" || \
1044 { echo 'pandoc' not found during configure; exit 1; }
1046 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1047 sed -e 's/\\@/@/g' > $@
1049 man/%: man/%.in $(REPLACE_VARS_SED)
1050 sed -f $(REPLACE_VARS_SED) < $< > $@
1052 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1053 sed -f $(REPLACE_VARS_SED) < $< > $@
1056 if test -d .git; then \
1057 git describe > $@; \
1058 elif test ! -f $@ ; then \
1059 echo "Cannot auto-generate $@ file"; exit 1; \
1062 .PHONY: clean-vcs-version
1066 .PHONY: regen-vcs-version
1070 if test -d .git; then \
1071 $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1072 $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1075 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in \
1076 vcs-version $(built_base_sources)
1078 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1079 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1081 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1082 lib/constants.py lib/_autoconf.py lib/luxi.py \
1083 $(CONVERT_CONSTANTS) $(built_base_sources) \
1084 | lib/_vcsversion.py
1086 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1088 lib/_autoconf.py: Makefile | stamp-directories
1090 { echo '# This file is automatically generated, do not edit!'; \
1093 echo '"""Build-time configuration for Ganeti.'; \
1095 echo 'This file is autogenerated by the build process.'; \
1096 echo 'For any changes you need to re-run ./configure (and'; \
1097 echo 'not edit by hand).'; \
1101 echo '# pylint: disable=C0301,C0324'; \
1102 echo '# because this is autogenerated, we do not want'; \
1103 echo '# style warnings' ; \
1105 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1106 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1107 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1108 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1109 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1110 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1111 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1112 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1113 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1114 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1115 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1116 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1117 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1118 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1119 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1120 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1121 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1122 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1123 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1124 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1125 echo "KVM_PATH = '$(KVM_PATH)'"; \
1126 echo "IP_PATH = '$(IP_PATH)'"; \
1127 echo "SOCAT_PATH = '$(SOCAT)'"; \
1128 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1129 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1130 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1131 echo "TOOLSDIR = '$(toolsdir)'"; \
1132 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1133 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1134 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1135 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1136 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1137 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1138 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1139 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1140 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1141 echo "RAPI_USER = '$(RAPI_USER)'"; \
1142 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1143 echo "CONFD_USER = '$(CONFD_USER)'"; \
1144 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1145 echo "NODED_USER = '$(NODED_USER)'"; \
1146 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1147 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1148 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1149 if [ "$(HTOOLS)" ]; then \
1150 echo "HTOOLS = True"; \
1152 echo "HTOOLS = False"; \
1154 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1155 echo "PY_CONFD = $(PY_CONFD)"; \
1156 echo "HS_CONFD = $(HS_CONFD)"; \
1157 echo "XEN_CMD = '$(XEN_CMD)'"; \
1158 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1161 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1163 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1164 { echo '# This file is automatically generated, do not edit!'; \
1167 echo '"""Build-time VCS version number for Ganeti.'; \
1169 echo 'This file is autogenerated by the build process.'; \
1170 echo 'For any changes you need to re-run ./configure (and'; \
1171 echo 'not edit by hand).'; \
1175 echo '# pylint: disable=C0301,C0324'; \
1176 echo '# because this is autogenerated, we do not want'; \
1177 echo '# style warnings' ; \
1179 echo "VCS_VERSION = '$$VCSVER'"; \
1182 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1183 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1185 $(REPLACE_VARS_SED): Makefile stamp-directories
1187 { echo 's#@PREFIX@#$(prefix)#g'; \
1188 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1189 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1190 echo 's#@BINDIR@#$(bindir)#g'; \
1191 echo 's#@SBINDIR@#$(sbindir)#g'; \
1192 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1193 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1194 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1195 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1196 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1197 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1198 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1199 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1200 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1201 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1202 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1203 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1204 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1205 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1206 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1207 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1208 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1209 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1210 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1211 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1212 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1215 # Using deferred evaluation
1216 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1217 daemons/ganeti-watcher: MODULE = ganeti.watcher
1218 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1219 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1220 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1222 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1223 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1225 { echo '#!/usr/bin/python'; \
1226 echo '# This file is automatically generated, do not edit!'; \
1227 echo "# Edit $(MODULE) instead."; \
1229 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1231 echo '# pylint: disable=C0103'; \
1232 echo '# C0103: Invalid name'; \
1234 echo 'import sys'; \
1235 echo 'import $(MODULE) as main'; \
1237 echo '# Temporarily alias commands until bash completion'; \
1238 echo '# generator is changed'; \
1239 echo 'if hasattr(main, "commands"):'; \
1240 echo ' commands = main.commands # pylint: disable=E1101'; \
1241 echo 'if hasattr(main, "aliases"):'; \
1242 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1244 echo 'if __name__ == "__main__":'; \
1245 echo ' sys.exit(main.Main())'; \
1249 $(HS_BUILT_TEST_HELPERS): Makefile
1250 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1252 { echo '#!/bin/sh'; \
1253 echo '# This file is automatically generated, do not edit!'; \
1254 echo "# Edit Makefile.am instead."; \
1256 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1260 stamp-directories: Makefile
1261 $(MAKE) $(AM_MAKEFLAGS) ganeti
1262 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1265 # We need to create symlinks because "make distcheck" will not install Python
1266 # files when building.
1267 stamp-srclinks: Makefile | stamp-directories
1269 for i in $(srclink_files); do \
1270 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1271 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1278 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1281 check-dirs: $(GENERATED_FILES)
1283 find . -type d \( \( -name . \) -o \( \
1285 -name autom4te.cache \
1286 \) -prune -o -print \) | { \
1288 while read dir; do \
1290 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1291 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1294 for dir in $(DIRS); do \
1295 if ! test -d "$$dir"; then \
1296 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1300 if test -n "$$error"; then exit 1; else exit 0; fi; \
1304 check-local: check-dirs $(GENERATED_FILES)
1305 $(CHECK_PYTHON_CODE) $(check_python_code)
1306 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1307 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1308 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1309 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1310 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1311 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1312 echo "Incorrect version in README, expected $$expver"; \
1315 for file in doc/iallocator.rst doc/hooks.rst; do \
1316 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1317 "Documents Ganeti version $$expver"; then \
1318 echo "Incorrect version in $$file, expected $$expver"; \
1324 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1327 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1329 # E111: indentation is not a multiple of four
1330 # E121: continuation line indentation is not a multiple of four
1331 # (since our indent level is not 4)
1332 # E125: continuation line does not distinguish itself from next logical line
1333 # (since our indent level is not 4)
1334 # E127: continuation line over-indented for visual indent
1335 # (since our indent level is not 4)
1336 # note: do NOT add E128 here; it's a valid style error in most cases!
1337 # I've seen real errors, but also some cases were we indent wrongly
1338 # due to line length; try to rework the cases where it is triggered,
1339 # instead of silencing it
1340 # E261: at least two spaces before inline comment
1341 # E501: line too long (80 characters)
1342 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1344 # For excluding pep8 expects filenames only, not whole paths
1345 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1347 LINT_TARGETS = pylint pylint-qa
1349 LINT_TARGETS += pep8
1352 LINT_TARGETS += hlint
1356 lint: $(LINT_TARGETS)
1359 pylint: $(GENERATED_FILES)
1360 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1361 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1364 pylint-qa: $(GENERATED_FILES)
1365 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1366 cd $(top_srcdir)/qa && \
1367 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1368 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1371 pep8: $(GENERATED_FILES)
1372 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1373 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1374 --repeat $(pep8_python_code)
1376 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1378 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1379 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1380 if tty -s; then C="-c"; else C=""; fi; \
1381 $(HLINT) --report=doc/hs-lint.html --cross $$C \
1382 --ignore "Use first" \
1383 --ignore "Use comparing" \
1385 --ignore "Reduce duplication" \
1386 --ignore "Use &&&" \
1387 --ignore "Use void" \
1388 --hint htools/lint-hints \
1389 $(filter-out htools/Ganeti/THH.hs,$(HS_LIB_SRCS))
1391 # a dist hook rule for updating the vcs-version file; this is
1392 # hardcoded due to where it needs to build the file...
1394 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1395 rm -f $(top_distdir)/vcs-version
1396 cp -p $(srcdir)/vcs-version $(top_distdir)
1398 # a distcheck hook rule for catching revision control directories
1400 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1401 echo "Found revision control files in final archive." 1>&2; \
1404 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1405 echo "Found Python byte code in final archive." 1>&2; \
1408 if find $(top_distdir) -name '*~' | grep .; then \
1409 echo "Found backup files in final archive." 1>&2; \
1412 # Empty files or directories should not be distributed. They can cause
1413 # unnecessary warnings for packagers. Directories used by automake during
1414 # distcheck must be excluded.
1415 if find $(top_distdir) -empty -and -not \( \
1416 -path $(top_distdir)/_build -or \
1417 -path $(top_distdir)/_inst \) | grep .; then \
1418 echo "Found empty files or directories in final archive." 1>&2; \
1421 if test -n "$(BUILD_RELEASE)" && \
1422 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1423 echo "Found unreleased version in NEWS." >&2; \
1427 # When building a release, stricter checks should be used
1428 distcheck-release dist-release: export BUILD_RELEASE = 1
1429 distcheck-release: distcheck
1431 distrebuildcheck: dist
1433 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1434 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1436 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1439 $(MAKE) maintainer-clean; \
1440 cp $(abs_srcdir)/vcs-version .; \
1442 $(MAKE) $(AM_MAKEFLAGS)
1446 for i in $(DIST_ARCHIVES); do \
1447 echo -n "Checking $$i ... "; \
1448 autotools/check-tar < $$i; \
1453 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1454 "$(DESTDIR)${localstatedir}/log/ganeti" \
1455 "$(DESTDIR)${localstatedir}/run/ganeti"
1458 if WANT_HTOOLSAPIDOC
1459 apidoc: py-apidoc hs-apidoc
1465 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1466 $(RUN_IN_TEMPDIR) epydoc -v \
1467 --conf $(CURDIR)/epydoc.conf \
1468 --output $(CURDIR)/$(APIDOC_PY_DIR)
1471 hs-apidoc: $(HS_BUILT_SRCS)
1472 @test -n "$(HSCOLOUR)" || \
1473 { echo 'HsColour' not found during configure; exit 1; }
1474 @test -n "$(HADDOCK)" || \
1475 { echo 'haddock' not found during configure; exit 1; }
1476 rm -rf $(APIDOC_HS_DIR)/*
1477 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1478 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1479 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1480 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1481 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1482 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1485 if [ "$(HTOOLS_NOCURL)" ]; \
1486 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1489 if [ "$(HTOOLS_PARALLEL3)" ]; \
1490 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1492 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \
1493 for file in $$RELSRCS; do \
1494 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1495 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1497 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1498 -t ganeti-htools -p haddock-prologue \
1499 --source-module="%{MODULE/.//}.html" \
1500 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1502 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1505 TAGS: $(GENERATED_FILES)
1507 $(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIB_SRCS)
1508 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1509 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1510 -path './qa/*.py' | \
1511 etags -l python -a -
1515 coverage: py-coverage hs-coverage
1517 coverage: py-coverage
1521 py-coverage: $(GENERATED_FILES) $(python_tests)
1523 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1524 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1525 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1526 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1530 hs-coverage: $(haskell_tests) htest/hpc-htools
1532 $(MAKE) $(AM_MAKEFLAGS) hs-check
1533 @mkdir_p@ $(COVERAGE_HS_DIR)
1534 hpc combine --union $(HPCEXCL) \
1535 test.tix hpc-htools.tix > coverage-htools.tix
1536 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1537 hpc report coverage-htools.tix
1538 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1540 # Special "kind-of-QA" target for htools, needs special setup (all
1541 # tools compiled with -fhpc)
1546 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1547 rm -f *.tix *.mix; \
1549 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1550 --output=live-test.tix ; \
1551 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1552 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1553 --srcdir=.. $(HPCEXCL) ; \
1554 hpc report --srcdir=.. live-test $(HPCEXCL)
1556 commit-check: distcheck lint apidoc
1558 .PHONY: gitignore-check
1560 @if [ -n "`git status --short`" ]; then \
1561 echo "Git status is not clean!" 1>&2 ; \
1562 git status --short; \
1566 # we don't need the ancient implicit rules:
1573 -include ./Makefile.local