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 \
72 doc/examples/gnt-debug \
92 test/data/htools/rapi \
94 test/data/ovfdata/other \
97 BUILDTIME_DIR_AUTOCREATE = \
102 $(APIDOC_HS_DIR)/Ganeti \
103 $(APIDOC_HS_DIR)/Ganeti/Confd \
104 $(APIDOC_HS_DIR)/Ganeti/HTools \
105 $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
112 $(BUILDTIME_DIR_AUTOCREATE) \
117 ganeti-[0-9]*.[0-9]*.[0-9]* \
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)) \
143 $(PYTHON_BOOTSTRAP) \
145 $(REPLACE_VARS_SED) \
146 daemons/daemon-util \
147 daemons/ganeti-cleaner \
150 doc/examples/bash_completion \
151 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 htest/*.tix \
164 $(built_base_sources) \
165 $(BUILT_PYTHON_SOURCES) \
168 built_base_sources = \
172 built_python_base_sources = \
176 BUILT_PYTHON_SOURCES = \
177 $(built_python_base_sources) \
178 lib/_generated_rpc.py
180 # Generating the RPC wrappers depends on many things, so make sure
181 # it's built at the end of the built sources
182 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
184 # these are all built from the underlying %.in sources
186 doc/examples/ganeti-kvm-poweroff.initd \
187 doc/examples/ganeti.cron \
188 doc/examples/ganeti.initd \
189 doc/examples/gnt-config-backup \
190 doc/examples/hooks/ipsec
192 nodist_pkgpython_PYTHON = \
193 $(BUILT_PYTHON_SOURCES)
196 lib/build/__init__.py \
197 lib/build/sphinx_ext.py \
198 lib/build/shell_example_lexer.py
202 lib/asyncnotifier.py \
236 lib/client/__init__.py \
237 lib/client/gnt_backup.py \
238 lib/client/gnt_cluster.py \
239 lib/client/gnt_debug.py \
240 lib/client/gnt_group.py \
241 lib/client/gnt_instance.py \
242 lib/client/gnt_job.py \
243 lib/client/gnt_node.py \
246 hypervisor_PYTHON = \
247 lib/hypervisor/__init__.py \
248 lib/hypervisor/hv_base.py \
249 lib/hypervisor/hv_chroot.py \
250 lib/hypervisor/hv_fake.py \
251 lib/hypervisor/hv_kvm.py \
252 lib/hypervisor/hv_lxc.py \
253 lib/hypervisor/hv_xen.py
256 lib/rapi/__init__.py \
257 lib/rapi/baserlib.py \
259 lib/rapi/client_utils.py \
260 lib/rapi/connector.py \
262 lib/rapi/testutils.py
265 lib/http/__init__.py \
271 lib/confd/__init__.py \
272 lib/confd/client.py \
273 lib/confd/querylib.py \
277 lib/masterd/__init__.py \
278 lib/masterd/instance.py
281 lib/impexpd/__init__.py
284 lib/watcher/__init__.py \
285 lib/watcher/nodemaint.py \
289 lib/server/__init__.py \
290 lib/server/confd.py \
291 lib/server/masterd.py \
292 lib/server/noded.py \
296 lib/tools/__init__.py \
297 lib/tools/ensure_dirs.py
300 lib/utils/__init__.py \
302 lib/utils/filelock.py \
307 lib/utils/nodesetup.py \
308 lib/utils/process.py \
311 lib/utils/wrapper.py \
320 doc/design-htools-2.3.rst \
323 doc/design-draft.rst \
325 doc/design-cpu-pinning.rst \
326 doc/design-query2.rst \
327 doc/design-x509-ca.rst \
328 doc/design-http-server.rst \
329 doc/design-impexp2.rst \
330 doc/design-lu-generated-jobs.rst \
331 doc/design-multi-reloc.rst \
332 doc/design-network.rst \
333 doc/design-chained-jobs.rst \
334 doc/design-ovf-support.rst \
335 doc/design-autorepair.rst \
336 doc/design-resource-model.rst \
337 doc/cluster-merge.rst \
338 doc/design-shared-storage.rst \
339 doc/design-node-state-cache.rst \
340 doc/design-virtual-clusters.rst \
341 doc/design-bulk-create.rst \
342 doc/design-query-splitting.rst \
348 doc/install-quick.rst \
351 doc/move-instance.rst \
353 doc/ovfconverter.rst \
359 HS_PROGS = htools/htools
360 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
362 HS_ALL_PROGS = $(HS_PROGS) htest/test htest/hpc-htools htools/hconfd
363 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
364 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail
366 HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
367 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
369 # internal extra flags (used for htest/test mainly)
371 # exclude options for coverage reports
372 HPCEXCL = --exclude Main \
373 --exclude Ganeti.Constants \
374 --exclude Ganeti.THH \
375 --exclude Ganeti.HTools.QC \
376 --exclude Ganeti.HTools.QCHelper \
377 --exclude Ganeti.HTools.Version
380 htools/Ganeti/HTools/CLI.hs \
381 htools/Ganeti/HTools/Cluster.hs \
382 htools/Ganeti/HTools/Compat.hs \
383 htools/Ganeti/HTools/Container.hs \
384 htools/Ganeti/HTools/ExtLoader.hs \
385 htools/Ganeti/HTools/Group.hs \
386 htools/Ganeti/HTools/IAlloc.hs \
387 htools/Ganeti/HTools/Instance.hs \
388 htools/Ganeti/HTools/JSON.hs \
389 htools/Ganeti/HTools/Loader.hs \
390 htools/Ganeti/HTools/Luxi.hs \
391 htools/Ganeti/HTools/Node.hs \
392 htools/Ganeti/HTools/PeerMap.hs \
393 htools/Ganeti/HTools/QC.hs \
394 htools/Ganeti/HTools/QCHelper.hs \
395 htools/Ganeti/HTools/Rapi.hs \
396 htools/Ganeti/HTools/Simu.hs \
397 htools/Ganeti/HTools/Text.hs \
398 htools/Ganeti/HTools/Types.hs \
399 htools/Ganeti/HTools/Utils.hs \
400 htools/Ganeti/HTools/Program.hs \
401 htools/Ganeti/HTools/Program/Hail.hs \
402 htools/Ganeti/HTools/Program/Hbal.hs \
403 htools/Ganeti/HTools/Program/Hcheck.hs \
404 htools/Ganeti/HTools/Program/Hinfo.hs \
405 htools/Ganeti/HTools/Program/Hscan.hs \
406 htools/Ganeti/HTools/Program/Hspace.hs \
407 htools/Ganeti/BasicTypes.hs \
408 htools/Ganeti/Confd.hs \
409 htools/Ganeti/Confd/Server.hs \
410 htools/Ganeti/Confd/Utils.hs \
411 htools/Ganeti/Config.hs \
412 htools/Ganeti/Daemon.hs \
413 htools/Ganeti/Hash.hs \
414 htools/Ganeti/Jobs.hs \
415 htools/Ganeti/Logging.hs \
416 htools/Ganeti/Luxi.hs \
417 htools/Ganeti/Objects.hs \
418 htools/Ganeti/OpCodes.hs \
419 htools/Ganeti/Query/Common.hs \
420 htools/Ganeti/Query/Filter.hs \
421 htools/Ganeti/Query/Language.hs \
422 htools/Ganeti/Query/Node.hs \
423 htools/Ganeti/Query/Query.hs \
424 htools/Ganeti/Query/Server.hs \
425 htools/Ganeti/Query/Types.hs \
426 htools/Ganeti/Rpc.hs \
427 htools/Ganeti/Runtime.hs \
428 htools/Ganeti/Ssconf.hs \
431 HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
432 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
434 $(RUN_IN_TEMPDIR): | stamp-directories
436 # Note: we use here an order-only prerequisite, as the contents of
437 # _autoconf.py are not actually influencing the html build output: it
438 # has to exist in order for the sphinx module to be loaded
439 # successfully, but we certainly don't want the docs to be rebuilt if
441 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
442 $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
443 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
444 | $(BUILT_PYTHON_SOURCES)
445 @test -n "$(SPHINX)" || \
446 { echo 'sphinx-build' not found during configure; exit 1; }
448 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
450 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
451 -D release="$(PACKAGE_VERSION)" \
452 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
453 rm -f doc/html/.buildinfo doc/html/objects.inv
456 doc/html: doc/html/index.html
458 doc/install-quick.rst: INSTALL
460 doc/upgrade.rst: UPGRADE
462 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
464 { echo '.. This file is automatically updated at build time from $<.'; \
465 echo '.. Do not edit.'; \
472 doc/design-2.1-lock-acquire.dot \
473 doc/design-2.1-lock-release.dot
475 docpng = $(patsubst %.dot,%.png,$(docdot))
477 # Things to build but not to install (add it to EXTRA_DIST if it should be
483 doc/examples/bash_completion \
488 scripts/gnt-cluster \
491 scripts/gnt-instance \
496 PYTHON_BOOTSTRAP_SBIN = \
497 daemons/ganeti-masterd \
498 daemons/ganeti-noded \
499 daemons/ganeti-watcher \
500 daemons/ganeti-rapi \
504 PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
508 $(PYTHON_BOOTSTRAP_SBIN) \
530 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
532 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
533 # FIXME: this is a hardcoded logic, instead of auto-resolving
534 $(LN_S) -f ../../../bin/htools \
535 $(DESTDIR)$(iallocatorsdir)/hail
536 for role in $(HS_BIN_ROLES); do \
538 $(DESTDIR)$(bindir)/$$role ; \
541 mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
545 $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
546 @if [ -z "$(HTOOLS)" ]; then \
547 echo "Error: htools compilation disabled at configure time" 1>&2 ;\
550 @if [ "$(notdir $@)" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
551 echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
554 @rm -f $(notdir $@).tix
557 $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
558 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
559 $(HEXTRA) $(HEXTRA_INT) $@
562 # for the htest/test binary, we need to enable profiling/coverage
563 htest/test: HEXTRA_INT=-fhpc -ihtest
565 # we compile the hpc-htools binary with the program coverage
566 htest/hpc-htools: HEXTRA_INT=-fhpc
569 htest/offline-tests.sh: htest/hpc-htools
571 # rules for building profiling-enabled versions of the haskell
572 # programs: hs-prof does the full two-step build, whereas
573 # hs-prof-quick does only the final rebuild (hs-prof must have been
575 .PHONY: hs-prof hs-prof-quick
577 $(MAKE) $(AM_MAKEFLAGS) clean
578 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
579 rm -f $(HS_ALL_PROGS)
580 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
583 $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
585 dist_sbin_SCRIPTS = \
586 tools/ganeti-listrunner
588 nodist_sbin_SCRIPTS = \
589 $(PYTHON_BOOTSTRAP_SBIN) \
590 daemons/ganeti-cleaner
593 nodist_sbin_SCRIPTS += htools/hconfd
601 tools/cluster-merge \
605 tools/move-instance \
608 tools/sanitize-config
610 dist_tools_SCRIPTS = \
612 tools/kvm-console-wrapper \
613 tools/xm-console-wrapper \
614 tools/master-ip-setup
616 pkglib_python_scripts = \
617 daemons/import-export \
618 tools/check-cert-expired
620 nodist_pkglib_python_scripts = \
623 myexeclib_SCRIPTS = \
624 daemons/daemon-util \
626 $(pkglib_python_scripts)
628 nodist_myexeclib_SCRIPTS = \
629 $(nodist_pkglib_python_scripts)
636 autotools/build-bash-completion \
637 autotools/build-rpc \
638 autotools/check-header \
639 autotools/check-python-code \
640 autotools/check-imports \
641 autotools/check-man-dashes \
642 autotools/check-man-warnings \
643 autotools/check-news \
644 autotools/check-tar \
645 autotools/check-version \
646 autotools/convert-constants \
648 autotools/gen-coverage \
649 autotools/testrunner \
650 autotools/wrong-hardcoded-paths \
652 daemons/daemon-util.in \
653 daemons/ganeti-cleaner.in \
654 $(pkglib_python_scripts) \
662 $(BUILT_EXAMPLES:%=%.in) \
663 doc/examples/ganeti.default \
664 doc/examples/ganeti.default-debug \
665 doc/examples/hooks/ethers \
666 doc/examples/gnt-debug/README \
667 doc/examples/gnt-debug/delay0.json \
668 doc/examples/gnt-debug/delay50.json \
679 $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
681 htools/lint-hints.hs \
682 htest/cli-tests-defs.sh \
683 htest/offline-test.sh
687 man/ganeti-cleaner.8 \
689 man/ganeti-listrunner.8 \
690 man/ganeti-masterd.8 \
692 man/ganeti-os-interface.7 \
694 man/ganeti-watcher.8 \
711 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
712 manhtml = $(patsubst %.rst,%.html,$(manrst))
713 mangen = $(patsubst %.rst,%.gen,$(manrst))
715 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
716 $(patsubst %.html,%.html.in,$(manhtml)) \
717 man/footer.man man/footer.html $(mangen)
720 test/data/bdev-drbd-8.0.txt \
721 test/data/bdev-drbd-8.3.txt \
722 test/data/bdev-drbd-disk.txt \
723 test/data/bdev-drbd-net-ip4.txt \
724 test/data/bdev-drbd-net-ip6.txt \
725 test/data/cert1.pem \
726 test/data/ip-addr-show-dummy0.txt \
727 test/data/ip-addr-show-lo-ipv4.txt \
728 test/data/ip-addr-show-lo-ipv6.txt \
729 test/data/ip-addr-show-lo-oneline-ipv4.txt \
730 test/data/ip-addr-show-lo-oneline-ipv6.txt \
731 test/data/ip-addr-show-lo-oneline.txt \
732 test/data/ip-addr-show-lo.txt \
733 test/data/proc_drbd8.txt \
734 test/data/proc_drbd80-emptyline.txt \
735 test/data/proc_drbd83.txt \
736 test/data/proc_drbd83_sync.txt \
737 test/data/proc_drbd83_sync_krnl2.6.39.txt \
738 test/data/kvm_1.0_help.txt \
739 test/data/kvm_0.15.90_help.txt \
740 test/data/kvm_0.12.5_help.txt \
741 test/data/kvm_0.9.1_help.txt \
742 test/data/sys_drbd_usermode_helper.txt \
743 test/data/htools/hail-alloc-drbd.json \
744 test/data/htools/hail-change-group.json \
745 test/data/htools/hail-invalid-reloc.json \
746 test/data/htools/hail-node-evac.json \
747 test/data/htools/hail-reloc-drbd.json \
748 test/data/htools/hbal-split-insts.data \
749 test/data/htools/common-suffix.data \
750 test/data/htools/invalid-node.data \
751 test/data/htools/missing-resources.data \
752 test/data/htools/rapi/groups.json \
753 test/data/htools/rapi/info.json \
754 test/data/htools/rapi/instances.json \
755 test/data/htools/rapi/nodes.json \
756 test/data/ovfdata/compr_disk.vmdk.gz \
757 test/data/ovfdata/config.ini \
758 test/data/ovfdata/corrupted_resources.ovf \
759 test/data/ovfdata/empty.ini \
760 test/data/ovfdata/empty.ovf \
761 test/data/ovfdata/ganeti.mf \
762 test/data/ovfdata/ganeti.ovf \
763 test/data/ovfdata/gzip_disk.ovf \
764 test/data/ovfdata/new_disk.vmdk \
765 test/data/ovfdata/no_disk.ini \
766 test/data/ovfdata/no_disk_in_ref.ovf \
767 test/data/ovfdata/no_os.ini \
768 test/data/ovfdata/no_ovf.ova \
769 test/data/ovfdata/ova.ova \
770 test/data/ovfdata/second_disk.vmdk \
771 test/data/ovfdata/rawdisk.raw \
772 test/data/ovfdata/unsafe_path.ini \
773 test/data/ovfdata/virtualbox.ovf \
774 test/data/ovfdata/wrong_extension.ovd \
775 test/data/ovfdata/wrong_config.ini \
776 test/data/ovfdata/wrong_manifest.mf \
777 test/data/ovfdata/wrong_manifest.ovf \
778 test/data/ovfdata/wrong_ova.ova \
779 test/data/ovfdata/wrong_xml.ovf \
780 test/data/ovfdata/other/rawdisk.raw \
781 test/data/vgreduce-removemissing-2.02.02.txt \
782 test/data/vgreduce-removemissing-2.02.66-fail.txt \
783 test/data/vgreduce-removemissing-2.02.66-ok.txt \
784 test/data/vgs-missing-pvs-2.02.02.txt \
785 test/data/vgs-missing-pvs-2.02.66.txt \
786 test/import-export_unittest-helper \
788 test/ganeti-cli.test \
789 test/htools-balancing.test \
790 test/htools-basic.test \
791 test/htools-dynutil.test \
792 test/htools-excl.test \
793 test/htools-hail.test \
794 test/htools-hspace.test \
795 test/htools-invalid.test \
796 test/htools-multi-group.test \
797 test/htools-no-backend.test \
798 test/htools-rapi.test \
799 test/htools-single-group.test \
800 test/htools-text-backend.test
803 doc/examples/rapi_testutils.py \
804 test/ganeti.asyncnotifier_unittest.py \
805 test/ganeti.backend_unittest.py \
806 test/ganeti.bdev_unittest.py \
807 test/ganeti.cli_unittest.py \
808 test/ganeti.client.gnt_cluster_unittest.py \
809 test/ganeti.client.gnt_instance_unittest.py \
810 test/ganeti.daemon_unittest.py \
811 test/ganeti.cmdlib_unittest.py \
812 test/ganeti.compat_unittest.py \
813 test/ganeti.confd.client_unittest.py \
814 test/ganeti.config_unittest.py \
815 test/ganeti.constants_unittest.py \
816 test/ganeti.errors_unittest.py \
817 test/ganeti.hooks_unittest.py \
818 test/ganeti.ht_unittest.py \
819 test/ganeti.http_unittest.py \
820 test/ganeti.hypervisor_unittest.py \
821 test/ganeti.hypervisor.hv_chroot_unittest.py \
822 test/ganeti.hypervisor.hv_fake_unittest.py \
823 test/ganeti.hypervisor.hv_kvm_unittest.py \
824 test/ganeti.hypervisor.hv_lxc_unittest.py \
825 test/ganeti.hypervisor.hv_xen_unittest.py \
826 test/ganeti.impexpd_unittest.py \
827 test/ganeti.jqueue_unittest.py \
828 test/ganeti.jstore_unittest.py \
829 test/ganeti.locking_unittest.py \
830 test/ganeti.luxi_unittest.py \
831 test/ganeti.masterd.instance_unittest.py \
832 test/ganeti.mcpu_unittest.py \
833 test/ganeti.netutils_unittest.py \
834 test/ganeti.objects_unittest.py \
835 test/ganeti.opcodes_unittest.py \
836 test/ganeti.ovf_unittest.py \
837 test/ganeti.qlang_unittest.py \
838 test/ganeti.query_unittest.py \
839 test/ganeti.rapi.baserlib_unittest.py \
840 test/ganeti.rapi.client_unittest.py \
841 test/ganeti.rapi.resources_unittest.py \
842 test/ganeti.rapi.rlib2_unittest.py \
843 test/ganeti.rapi.testutils_unittest.py \
844 test/ganeti.rpc_unittest.py \
845 test/ganeti.runtime_unittest.py \
846 test/ganeti.serializer_unittest.py \
847 test/ganeti.ssh_unittest.py \
848 test/ganeti.storage_unittest.py \
849 test/ganeti.tools.ensure_dirs_unittest.py \
850 test/ganeti.uidpool_unittest.py \
851 test/ganeti.utils.algo_unittest.py \
852 test/ganeti.utils.filelock_unittest.py \
853 test/ganeti.utils.hash_unittest.py \
854 test/ganeti.utils.io_unittest.py \
855 test/ganeti.utils.log_unittest.py \
856 test/ganeti.utils.mlock_unittest.py \
857 test/ganeti.utils.nodesetup_unittest.py \
858 test/ganeti.utils.process_unittest.py \
859 test/ganeti.utils.retry_unittest.py \
860 test/ganeti.utils.text_unittest.py \
861 test/ganeti.utils.wrapper_unittest.py \
862 test/ganeti.utils.x509_unittest.py \
863 test/ganeti.utils_unittest.py \
864 test/ganeti.workerpool_unittest.py \
865 test/qa.qa_config_unittest.py \
866 test/cfgupgrade_unittest.py \
867 test/docs_unittest.py \
868 test/pycurl_reset_unittest.py \
869 test/tempfile_fork_unittest.py
871 python_tests += test/ganeti.utils.io_unittest-runasroot.py
874 haskell_tests = htest/test
877 test/check-cert-expired_unittest.bash \
878 test/daemon-util_unittest.bash \
879 test/ganeti-cleaner_unittest.bash \
880 test/import-export_unittest.bash \
888 nodist_TESTS += $(haskell_tests)
889 dist_TESTS += htest/offline-test.sh
890 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
893 TESTS = $(dist_TESTS) $(nodist_TESTS)
895 # Environment for all tests
896 PLAIN_TESTS_ENVIRONMENT = \
898 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
899 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
902 # Environment for tests run by automake
903 TESTS_ENVIRONMENT = \
904 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
907 $(dist_sbin_SCRIPTS) \
909 $(pkglib_python_scripts) \
910 $(nodist_pkglib_python_scripts) \
912 $(pkgpython_PYTHON) \
914 $(hypervisor_PYTHON) \
929 test/check-cert-expired_unittest.bash \
930 test/daemon-util_unittest.bash \
931 test/ganeti-cleaner_unittest.bash \
932 test/import-export_unittest.bash \
934 htest/offline-test.sh \
935 htest/cli-tests-defs.sh \
937 $(HS_LIB_SRCS) $(HS_PROG_SRCS)
939 check_python_code = \
940 $(BUILD_BASH_COMPLETION) \
948 ganeti/http/server.py \
949 $(dist_sbin_SCRIPTS) \
951 $(pkglib_python_scripts) \
952 $(BUILD_BASH_COMPLETION) \
958 standalone_python_modules = \
960 tools/ganeti-listrunner
964 ganeti/http/server.py \
965 $(dist_sbin_SCRIPTS) \
967 $(pkglib_python_scripts) \
968 $(BUILD_BASH_COMPLETION) \
971 $(PYTHON_BOOTSTRAP) \
974 test/daemon-util_unittest.bash: daemons/daemon-util
976 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
978 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
979 sed -f $(REPLACE_VARS_SED) < $< > $@
982 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
983 sed -f $(REPLACE_VARS_SED) < $< > $@
986 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
987 sed -f $(REPLACE_VARS_SED) < $< > $@
990 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
991 sed -f $(REPLACE_VARS_SED) < $< > $@
993 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
994 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
996 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
999 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1000 $(DOT) -Tpng -o $@ $<
1002 man/footer.man: man/footer.rst
1003 @test -n "$(PANDOC)" || \
1004 { echo 'pandoc' not found during configure; exit 1; }
1005 $(PANDOC) -f rst -t man -o $@ $<
1007 man/footer.html: man/footer.rst
1008 @test -n "$(PANDOC)" || \
1009 { echo 'pandoc' not found during configure; exit 1; }
1010 $(PANDOC) -f rst -t html -o $@ $<
1012 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1013 lib/build/shell_example_lexer.py \
1014 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1015 @echo "Checking $< for hardcoded paths..."
1016 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1017 echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1021 trap 'echo auto-removing $@; rm $@' EXIT; \
1022 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1025 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1026 @test -n "$(PANDOC)" || \
1027 { echo 'pandoc' not found during configure; exit 1; }
1029 trap 'echo auto-removing $@; rm $@' EXIT; \
1030 $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1031 sed -e 's/\\@/@/g' > $@; \
1032 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1033 $(CHECK_MAN_DASHES) $@; \
1037 man/%.html.in: man/%.gen man/footer.html
1038 @test -n "$(PANDOC)" || \
1039 { echo 'pandoc' not found during configure; exit 1; }
1041 $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1042 sed -e 's/\\@/@/g' > $@
1044 man/%: man/%.in $(REPLACE_VARS_SED)
1045 sed -f $(REPLACE_VARS_SED) < $< > $@
1047 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1048 sed -f $(REPLACE_VARS_SED) < $< > $@
1051 if test -d .git; then \
1052 git describe > $@; \
1053 elif test ! -f $@ ; then \
1054 echo "Cannot auto-generate $@ file"; exit 1; \
1057 .PHONY: clean-vcs-version
1061 .PHONY: regen-vcs-version
1065 if test -d .git; then \
1066 $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1067 $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1070 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in \
1071 vcs-version $(built_base_sources)
1073 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1074 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1076 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1077 lib/constants.py lib/_autoconf.py lib/luxi.py \
1078 $(CONVERT_CONSTANTS) $(built_base_sources) \
1079 | lib/_vcsversion.py
1081 { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1083 lib/_autoconf.py: Makefile | stamp-directories
1085 { echo '# This file is automatically generated, do not edit!'; \
1088 echo '"""Build-time configuration for Ganeti.'; \
1090 echo 'This file is autogenerated by the build process.'; \
1091 echo 'For any changes you need to re-run ./configure (and'; \
1092 echo 'not edit by hand).'; \
1096 echo '# pylint: disable=C0301,C0324'; \
1097 echo '# because this is autogenerated, we do not want'; \
1098 echo '# style warnings' ; \
1100 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1101 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1102 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1103 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1104 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1105 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1106 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1107 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1108 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1109 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1110 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1111 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1112 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1113 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1114 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1115 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1116 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1117 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1118 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1119 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1120 echo "KVM_PATH = '$(KVM_PATH)'"; \
1121 echo "IP_PATH = '$(IP_PATH)'"; \
1122 echo "SOCAT_PATH = '$(SOCAT)'"; \
1123 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1124 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1125 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1126 echo "TOOLSDIR = '$(toolsdir)'"; \
1127 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1128 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1129 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1130 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1131 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1132 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1133 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1134 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1135 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1136 echo "RAPI_USER = '$(RAPI_USER)'"; \
1137 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1138 echo "CONFD_USER = '$(CONFD_USER)'"; \
1139 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1140 echo "NODED_USER = '$(NODED_USER)'"; \
1141 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1142 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1143 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1144 if [ "$(HTOOLS)" ]; then \
1145 echo "HTOOLS = True"; \
1147 echo "HTOOLS = False"; \
1149 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1150 echo "PY_CONFD = $(PY_CONFD)"; \
1151 echo "HS_CONFD = $(HS_CONFD)"; \
1152 echo "XEN_CMD = '$(XEN_CMD)'"; \
1153 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1156 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1158 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1159 { echo '# This file is automatically generated, do not edit!'; \
1162 echo '"""Build-time VCS version number for Ganeti.'; \
1164 echo 'This file is autogenerated by the build process.'; \
1165 echo 'For any changes you need to re-run ./configure (and'; \
1166 echo 'not edit by hand).'; \
1170 echo '# pylint: disable=C0301,C0324'; \
1171 echo '# because this is autogenerated, we do not want'; \
1172 echo '# style warnings' ; \
1174 echo "VCS_VERSION = '$$VCSVER'"; \
1177 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1178 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1180 $(REPLACE_VARS_SED): Makefile stamp-directories
1182 { echo 's#@PREFIX@#$(prefix)#g'; \
1183 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1184 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1185 echo 's#@BINDIR@#$(bindir)#g'; \
1186 echo 's#@SBINDIR@#$(sbindir)#g'; \
1187 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1188 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1189 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1190 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1191 echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1192 echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1193 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1194 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1195 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1196 echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1197 echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1198 echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1199 echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1200 echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1201 echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1202 echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1203 echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1204 echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1205 echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1206 echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1207 echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1210 # Using deferred evaluation
1211 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1212 daemons/ganeti-watcher: MODULE = ganeti.watcher
1213 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1214 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1215 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/%,%,$@)
1217 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1218 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1220 { echo '#!/usr/bin/python'; \
1221 echo '# This file is automatically generated, do not edit!'; \
1222 echo "# Edit $(MODULE) instead."; \
1224 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1226 echo '# pylint: disable=C0103'; \
1227 echo '# C0103: Invalid name'; \
1229 echo 'import sys'; \
1230 echo 'import $(MODULE) as main'; \
1232 echo '# Temporarily alias commands until bash completion'; \
1233 echo '# generator is changed'; \
1234 echo 'if hasattr(main, "commands"):'; \
1235 echo ' commands = main.commands # pylint: disable=E1101'; \
1236 echo 'if hasattr(main, "aliases"):'; \
1237 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1239 echo 'if __name__ == "__main__":'; \
1240 echo ' sys.exit(main.Main())'; \
1244 $(HS_BUILT_TEST_HELPERS): Makefile
1245 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1247 { echo '#!/bin/sh'; \
1248 echo '# This file is automatically generated, do not edit!'; \
1249 echo "# Edit Makefile.am instead."; \
1251 echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1255 stamp-directories: Makefile
1256 $(MAKE) $(AM_MAKEFLAGS) ganeti
1257 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1260 # We need to create symlinks because "make distcheck" will not install Python
1261 # files when building.
1262 stamp-srclinks: Makefile | stamp-directories
1264 for i in $(srclink_files); do \
1265 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1266 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1273 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1276 check-dirs: $(GENERATED_FILES)
1278 find . -type d \( \( -name . \) -o \( \
1280 -name autom4te.cache \
1281 \) -prune -o -print \) | { \
1283 while read dir; do \
1285 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1286 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1289 for dir in $(DIRS); do \
1290 if ! test -d "$$dir"; then \
1291 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1295 if test -n "$$error"; then exit 1; else exit 0; fi; \
1299 check-local: check-dirs $(GENERATED_FILES)
1300 $(CHECK_PYTHON_CODE) $(check_python_code)
1301 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1302 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1303 $(CHECK_NEWS) < $(top_srcdir)/NEWS
1304 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1305 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1306 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1307 echo "Incorrect version in README, expected $$expver"; \
1310 for file in doc/iallocator.rst doc/hooks.rst; do \
1311 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1312 "Documents Ganeti version $$expver"; then \
1313 echo "Incorrect version in $$file, expected $$expver"; \
1319 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1322 HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1324 # E111: indentation is not a multiple of four
1325 # E121: continuation line indentation is not a multiple of four
1326 # (since our indent level is not 4)
1327 # E125: continuation line does not distinguish itself from next logical line
1328 # (since our indent level is not 4)
1329 # E127: continuation line over-indented for visual indent
1330 # (since our indent level is not 4)
1331 # note: do NOT add E128 here; it's a valid style error in most cases!
1332 # I've seen real errors, but also some cases were we indent wrongly
1333 # due to line length; try to rework the cases where it is triggered,
1334 # instead of silencing it
1335 # E261: at least two spaces before inline comment
1336 # E501: line too long (80 characters)
1337 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1339 # For excluding pep8 expects filenames only, not whole paths
1340 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1342 LINT_TARGETS = pylint pylint-qa
1344 LINT_TARGETS += pep8
1347 LINT_TARGETS += hlint
1351 lint: $(LINT_TARGETS)
1354 pylint: $(GENERATED_FILES)
1355 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1356 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1359 pylint-qa: $(GENERATED_FILES)
1360 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1361 cd $(top_srcdir)/qa && \
1362 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1363 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1366 pep8: $(GENERATED_FILES)
1367 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1368 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1369 --repeat $(pep8_python_code)
1371 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1373 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1374 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1375 if tty -s; then C="-c"; else C=""; fi; \
1376 $(HLINT) --report=doc/hs-lint.html --cross $$C \
1377 --ignore "Use first" \
1378 --ignore "Use comparing" \
1380 --ignore "Reduce duplication" \
1381 --ignore "Use &&&" \
1382 --ignore "Use void" \
1383 --hint htools/lint-hints \
1384 $(filter-out htools/Ganeti/THH.hs,$(HS_LIB_SRCS))
1386 # a dist hook rule for updating the vcs-version file; this is
1387 # hardcoded due to where it needs to build the file...
1389 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1390 rm -f $(top_distdir)/vcs-version
1391 cp -p $(srcdir)/vcs-version $(top_distdir)
1393 # a distcheck hook rule for catching revision control directories
1395 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1396 echo "Found revision control files in final archive." 1>&2; \
1399 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1400 echo "Found Python byte code in final archive." 1>&2; \
1403 if find $(top_distdir) -name '*~' | grep .; then \
1404 echo "Found backup files in final archive." 1>&2; \
1407 # Empty files or directories should not be distributed. They can cause
1408 # unnecessary warnings for packagers. Directories used by automake during
1409 # distcheck must be excluded.
1410 if find $(top_distdir) -empty -and -not \( \
1411 -path $(top_distdir)/_build -or \
1412 -path $(top_distdir)/_inst \) | grep .; then \
1413 echo "Found empty files or directories in final archive." 1>&2; \
1416 if test -n "$(BUILD_RELEASE)" && \
1417 grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1418 echo "Found unreleased version in NEWS." >&2; \
1422 # When building a release, stricter checks should be used
1423 distcheck-release dist-release: export BUILD_RELEASE = 1
1424 distcheck-release: distcheck
1426 distrebuildcheck: dist
1428 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1429 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1431 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1434 $(MAKE) maintainer-clean; \
1435 cp $(abs_srcdir)/vcs-version .; \
1437 $(MAKE) $(AM_MAKEFLAGS)
1441 for i in $(DIST_ARCHIVES); do \
1442 echo -n "Checking $$i ... "; \
1443 autotools/check-tar < $$i; \
1448 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1449 "$(DESTDIR)${localstatedir}/log/ganeti" \
1450 "$(DESTDIR)${localstatedir}/run/ganeti"
1453 if WANT_HTOOLSAPIDOC
1454 apidoc: py-apidoc hs-apidoc
1460 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1461 $(RUN_IN_TEMPDIR) epydoc -v \
1462 --conf $(CURDIR)/epydoc.conf \
1463 --output $(CURDIR)/$(APIDOC_PY_DIR)
1466 hs-apidoc: $(HS_BUILT_SRCS)
1467 @test -n "$(HSCOLOUR)" || \
1468 { echo 'HsColour' not found during configure; exit 1; }
1469 @test -n "$(HADDOCK)" || \
1470 { echo 'haddock' not found during configure; exit 1; }
1471 rm -rf $(APIDOC_HS_DIR)/*
1472 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1473 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1474 @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1475 $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1476 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1477 $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1480 if [ "$(HTOOLS_NOCURL)" ]; \
1481 then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1484 if [ "$(HTOOLS_PARALLEL3)" ]; \
1485 then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1487 RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \
1488 for file in $$RELSRCS; do \
1489 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1490 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1492 $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1493 -t ganeti-htools -p haddock-prologue \
1494 --source-module="%{MODULE/.//}.html" \
1495 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1497 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1500 TAGS: $(GENERATED_FILES)
1502 $(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIB_SRCS)
1503 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1504 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1505 -path './qa/*.py' | \
1506 etags -l python -a -
1510 coverage: py-coverage hs-coverage
1512 coverage: py-coverage
1516 py-coverage: $(GENERATED_FILES) $(python_tests)
1518 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1519 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1520 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1521 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1525 hs-coverage: $(haskell_tests) htest/hpc-htools
1527 $(MAKE) $(AM_MAKEFLAGS) hs-check
1528 @mkdir_p@ $(COVERAGE_HS_DIR)
1529 hpc combine --union $(HPCEXCL) \
1530 test.tix hpc-htools.tix > coverage-htools.tix
1531 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1532 hpc report coverage-htools.tix
1533 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1535 # Special "kind-of-QA" target for htools, needs special setup (all
1536 # tools compiled with -fhpc)
1541 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1542 rm -f *.tix *.mix; \
1544 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1545 --output=live-test.tix ; \
1546 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1547 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1548 --srcdir=.. $(HPCEXCL) ; \
1549 hpc report --srcdir=.. live-test $(HPCEXCL)
1551 commit-check: distcheck lint apidoc
1553 .PHONY: gitignore-check
1555 @if [ -n "`git status --short`" ]; then \
1556 echo "Git status is not clean!" 1>&2 ; \
1557 git status --short; \
1561 # we don't need the ancient implicit rules:
1568 -include ./Makefile.local