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 # Helper function to strip src/ and test/hs/ from a list
18 strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))
20 # Use bash in order to be able to use pipefail
23 ACLOCAL_AMFLAGS = -I autotools
24 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
25 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
26 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
27 CHECK_HEADER = $(top_srcdir)/autotools/check-header
28 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
29 CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
30 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
31 CHECK_VERSION = $(top_srcdir)/autotools/check-version
32 CHECK_NEWS = $(top_srcdir)/autotools/check-news
33 CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
34 DOCPP = $(top_srcdir)/autotools/docpp
35 REPLACE_VARS_SED = autotools/replace_vars.sed
36 CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
37 BUILD_RPC = $(top_srcdir)/autotools/build-rpc
38 SHELL_ENV_INIT = autotools/shell-env-init
40 # Note: these are automake-specific variables, and must be named after
41 # the directory + 'dir' suffix
42 clientdir = $(pkgpythondir)/client
43 cmdlibdir = $(pkgpythondir)/cmdlib
44 hypervisordir = $(pkgpythondir)/hypervisor
45 storagedir = $(pkgpythondir)/storage
46 httpdir = $(pkgpythondir)/http
47 masterddir = $(pkgpythondir)/masterd
48 confddir = $(pkgpythondir)/confd
49 rapidir = $(pkgpythondir)/rapi
50 serverdir = $(pkgpythondir)/server
51 watcherdir = $(pkgpythondir)/watcher
52 impexpddir = $(pkgpythondir)/impexpd
53 utilsdir = $(pkgpythondir)/utils
54 toolsdir = $(pkglibdir)/tools
55 iallocatorsdir = $(pkglibdir)/iallocators
56 pytoolsdir = $(pkgpythondir)/tools
57 docdir = $(datadir)/doc/$(PACKAGE)
58 myexeclibdir = $(pkglibdir)
60 # Delete output file if an error occurred while building it
68 src/Ganeti/DataCollectors \
70 src/Ganeti/HTools/Backend \
71 src/Ganeti/HTools/Program \
72 src/Ganeti/Hypervisor \
73 src/Ganeti/Hypervisor/Xen \
74 src/Ganeti/Monitoring \
77 src/Ganeti/Storage/Diskstats \
78 src/Ganeti/Storage/Drbd \
82 test/hs/Test/Ganeti/Storage \
83 test/hs/Test/Ganeti/Storage/Diskstats \
84 test/hs/Test/Ganeti/Storage/Drbd \
85 test/hs/Test/Ganeti/Confd \
86 test/hs/Test/Ganeti/HTools \
87 test/hs/Test/Ganeti/HTools/Backend \
88 test/hs/Test/Ganeti/Hypervisor \
89 test/hs/Test/Ganeti/Hypervisor/Xen \
90 test/hs/Test/Ganeti/Query
92 # Haskell directories without the roots (src, test/hs)
93 HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
104 doc/examples/gnt-debug \
107 test/data/htools/rapi \
131 test/data/ovfdata/other \
135 ALL_APIDOC_HS_DIRS = \
137 $(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
139 BUILDTIME_DIR_AUTOCREATE = \
142 $(ALL_APIDOC_HS_DIRS) \
150 $(BUILDTIME_DIR_AUTOCREATE) \
156 ganeti-[0-9]*.[0-9]*.[0-9]* \
162 COVERAGE_DIR = doc/coverage
163 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
164 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
166 APIDOC_PY_DIR = $(APIDOC_DIR)/py
167 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
169 MAINTAINERCLEANFILES = \
171 doc/install-quick.rst \
176 maintainer-clean-local:
177 rm -rf $(BUILDTIME_DIRS)
180 $(addsuffix /*.py[co],$(DIRS)) \
181 $(addsuffix /*.hi,$(HS_DIRS)) \
182 $(addsuffix /*.o,$(HS_DIRS)) \
183 $(PYTHON_BOOTSTRAP) \
185 $(REPLACE_VARS_SED) \
187 daemons/daemon-util \
188 daemons/ganeti-cleaner \
189 devel/squeeze-amd64.tar.gz \
190 devel/squeeze-amd64.conf \
192 doc/manpages-enabled.rst \
194 doc/examples/bash_completion \
195 doc/examples/bash_completion-debug \
196 lib/_generated_rpc.py \
203 tools/vcluster-setup \
206 $(nodist_pkgpython_PYTHON) \
207 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
208 $(HS_BUILT_TEST_HELPERS) \
211 .hpc/*.mix src/*.tix test/hs/*.tix \
215 $(built_base_sources) \
216 $(BUILT_PYTHON_SOURCES) \
221 HS_GENERATED_FILES += $(HS_PROGS)
223 HS_GENERATED_FILES += src/hconfd src/ganeti-confd
227 HS_GENERATED_FILES += src/ganeti-mond
231 built_base_sources = \
235 built_python_base_sources = \
239 BUILT_PYTHON_SOURCES = \
240 $(built_python_base_sources) \
241 lib/_generated_rpc.py
243 # Generating the RPC wrappers depends on many things, so make sure
244 # it's built at the end of the built sources
245 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
247 # these are all built from the underlying %.in sources
249 doc/examples/ganeti-kvm-poweroff.initd \
250 doc/examples/ganeti.cron \
251 doc/examples/ganeti.initd \
252 doc/examples/ganeti-master-role.ocf \
253 doc/examples/ganeti-node-role.ocf \
254 doc/examples/gnt-config-backup \
255 doc/examples/hooks/ipsec
257 nodist_pkgpython_PYTHON = \
258 $(BUILT_PYTHON_SOURCES)
261 lib/build/__init__.py \
262 lib/build/shell_example_lexer.py \
263 lib/build/sphinx_ext.py
267 lib/asyncnotifier.py \
303 lib/client/__init__.py \
304 lib/client/gnt_backup.py \
305 lib/client/gnt_cluster.py \
306 lib/client/gnt_debug.py \
307 lib/client/gnt_group.py \
308 lib/client/gnt_instance.py \
309 lib/client/gnt_job.py \
310 lib/client/gnt_node.py \
311 lib/client/gnt_network.py \
312 lib/client/gnt_os.py \
313 lib/client/gnt_storage.py
316 lib/cmdlib/__init__.py \
317 lib/cmdlib/backup.py \
319 lib/cmdlib/cluster.py \
320 lib/cmdlib/common.py \
321 lib/cmdlib/group.py \
322 lib/cmdlib/instance.py \
323 lib/cmdlib/instance_migration.py \
324 lib/cmdlib/instance_operation.py \
325 lib/cmdlib/instance_query.py \
326 lib/cmdlib/instance_storage.py \
327 lib/cmdlib/instance_utils.py \
329 lib/cmdlib/network.py \
331 lib/cmdlib/operating_system.py \
332 lib/cmdlib/query.py \
336 hypervisor_PYTHON = \
337 lib/hypervisor/__init__.py \
338 lib/hypervisor/hv_base.py \
339 lib/hypervisor/hv_chroot.py \
340 lib/hypervisor/hv_fake.py \
341 lib/hypervisor/hv_kvm.py \
342 lib/hypervisor/hv_lxc.py \
343 lib/hypervisor/hv_xen.py
346 lib/storage/__init__.py \
347 lib/storage/bdev.py \
348 lib/storage/base.py \
349 lib/storage/container.py \
350 lib/storage/drbd.py \
351 lib/storage/drbd_info.py \
352 lib/storage/drbd_cmdgen.py \
353 lib/storage/filestorage.py
356 lib/rapi/__init__.py \
357 lib/rapi/baserlib.py \
359 lib/rapi/client_utils.py \
360 lib/rapi/connector.py \
362 lib/rapi/testutils.py
365 lib/http/__init__.py \
371 lib/confd/__init__.py \
375 lib/masterd/__init__.py \
376 lib/masterd/iallocator.py \
377 lib/masterd/instance.py
380 lib/impexpd/__init__.py
383 lib/watcher/__init__.py \
384 lib/watcher/nodemaint.py \
388 lib/server/__init__.py \
389 lib/server/masterd.py \
390 lib/server/noded.py \
394 lib/tools/__init__.py \
395 lib/tools/burnin.py \
396 lib/tools/ensure_dirs.py \
397 lib/tools/node_cleanup.py \
398 lib/tools/node_daemon_setup.py \
399 lib/tools/prepare_node_join.py
402 lib/utils/__init__.py \
404 lib/utils/filelock.py \
410 lib/utils/nodesetup.py \
411 lib/utils/process.py \
413 lib/utils/storage.py \
415 lib/utils/wrapper.py \
422 doc/cluster-merge.rst \
432 doc/design-autorepair.rst \
433 doc/design-bulk-create.rst \
434 doc/design-chained-jobs.rst \
435 doc/design-cpu-pinning.rst \
436 doc/design-device-uuid-name.rst \
437 doc/design-draft.rst \
438 doc/design-htools-2.3.rst \
439 doc/design-http-server.rst \
440 doc/design-impexp2.rst \
441 doc/design-internal-shutdown.rst \
442 doc/design-lu-generated-jobs.rst \
443 doc/design-linuxha.rst \
444 doc/design-multi-reloc.rst \
445 doc/design-network.rst \
446 doc/design-node-add.rst \
448 doc/design-ovf-support.rst \
449 doc/design-opportunistic-locking.rst \
450 doc/design-partitioned.rst \
451 doc/design-query-splitting.rst \
452 doc/design-query2.rst \
453 doc/design-reason-trail.rst \
454 doc/design-resource-model.rst \
455 doc/design-restricted-commands.rst \
456 doc/design-shared-storage.rst \
457 doc/design-monitoring-agent.rst \
458 doc/design-virtual-clusters.rst \
459 doc/design-x509-ca.rst \
460 doc/design-hroller.rst \
461 doc/design-storagetypes.rst \
467 doc/install-quick.rst \
470 doc/manpages-disabled.rst \
471 doc/move-instance.rst \
473 doc/ovfconverter.rst \
477 doc/virtual-cluster.rst \
480 # Generates file names such as "doc/man-gnt-instance.rst"
481 mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
483 # Haskell programs to be installed in $PREFIX/bin
484 HS_BIN_PROGS=src/htools
486 # Haskell programs to be installed in the MYEXECLIB dir
488 HS_MYEXECLIB_PROGS=src/mon-collector
493 # Haskell programs to be compiled by "make really-all"
499 # All Haskell non-test programs to be compiled but not automatically installed
500 HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
502 HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
503 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
508 test/hs/hpc-mon-collector \
512 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
513 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
516 -O -Wall -Werror -isrc \
517 -fwarn-monomorphism-restriction \
519 $(GHC_BYVERSION_FLAGS)
521 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
523 # internal extra flags (used for test/hs/htest mainly)
525 # exclude options for coverage reports
526 HPCEXCL = --exclude Main \
527 --exclude Ganeti.Constants \
528 --exclude Ganeti.HTools.QC \
529 --exclude Ganeti.THH \
530 --exclude Ganeti.Version \
531 --exclude Test.Ganeti.Attoparsec \
532 --exclude Test.Ganeti.TestCommon \
533 --exclude Test.Ganeti.TestHTools \
534 --exclude Test.Ganeti.TestHelper \
535 --exclude Test.Ganeti.TestImports \
536 $(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
539 src/Ganeti/BasicTypes.hs \
540 src/Ganeti/Common.hs \
541 src/Ganeti/Compat.hs \
542 src/Ganeti/Confd/Client.hs \
543 src/Ganeti/Confd/Server.hs \
544 src/Ganeti/Confd/Types.hs \
545 src/Ganeti/Confd/Utils.hs \
546 src/Ganeti/Config.hs \
547 src/Ganeti/Curl/Multi.hs \
548 src/Ganeti/Daemon.hs \
549 src/Ganeti/DataCollectors/CLI.hs \
550 src/Ganeti/DataCollectors/Diskstats.hs \
551 src/Ganeti/DataCollectors/Drbd.hs \
552 src/Ganeti/DataCollectors/InstStatus.hs \
553 src/Ganeti/DataCollectors/InstStatusTypes.hs \
554 src/Ganeti/DataCollectors/Program.hs \
555 src/Ganeti/DataCollectors/Types.hs \
556 src/Ganeti/Errors.hs \
557 src/Ganeti/HTools/Backend/IAlloc.hs \
558 src/Ganeti/HTools/Backend/Luxi.hs \
559 src/Ganeti/HTools/Backend/Rapi.hs \
560 src/Ganeti/HTools/Backend/Simu.hs \
561 src/Ganeti/HTools/Backend/Text.hs \
562 src/Ganeti/HTools/CLI.hs \
563 src/Ganeti/HTools/Cluster.hs \
564 src/Ganeti/HTools/Container.hs \
565 src/Ganeti/HTools/ExtLoader.hs \
566 src/Ganeti/HTools/Graph.hs \
567 src/Ganeti/HTools/Group.hs \
568 src/Ganeti/HTools/Instance.hs \
569 src/Ganeti/HTools/Loader.hs \
570 src/Ganeti/HTools/Nic.hs \
571 src/Ganeti/HTools/Node.hs \
572 src/Ganeti/HTools/PeerMap.hs \
573 src/Ganeti/HTools/Program/Hail.hs \
574 src/Ganeti/HTools/Program/Harep.hs \
575 src/Ganeti/HTools/Program/Hbal.hs \
576 src/Ganeti/HTools/Program/Hcheck.hs \
577 src/Ganeti/HTools/Program/Hinfo.hs \
578 src/Ganeti/HTools/Program/Hscan.hs \
579 src/Ganeti/HTools/Program/Hspace.hs \
580 src/Ganeti/HTools/Program/Hroller.hs \
581 src/Ganeti/HTools/Program/Main.hs \
582 src/Ganeti/HTools/Types.hs \
583 src/Ganeti/Hypervisor/Xen.hs \
584 src/Ganeti/Hypervisor/Xen/XmParser.hs \
585 src/Ganeti/Hypervisor/Xen/Types.hs \
587 src/Ganeti/JQueue.hs \
590 src/Ganeti/Logging.hs \
592 src/Ganeti/Monitoring/Server.hs \
593 src/Ganeti/Network.hs \
594 src/Ganeti/Objects.hs \
595 src/Ganeti/OpCodes.hs \
596 src/Ganeti/OpParams.hs \
598 src/Ganeti/Query/Cluster.hs \
599 src/Ganeti/Query/Common.hs \
600 src/Ganeti/Query/Export.hs \
601 src/Ganeti/Query/Filter.hs \
602 src/Ganeti/Query/Group.hs \
603 src/Ganeti/Query/Job.hs \
604 src/Ganeti/Query/Language.hs \
605 src/Ganeti/Query/Network.hs \
606 src/Ganeti/Query/Node.hs \
607 src/Ganeti/Query/Query.hs \
608 src/Ganeti/Query/Server.hs \
609 src/Ganeti/Query/Types.hs \
611 src/Ganeti/Runtime.hs \
612 src/Ganeti/Ssconf.hs \
613 src/Ganeti/Storage/Diskstats/Parser.hs \
614 src/Ganeti/Storage/Diskstats/Types.hs \
615 src/Ganeti/Storage/Drbd/Parser.hs \
616 src/Ganeti/Storage/Drbd/Types.hs \
617 src/Ganeti/Storage/Utils.hs \
619 src/Ganeti/Types.hs \
623 test/hs/Test/Ganeti/Attoparsec.hs \
624 test/hs/Test/Ganeti/BasicTypes.hs \
625 test/hs/Test/Ganeti/Common.hs \
626 test/hs/Test/Ganeti/Confd/Types.hs \
627 test/hs/Test/Ganeti/Confd/Utils.hs \
628 test/hs/Test/Ganeti/Daemon.hs \
629 test/hs/Test/Ganeti/Errors.hs \
630 test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
631 test/hs/Test/Ganeti/HTools/Backend/Text.hs \
632 test/hs/Test/Ganeti/HTools/CLI.hs \
633 test/hs/Test/Ganeti/HTools/Cluster.hs \
634 test/hs/Test/Ganeti/HTools/Container.hs \
635 test/hs/Test/Ganeti/HTools/Graph.hs \
636 test/hs/Test/Ganeti/HTools/Instance.hs \
637 test/hs/Test/Ganeti/HTools/Loader.hs \
638 test/hs/Test/Ganeti/HTools/Node.hs \
639 test/hs/Test/Ganeti/HTools/PeerMap.hs \
640 test/hs/Test/Ganeti/HTools/Types.hs \
641 test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
642 test/hs/Test/Ganeti/JSON.hs \
643 test/hs/Test/Ganeti/Jobs.hs \
644 test/hs/Test/Ganeti/JQueue.hs \
645 test/hs/Test/Ganeti/Luxi.hs \
646 test/hs/Test/Ganeti/Network.hs \
647 test/hs/Test/Ganeti/Objects.hs \
648 test/hs/Test/Ganeti/OpCodes.hs \
649 test/hs/Test/Ganeti/Query/Filter.hs \
650 test/hs/Test/Ganeti/Query/Language.hs \
651 test/hs/Test/Ganeti/Query/Network.hs \
652 test/hs/Test/Ganeti/Query/Query.hs \
653 test/hs/Test/Ganeti/Rpc.hs \
654 test/hs/Test/Ganeti/Runtime.hs \
655 test/hs/Test/Ganeti/Ssconf.hs \
656 test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
657 test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
658 test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
659 test/hs/Test/Ganeti/THH.hs \
660 test/hs/Test/Ganeti/TestCommon.hs \
661 test/hs/Test/Ganeti/TestHTools.hs \
662 test/hs/Test/Ganeti/TestHelper.hs \
663 test/hs/Test/Ganeti/Types.hs \
664 test/hs/Test/Ganeti/Utils.hs
666 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
669 test/hs/Test/Ganeti/TestImports.hs \
670 src/Ganeti/Constants.hs \
671 src/Ganeti/Curl/Internal.hs \
672 src/Ganeti/Version.hs
674 $(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
675 src/Ganeti/Curl/Internal.hsc
677 HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
679 $(RUN_IN_TEMPDIR): | stamp-directories
681 doc/html/index.html: ENABLE_MANPAGES =
682 doc/man-html/index.html: ENABLE_MANPAGES = 1
683 doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
685 # Note: we use here an order-only prerequisite, as the contents of
686 # _autoconf.py are not actually influencing the html build output: it
687 # has to exist in order for the sphinx module to be loaded
688 # successfully, but we certainly don't want the docs to be rebuilt if
690 doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
691 configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
692 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
693 doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
694 | $(BUILT_PYTHON_SOURCES)
695 @test -n "$(SPHINX)" || \
696 { echo 'sphinx-build' not found during configure; exit 1; }
698 if test -n '$(ENABLE_MANPAGES)'; then \
699 echo 'Man pages in documentation were disabled at configure time' >&2; \
703 ## Sphinx provides little control over what content should be included. Some
704 ## mechanisms exist, but they all have drawbacks or actual issues. Since we
705 ## build two different versions of the documentation--once without man pages and
706 ## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
707 ## us with this, but requires running in a temporary directory. It moves the
708 ## correct files into place depending on environment variables.
711 PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
712 $(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
714 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
715 -D release="$(PACKAGE_VERSION)" \
716 -D graphviz_dot="$(DOT)" \
717 -D enable_manpages="$(ENABLE_MANPAGES)" \
718 doc $(CURDIR)/$$dir && \
719 rm -f $$dir/.buildinfo $$dir/objects.inv
722 doc/html: doc/html/index.html
724 doc/man-html: doc/man-html/index.html
726 doc/install-quick.rst: INSTALL
728 doc/upgrade.rst: UPGRADE
730 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
732 { echo '.. This file is automatically updated at build time from $<.'; \
733 echo '.. Do not edit.'; \
738 doc/manpages-enabled.rst: Makefile | $(built_base_sources)
739 { echo '.. This file is automatically generated, do not edit!'; \
744 echo '.. toctree::'; \
745 echo ' :maxdepth: 1'; \
747 for i in $(notdir $(mandocrst)); do \
749 done | LC_ALL=C sort; \
752 doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
754 { echo '.. This file is automatically updated at build time from $<.'; \
755 echo '.. Do not edit.'; \
758 echo '=========================================='; \
759 tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
762 echo 'Man pages in documentation were disabled at configure time' >&2; \
766 # Things to build but not to install (add it to EXTRA_DIST if it should be
771 doc/examples/bash_completion \
772 doc/examples/bash_completion-debug \
776 noinst_DATA += doc/man-html
781 scripts/gnt-cluster \
784 scripts/gnt-instance \
786 scripts/gnt-network \
791 PYTHON_BOOTSTRAP_SBIN = \
792 daemons/ganeti-masterd \
793 daemons/ganeti-noded \
794 daemons/ganeti-rapi \
795 daemons/ganeti-watcher \
799 $(PYTHON_BOOTSTRAP_SBIN) \
803 tools/node-daemon-setup \
804 tools/prepare-node-join
816 qa/qa_instance_utils.py \
818 qa/qa_monitoring.py \
827 bin_SCRIPTS += $(HS_BIN_PROGS)
829 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
830 # FIXME: this is a hardcoded logic, instead of auto-resolving
831 $(LN_S) -f ../../../bin/htools \
832 $(DESTDIR)$(iallocatorsdir)/hail
833 for role in $(HS_BIN_ROLES); do \
834 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
838 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) Makefile
839 @if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
840 echo "Error: cannot run unittests without the development" \
841 " libraries (see devnotes.rst)" 1>&2; \
844 @rm -f $(notdir $@).tix
847 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
848 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
849 $(HEXTRA) $(HEXTRA_INT) $@
852 # for the test/hs/htest binary, we need to enable profiling/coverage
853 test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
855 # we compile the hpc-htools binary with the program coverage
856 test/hs/hpc-htools: HEXTRA_INT=-fhpc
858 # we compile the hpc-mon-collector binary with the program coverage
859 test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
862 test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
864 # rules for building profiling-enabled versions of the haskell
865 # programs: hs-prof does the full two-step build, whereas
866 # hs-prof-quick does only the final rebuild (hs-prof must have been
868 .PHONY: hs-prof hs-prof-quick
870 @if [ -z "$(TARGET)" ]; then \
871 echo "You need to define TARGET when running this rule" 1>&2; \
874 $(MAKE) $(AM_MAKEFLAGS) clean
875 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf o"
876 rm -f $(HS_ALL_PROGS)
877 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
880 @if [ -z "$(TARGET)" ]; then \
881 echo "You need to define TARGET when running this rule" 1>&2; \
884 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf prof_o -prof -auto-all"
886 dist_sbin_SCRIPTS = \
887 tools/ganeti-listrunner
889 nodist_sbin_SCRIPTS = \
890 $(PYTHON_BOOTSTRAP_SBIN) \
891 daemons/ganeti-cleaner
894 src/ganeti-confd: src/hconfd
897 nodist_sbin_SCRIPTS += src/ganeti-confd
901 nodist_sbin_SCRIPTS += src/ganeti-mond
908 tools/cluster-merge \
912 tools/move-instance \
914 tools/sanitize-config
916 dist_tools_SCRIPTS = \
919 tools/kvm-console-wrapper \
920 tools/master-ip-setup \
921 tools/xen-console-wrapper
923 nodist_tools_python_scripts = \
926 nodist_tools_SCRIPTS = \
927 $(nodist_tools_python_scripts) \
931 pkglib_python_scripts = \
932 daemons/import-export \
933 tools/check-cert-expired
935 nodist_pkglib_python_scripts = \
937 tools/node-daemon-setup \
938 tools/prepare-node-join
940 myexeclib_SCRIPTS = \
941 daemons/daemon-util \
945 $(pkglib_python_scripts) \
946 $(HS_MYEXECLIB_PROGS)
948 nodist_myexeclib_SCRIPTS = \
949 $(nodist_pkglib_python_scripts)
956 autotools/build-bash-completion \
957 autotools/build-rpc \
958 autotools/check-header \
959 autotools/check-imports \
960 autotools/check-man-dashes \
961 autotools/check-man-references \
962 autotools/check-man-warnings \
963 autotools/check-news \
964 autotools/check-python-code \
965 autotools/check-tar \
966 autotools/check-version \
967 autotools/convert-constants \
969 autotools/gen-py-coverage \
970 autotools/sphinx-wrapper \
971 autotools/testrunner \
972 autotools/wrong-hardcoded-paths \
974 daemons/daemon-util.in \
975 daemons/ganeti-cleaner.in \
976 $(pkglib_python_scripts) \
980 tools/vif-ganeti.in \
981 tools/net-common.in \
982 tools/users-setup.in \
983 tools/vcluster-setup.in \
986 $(BUILT_EXAMPLES:%=%.in) \
987 doc/examples/ganeti.default \
988 doc/examples/ganeti.default-debug \
989 doc/examples/hooks/ethers \
990 doc/examples/gnt-debug/README \
991 doc/examples/gnt-debug/delay0.json \
992 doc/examples/gnt-debug/delay50.json \
993 test/py/lockperf.py \
994 test/py/testutils.py \
1003 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
1006 test/hs/cli-tests-defs.sh \
1007 test/hs/offline-test.sh \
1011 man/ganeti-cleaner.8 \
1012 man/ganeti-confd.8 \
1013 man/ganeti-listrunner.8 \
1014 man/ganeti-masterd.8 \
1016 man/ganeti-noded.8 \
1017 man/ganeti-os-interface.7 \
1018 man/ganeti-extstorage-interface.7 \
1020 man/ganeti-watcher.8 \
1027 man/gnt-instance.8 \
1043 # Remove extensions from all filenames in man_MANS
1044 mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1046 manrst = $(patsubst %,%.rst,$(mannoext))
1047 manhtml = $(patsubst %.rst,%.html,$(manrst))
1048 mangen = $(patsubst %.rst,%.gen,$(manrst))
1050 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1051 $(patsubst %.html,%.html.in,$(manhtml)) \
1055 test/autotools/autotools-check-news.test \
1056 test/data/htools/clean-nonzero-score.data \
1057 test/data/htools/common-suffix.data \
1058 test/data/htools/empty-cluster.data \
1059 test/data/htools/hail-alloc-drbd.json \
1060 test/data/htools/hail-alloc-invalid-network.json \
1061 test/data/htools/hail-alloc-invalid-twodisks.json \
1062 test/data/htools/hail-alloc-restricted-network.json \
1063 test/data/htools/hail-alloc-spindles.json \
1064 test/data/htools/hail-alloc-twodisks.json \
1065 test/data/htools/hail-change-group.json \
1066 test/data/htools/hail-invalid-reloc.json \
1067 test/data/htools/hail-node-evac.json \
1068 test/data/htools/hail-reloc-drbd.json \
1069 test/data/htools/hbal-excl-tags.data \
1070 test/data/htools/hbal-split-insts.data \
1071 test/data/htools/hspace-tiered-dualspec-exclusive.data \
1072 test/data/htools/hspace-tiered-dualspec.data \
1073 test/data/htools/hspace-tiered-exclusive.data \
1074 test/data/htools/hspace-tiered-ipolicy.data \
1075 test/data/htools/hspace-tiered-mixed.data \
1076 test/data/htools/hspace-tiered-resourcetypes.data \
1077 test/data/htools/hspace-tiered.data \
1078 test/data/htools/invalid-node.data \
1079 test/data/htools/missing-resources.data \
1080 test/data/htools/multiple-master.data \
1081 test/data/htools/multiple-tags.data \
1082 test/data/htools/n1-failure.data \
1083 test/data/htools/rapi/groups.json \
1084 test/data/htools/rapi/info.json \
1085 test/data/htools/rapi/instances.json \
1086 test/data/htools/rapi/nodes.json \
1087 test/data/htools/hroller-nodegroups.data \
1088 test/data/htools/hroller-nonredundant.data \
1089 test/data/htools/hroller-online.data \
1090 test/data/htools/unique-reboot-order.data \
1091 test/hs/shelltests/htools-balancing.test \
1092 test/hs/shelltests/htools-basic.test \
1093 test/hs/shelltests/htools-dynutil.test \
1094 test/hs/shelltests/htools-excl.test \
1095 test/hs/shelltests/htools-hail.test \
1096 test/hs/shelltests/htools-hroller.test \
1097 test/hs/shelltests/htools-hspace.test \
1098 test/hs/shelltests/htools-invalid.test \
1099 test/hs/shelltests/htools-multi-group.test \
1100 test/hs/shelltests/htools-no-backend.test \
1101 test/hs/shelltests/htools-rapi.test \
1102 test/hs/shelltests/htools-single-group.test \
1103 test/hs/shelltests/htools-text-backend.test \
1104 test/hs/shelltests/htools-mon-collector.test \
1105 test/data/bdev-drbd-8.0.txt \
1106 test/data/bdev-drbd-8.3.txt \
1107 test/data/bdev-drbd-8.4.txt \
1108 test/data/bdev-drbd-disk.txt \
1109 test/data/bdev-drbd-net-ip4.txt \
1110 test/data/bdev-drbd-net-ip6.txt \
1111 test/data/bdev-rbd/json_output_empty.txt \
1112 test/data/bdev-rbd/json_output_extra_matches.txt \
1113 test/data/bdev-rbd/json_output_no_matches.txt \
1114 test/data/bdev-rbd/json_output_ok.txt \
1115 test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1116 test/data/bdev-rbd/plain_output_new_no_matches.txt \
1117 test/data/bdev-rbd/plain_output_new_ok.txt \
1118 test/data/bdev-rbd/plain_output_old_empty.txt \
1119 test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1120 test/data/bdev-rbd/plain_output_old_no_matches.txt \
1121 test/data/bdev-rbd/plain_output_old_ok.txt \
1122 test/data/bdev-rbd/output_invalid.txt \
1123 test/data/cert1.pem \
1124 test/data/cert2.pem \
1125 test/data/cluster_config_2.7.json \
1126 test/data/cluster_config_2.8.json \
1127 test/data/instance-minor-pairing.txt \
1128 test/data/ip-addr-show-dummy0.txt \
1129 test/data/ip-addr-show-lo-ipv4.txt \
1130 test/data/ip-addr-show-lo-ipv6.txt \
1131 test/data/ip-addr-show-lo-oneline-ipv4.txt \
1132 test/data/ip-addr-show-lo-oneline-ipv6.txt \
1133 test/data/ip-addr-show-lo-oneline.txt \
1134 test/data/ip-addr-show-lo.txt \
1135 test/data/kvm_0.12.5_help.txt \
1136 test/data/kvm_0.15.90_help.txt \
1137 test/data/kvm_0.9.1_help.txt \
1138 test/data/kvm_0.9.1_help_boot_test.txt \
1139 test/data/kvm_1.0_help.txt \
1140 test/data/kvm_1.1.2_help.txt \
1141 test/data/NEWS_OK.txt \
1142 test/data/NEWS_previous_unreleased.txt \
1143 test/data/ovfdata/compr_disk.vmdk.gz \
1144 test/data/ovfdata/config.ini \
1145 test/data/ovfdata/corrupted_resources.ovf \
1146 test/data/ovfdata/empty.ini \
1147 test/data/ovfdata/empty.ovf \
1148 test/data/ovfdata/ganeti.mf \
1149 test/data/ovfdata/ganeti.ovf \
1150 test/data/ovfdata/gzip_disk.ovf \
1151 test/data/ovfdata/new_disk.vmdk \
1152 test/data/ovfdata/no_disk.ini \
1153 test/data/ovfdata/no_disk_in_ref.ovf \
1154 test/data/ovfdata/no_os.ini \
1155 test/data/ovfdata/no_ovf.ova \
1156 test/data/ovfdata/other/rawdisk.raw \
1157 test/data/ovfdata/ova.ova \
1158 test/data/ovfdata/rawdisk.raw \
1159 test/data/ovfdata/second_disk.vmdk \
1160 test/data/ovfdata/unsafe_path.ini \
1161 test/data/ovfdata/virtualbox.ovf \
1162 test/data/ovfdata/wrong_config.ini \
1163 test/data/ovfdata/wrong_extension.ovd \
1164 test/data/ovfdata/wrong_manifest.mf \
1165 test/data/ovfdata/wrong_manifest.ovf \
1166 test/data/ovfdata/wrong_ova.ova \
1167 test/data/ovfdata/wrong_xml.ovf \
1168 test/data/proc_diskstats.txt \
1169 test/data/proc_drbd8.txt \
1170 test/data/proc_drbd80-emptyline.txt \
1171 test/data/proc_drbd80-emptyversion.txt \
1172 test/data/proc_drbd83.txt \
1173 test/data/proc_drbd83_sync.txt \
1174 test/data/proc_drbd83_sync_want.txt \
1175 test/data/proc_drbd83_sync_krnl2.6.39.txt \
1176 test/data/proc_drbd84.txt \
1177 test/data/proc_drbd84_sync.txt \
1178 test/data/qa-minimal-nodes-instances-only.json \
1179 test/data/sys_drbd_usermode_helper.txt \
1180 test/data/vgreduce-removemissing-2.02.02.txt \
1181 test/data/vgreduce-removemissing-2.02.66-fail.txt \
1182 test/data/vgreduce-removemissing-2.02.66-ok.txt \
1183 test/data/vgs-missing-pvs-2.02.02.txt \
1184 test/data/vgs-missing-pvs-2.02.66.txt \
1185 test/data/xen-xm-info-4.0.1.txt \
1186 test/data/xen-xm-list-4.0.1-dom0-only.txt \
1187 test/data/xen-xm-list-4.0.1-four-instances.txt \
1188 test/data/xen-xm-list-long-4.0.1.txt \
1189 test/data/xen-xm-uptime-4.0.1.txt \
1190 test/py/ganeti-cli.test \
1191 test/py/gnt-cli.test \
1192 test/py/import-export_unittest-helper
1196 doc/examples/rapi_testutils.py \
1197 test/py/cfgupgrade_unittest.py \
1198 test/py/docs_unittest.py \
1199 test/py/ganeti.asyncnotifier_unittest.py \
1200 test/py/ganeti.backend_unittest-runasroot.py \
1201 test/py/ganeti.backend_unittest.py \
1202 test/py/ganeti.cli_unittest.py \
1203 test/py/ganeti.client.gnt_cluster_unittest.py \
1204 test/py/ganeti.client.gnt_instance_unittest.py \
1205 test/py/ganeti.client.gnt_job_unittest.py \
1206 test/py/ganeti.cmdlib_unittest.py \
1207 test/py/ganeti.compat_unittest.py \
1208 test/py/ganeti.confd.client_unittest.py \
1209 test/py/ganeti.config_unittest.py \
1210 test/py/ganeti.constants_unittest.py \
1211 test/py/ganeti.daemon_unittest.py \
1212 test/py/ganeti.errors_unittest.py \
1213 test/py/ganeti.hooks_unittest.py \
1214 test/py/ganeti.ht_unittest.py \
1215 test/py/ganeti.http_unittest.py \
1216 test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1217 test/py/ganeti.hypervisor.hv_fake_unittest.py \
1218 test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1219 test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1220 test/py/ganeti.hypervisor.hv_xen_unittest.py \
1221 test/py/ganeti.hypervisor_unittest.py \
1222 test/py/ganeti.impexpd_unittest.py \
1223 test/py/ganeti.jqueue_unittest.py \
1224 test/py/ganeti.jstore_unittest.py \
1225 test/py/ganeti.locking_unittest.py \
1226 test/py/ganeti.luxi_unittest.py \
1227 test/py/ganeti.masterd.iallocator_unittest.py \
1228 test/py/ganeti.masterd.instance_unittest.py \
1229 test/py/ganeti.mcpu_unittest.py \
1230 test/py/ganeti.netutils_unittest.py \
1231 test/py/ganeti.objects_unittest.py \
1232 test/py/ganeti.opcodes_unittest.py \
1233 test/py/ganeti.outils_unittest.py \
1234 test/py/ganeti.ovf_unittest.py \
1235 test/py/ganeti.qlang_unittest.py \
1236 test/py/ganeti.query_unittest.py \
1237 test/py/ganeti.rapi.baserlib_unittest.py \
1238 test/py/ganeti.rapi.client_unittest.py \
1239 test/py/ganeti.rapi.resources_unittest.py \
1240 test/py/ganeti.rapi.rlib2_unittest.py \
1241 test/py/ganeti.rapi.testutils_unittest.py \
1242 test/py/ganeti.rpc_unittest.py \
1243 test/py/ganeti.runtime_unittest.py \
1244 test/py/ganeti.serializer_unittest.py \
1245 test/py/ganeti.server.rapi_unittest.py \
1246 test/py/ganeti.ssconf_unittest.py \
1247 test/py/ganeti.ssh_unittest.py \
1248 test/py/ganeti.storage.bdev_unittest.py \
1249 test/py/ganeti.storage.container_unittest.py \
1250 test/py/ganeti.storage.drbd_unittest.py \
1251 test/py/ganeti.storage.filestorage_unittest.py \
1252 test/py/ganeti.tools.burnin_unittest.py \
1253 test/py/ganeti.tools.ensure_dirs_unittest.py \
1254 test/py/ganeti.tools.node_daemon_setup_unittest.py \
1255 test/py/ganeti.tools.prepare_node_join_unittest.py \
1256 test/py/ganeti.uidpool_unittest.py \
1257 test/py/ganeti.utils.algo_unittest.py \
1258 test/py/ganeti.utils.filelock_unittest.py \
1259 test/py/ganeti.utils.hash_unittest.py \
1260 test/py/ganeti.utils.io_unittest-runasroot.py \
1261 test/py/ganeti.utils.io_unittest.py \
1262 test/py/ganeti.utils.log_unittest.py \
1263 test/py/ganeti.utils.lvm_unittest.py \
1264 test/py/ganeti.utils.mlock_unittest.py \
1265 test/py/ganeti.utils.nodesetup_unittest.py \
1266 test/py/ganeti.utils.process_unittest.py \
1267 test/py/ganeti.utils.retry_unittest.py \
1268 test/py/ganeti.utils.storage_unittest.py \
1269 test/py/ganeti.utils.text_unittest.py \
1270 test/py/ganeti.utils.wrapper_unittest.py \
1271 test/py/ganeti.utils.x509_unittest.py \
1272 test/py/ganeti.utils_unittest.py \
1273 test/py/ganeti.vcluster_unittest.py \
1274 test/py/ganeti.workerpool_unittest.py \
1275 test/py/pycurl_reset_unittest.py \
1276 test/py/qa.qa_config_unittest.py \
1277 test/py/tempfile_fork_unittest.py
1279 haskell_tests = test/hs/htest
1282 test/py/check-cert-expired_unittest.bash \
1283 test/py/daemon-util_unittest.bash \
1284 test/py/ganeti-cleaner_unittest.bash \
1285 test/py/import-export_unittest.bash \
1286 test/py/cli-test.bash \
1287 test/py/bash_completion.bash
1290 dist_TESTS += $(python_tests)
1297 nodist_TESTS += $(haskell_tests)
1298 dist_TESTS += test/hs/offline-test.sh
1300 test/hs/hpc-htools \
1301 test/hs/hpc-mon-collector \
1302 $(HS_BUILT_TEST_HELPERS)
1305 TESTS = $(dist_TESTS) $(nodist_TESTS)
1307 # Environment for all tests
1308 PLAIN_TESTS_ENVIRONMENT = \
1310 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1311 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1314 # Environment for tests run by automake
1315 TESTS_ENVIRONMENT = \
1316 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1319 $(dist_sbin_SCRIPTS) \
1321 $(pkglib_python_scripts) \
1322 $(nodist_pkglib_python_scripts) \
1323 $(nodist_tools_python_scripts) \
1324 $(pkgpython_PYTHON) \
1327 $(hypervisor_PYTHON) \
1342 all_python_code += $(python_tests)
1347 test/py/check-cert-expired_unittest.bash \
1348 test/py/daemon-util_unittest.bash \
1349 test/py/ganeti-cleaner_unittest.bash \
1350 test/py/import-export_unittest.bash \
1351 test/py/cli-test.bash \
1352 test/py/bash_completion.bash \
1353 test/hs/offline-test.sh \
1354 test/hs/cli-tests-defs.sh \
1355 $(all_python_code) \
1356 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1359 check_python_code = \
1360 $(BUILD_BASH_COMPLETION) \
1366 lint_python_code = \
1368 ganeti/http/server.py \
1369 $(dist_sbin_SCRIPTS) \
1371 $(pkglib_python_scripts) \
1372 $(BUILD_BASH_COMPLETION) \
1378 standalone_python_modules = \
1379 lib/rapi/client.py \
1380 tools/ganeti-listrunner
1382 pep8_python_code = \
1384 ganeti/http/server.py \
1385 $(dist_sbin_SCRIPTS) \
1387 $(pkglib_python_scripts) \
1388 $(BUILD_BASH_COMPLETION) \
1391 $(PYTHON_BOOTSTRAP) \
1394 test/py/daemon-util_unittest.bash: daemons/daemon-util
1396 test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1398 test/py/bash_completion.bash: doc/examples/bash_completion-debug
1400 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1401 sed -f $(REPLACE_VARS_SED) < $< > $@
1404 tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
1405 sed -f $(REPLACE_VARS_SED) < $< > $@
1408 tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
1409 sed -f $(REPLACE_VARS_SED) < $< > $@
1412 tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
1413 sed -f $(REPLACE_VARS_SED) < $< > $@
1416 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1417 sed -f $(REPLACE_VARS_SED) < $< > $@
1420 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1421 sed -f $(REPLACE_VARS_SED) < $< > $@
1424 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1425 sed -f $(REPLACE_VARS_SED) < $< > $@
1427 doc/examples/bash_completion: BC_ARGS = --compact
1428 doc/examples/bash_completion-debug: BC_ARGS =
1430 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1431 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1432 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1433 daemons/ganeti-cleaner \
1434 $(GENERATED_FILES) $(HS_GENERATED_FILES)
1435 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1436 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1438 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1439 lib/build/shell_example_lexer.py \
1440 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1441 @echo "Checking $< for hardcoded paths..."
1442 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1443 echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1447 trap 'echo auto-removing $@; rm $@' EXIT; \
1448 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1449 $(CHECK_MAN_REFERENCES) $@; \
1452 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1453 @test -n "$(PANDOC)" || \
1454 { echo 'pandoc' not found during configure; exit 1; }
1455 set -o pipefail -e; \
1456 trap 'echo auto-removing $@; rm $@' EXIT; \
1457 $(PANDOC) -s -f rst -t man $< man/footer.rst | \
1458 sed -e 's/\\@/@/g' > $@; \
1459 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1460 $(CHECK_MAN_DASHES) $@; \
1463 man/%.html.in: man/%.gen man/footer.rst
1464 @test -n "$(PANDOC)" || \
1465 { echo 'pandoc' not found during configure; exit 1; }
1467 $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1468 sed -e 's/\\@/@/g' > $@
1470 man/%: man/%.in $(REPLACE_VARS_SED)
1471 sed -f $(REPLACE_VARS_SED) < $< > $@
1473 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1474 sed -f $(REPLACE_VARS_SED) < $< > $@
1477 if test -d .git; then \
1478 git describe > $@; \
1479 elif test ! -f $@ ; then \
1480 echo "Cannot auto-generate $@ file"; exit 1; \
1483 .PHONY: clean-vcs-version
1487 .PHONY: regen-vcs-version
1491 if test -d .git; then \
1492 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1493 git describe > $$T; \
1494 if ! cmp --quiet $$T vcs-version; then \
1495 mv $$T vcs-version; \
1499 src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1500 vcs-version $(built_base_sources)
1502 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1503 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1505 src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
1506 lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
1507 lib/jstore.py $(RUN_IN_TEMPDIR) \
1508 $(CONVERT_CONSTANTS) $(built_base_sources) \
1509 | lib/_vcsversion.py
1512 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
1515 src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
1518 test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1519 $(built_base_sources)
1523 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1524 echo "import $$name ()" ; \
1528 lib/_autoconf.py: Makefile | stamp-directories
1530 { echo '# This file is automatically generated, do not edit!'; \
1533 echo '"""Build-time configuration for Ganeti.'; \
1535 echo 'This file is autogenerated by the build process.'; \
1536 echo 'For any changes you need to re-run ./configure (and'; \
1537 echo 'not edit by hand).'; \
1541 echo '# pylint: disable=C0301,C0324'; \
1542 echo '# because this is autogenerated, we do not want'; \
1543 echo '# style warnings' ; \
1545 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1546 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1547 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1548 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1549 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1550 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1551 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1552 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1553 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1554 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1555 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1556 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1557 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1558 echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
1559 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1560 echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
1561 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1562 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1563 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1564 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1565 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1566 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1567 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1568 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1569 echo "KVM_PATH = '$(KVM_PATH)'"; \
1570 echo "IP_PATH = '$(IP_PATH)'"; \
1571 echo "SOCAT_PATH = '$(SOCAT)'"; \
1572 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1573 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1574 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1575 echo "TOOLSDIR = '$(toolsdir)'"; \
1576 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1577 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1578 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1579 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1580 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1581 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1582 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1583 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1584 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1585 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1586 echo "RAPI_USER = '$(RAPI_USER)'"; \
1587 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1588 echo "CONFD_USER = '$(CONFD_USER)'"; \
1589 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1590 echo "NODED_USER = '$(NODED_USER)'"; \
1591 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1592 echo "MOND_USER = '$(MOND_USER)'"; \
1593 echo "MOND_GROUP = '$(MOND_GROUP)'"; \
1594 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1595 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1596 echo "HTOOLS = True"; \
1597 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1598 echo "XEN_CMD = '$(XEN_CMD)'"; \
1599 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1600 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1601 echo "ENABLE_MOND = $(ENABLE_MOND)"; \
1602 ## Write dictionary with man page name as the key and the section number as the
1604 echo "MAN_PAGES = {"; \
1605 for i in $(notdir $(man_MANS)); do \
1606 echo "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/ "\1": \2,/g'; \
1611 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1613 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1614 { echo '# This file is automatically generated, do not edit!'; \
1617 echo '"""Build-time VCS version number for Ganeti.'; \
1619 echo 'This file is autogenerated by the build process.'; \
1620 echo 'For any changes you need to re-run ./configure (and'; \
1621 echo 'not edit by hand).'; \
1625 echo '# pylint: disable=C0301,C0324'; \
1626 echo '# because this is autogenerated, we do not want'; \
1627 echo '# style warnings' ; \
1629 echo "VCS_VERSION = '$$VCSVER'"; \
1632 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1633 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1635 $(SHELL_ENV_INIT): Makefile stamp-directories
1637 { echo '# Allow overriding for tests'; \
1638 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1639 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1641 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1642 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1643 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1644 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1645 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1648 ## Writes sed script to replace placeholders with build-time values. The
1649 ## additional quotes after the first @ sign are necessary to stop configure
1650 ## from replacing those values as well.
1651 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1653 { echo 's#@''PREFIX@#$(prefix)#g'; \
1654 echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1655 echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1656 echo 's#@''BINDIR@#$(bindir)#g'; \
1657 echo 's#@''SBINDIR@#$(sbindir)#g'; \
1658 echo 's#@''LIBDIR@#$(libdir)#g'; \
1659 echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1660 echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1661 echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1662 echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1663 echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1664 echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1665 echo 's#@''RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1666 echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1667 echo 's#@''PKGLIBDIR@#$(pkglibdir)#g'; \
1668 echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1669 echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1670 echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1671 echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1672 echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
1673 echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1674 echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1675 echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1676 echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1677 echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
1678 echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1679 echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1680 echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
1681 echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1682 echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1684 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1685 echo ' r $(SHELL_ENV_INIT)'; \
1690 # Using deferred evaluation
1691 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1692 daemons/ganeti-watcher: MODULE = ganeti.watcher
1693 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1694 tools/burnin: MODULE = ganeti.tools.burnin
1695 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1696 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1697 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1698 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1699 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1701 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1702 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1704 { echo '#!/usr/bin/python'; \
1705 echo '# This file is automatically generated, do not edit!'; \
1706 echo "# Edit $(MODULE) instead."; \
1708 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1710 echo '# pylint: disable=C0103'; \
1711 echo '# C0103: Invalid name'; \
1713 echo 'import sys'; \
1714 echo 'import $(MODULE) as main'; \
1716 echo '# Temporarily alias commands until bash completion'; \
1717 echo '# generator is changed'; \
1718 echo 'if hasattr(main, "commands"):'; \
1719 echo ' commands = main.commands # pylint: disable=E1101'; \
1720 echo 'if hasattr(main, "aliases"):'; \
1721 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1723 echo 'if __name__ == "__main__":'; \
1724 echo ' sys.exit(main.Main())'; \
1728 $(HS_BUILT_TEST_HELPERS): Makefile
1729 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1731 { echo '#!/bin/sh'; \
1732 echo '# This file is automatically generated, do not edit!'; \
1733 echo "# Edit Makefile.am instead."; \
1735 echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
1739 stamp-directories: Makefile
1740 $(MAKE) $(AM_MAKEFLAGS) ganeti
1741 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1744 # We need to create symlinks because "make distcheck" will not install Python
1745 # files when building.
1746 stamp-srclinks: Makefile | stamp-directories
1748 for i in $(srclink_files); do \
1749 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1750 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1757 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1760 check-dirs: $(GENERATED_FILES)
1762 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1764 while read dir; do \
1766 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1767 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1770 for dir in $(DIRS); do \
1771 if ! test -d "$$dir"; then \
1772 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1776 test -z "$$error"; \
1780 check-local: check-dirs $(GENERATED_FILES)
1781 $(CHECK_PYTHON_CODE) $(check_python_code)
1782 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1783 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1784 RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
1785 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1787 if [ "x`echo $(VERSION_SUFFIX)|grep 'alpha'`" == "x" ]; then \
1788 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1789 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1790 echo "Incorrect version in README, expected $$expver" >&2; \
1793 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1794 doc/security.rst; do \
1795 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1796 "Documents Ganeti version $$expver"; then \
1797 echo "Incorrect version in $$file, expected $$expver" >&2; \
1801 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1802 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
1805 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
1806 ".. Last updated for Ganeti $$expver"; then \
1807 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
1811 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1812 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1813 echo "Longest line in $$file is longer than 80 characters" >&2; \
1820 hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1825 hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
1826 @rm -f hpc-htools.tix hpc-mon-collector.tix
1827 HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
1830 hs-check: hs-tests hs-shell
1832 # E111: indentation is not a multiple of four
1833 # E121: continuation line indentation is not a multiple of four
1834 # (since our indent level is not 4)
1835 # E125: continuation line does not distinguish itself from next logical line
1836 # (since our indent level is not 4)
1837 # E127: continuation line over-indented for visual indent
1838 # (since our indent level is not 4)
1839 # note: do NOT add E128 here; it's a valid style error in most cases!
1840 # I've seen real errors, but also some cases were we indent wrongly
1841 # due to line length; try to rework the cases where it is triggered,
1842 # instead of silencing it
1843 # E261: at least two spaces before inline comment
1844 # E501: line too long (80 characters)
1845 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1847 # For excluding pep8 expects filenames only, not whole paths
1848 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1850 LINT_TARGETS = pylint pylint-qa
1852 LINT_TARGETS += pep8
1855 LINT_TARGETS += hlint
1859 lint: $(LINT_TARGETS)
1862 pylint: $(GENERATED_FILES)
1863 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1864 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1867 pylint-qa: $(GENERATED_FILES)
1868 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1869 cd $(top_srcdir)/qa && \
1870 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1871 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1874 pep8: $(GENERATED_FILES)
1875 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1876 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1877 --repeat $(pep8_python_code)
1879 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1880 HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
1882 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
1883 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1884 @rm -f doc/hs-lint.html
1885 if tty -s; then C="-c"; else C=""; fi; \
1886 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1887 --ignore "Use first" \
1888 --ignore "Use &&&" \
1889 --ignore "Use void" \
1890 --ignore "Reduce duplication" \
1891 --hint src/lint-hints \
1892 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1893 @if [ ! -f doc/hs-lint.html ]; then \
1894 echo "All good" > doc/hs-lint.html; \
1897 # a dist hook rule for updating the vcs-version file; this is
1898 # hardcoded due to where it needs to build the file...
1900 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1901 rm -f $(top_distdir)/vcs-version
1902 cp -p $(srcdir)/vcs-version $(top_distdir)
1904 # a distcheck hook rule for catching revision control directories
1906 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1907 echo "Found revision control files in final archive." 1>&2; \
1910 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1911 echo "Found Python byte code in final archive." 1>&2; \
1914 if find $(top_distdir) -name '*~' | grep .; then \
1915 echo "Found backup files in final archive." 1>&2; \
1918 # Empty files or directories should not be distributed. They can cause
1919 # unnecessary warnings for packagers. Directories used by automake during
1920 # distcheck must be excluded.
1921 if find $(top_distdir) -empty -and -not \( \
1922 -path $(top_distdir)/_build -or \
1923 -path $(top_distdir)/_inst \) | grep .; then \
1924 echo "Found empty files or directories in final archive." 1>&2; \
1927 if test -e $(top_distdir)/doc/man-html; then \
1928 echo "Found documentation including man pages in final archive" >&2; \
1932 # Backwards compatible distcheck-release target
1933 distcheck-release: distcheck
1935 distrebuildcheck: dist
1937 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1938 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1940 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1943 $(MAKE) maintainer-clean; \
1944 cp $(abs_srcdir)/vcs-version .; \
1946 $(MAKE) $(AM_MAKEFLAGS)
1950 for i in $(DIST_ARCHIVES); do \
1951 echo -n "Checking $$i ... "; \
1952 autotools/check-tar < $$i; \
1957 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1958 "$(DESTDIR)${localstatedir}/log/ganeti" \
1959 "$(DESTDIR)${localstatedir}/run/ganeti"
1963 apidoc: py-apidoc hs-apidoc
1969 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1970 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
1971 $(RUN_IN_TEMPDIR) epydoc -v \
1972 --conf $(CURDIR)/epydoc.conf \
1973 --output $(CURDIR)/$(APIDOC_PY_DIR)
1976 hs-apidoc: $(APIDOC_HS_DIR)/index.html
1978 $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
1979 @test -n "$(HSCOLOUR)" || \
1980 { echo 'HsColour' not found during configure; exit 1; }
1981 @test -n "$(HADDOCK)" || \
1982 { echo 'haddock' not found during configure; exit 1; }
1983 rm -rf $(APIDOC_HS_DIR)/*
1984 for i in $(ALL_APIDOC_HS_DIRS); do \
1986 $(HSCOLOUR) -print-css > $$i/hscolour.css; \
1989 export LC_ALL=en_US.UTF-8; \
1990 OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
1991 if [ "$(HS_PARALLEL3)" ]; \
1992 then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
1994 if [ "$(HS_REGEX_PCRE)" ]; \
1995 then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
1997 for file in $(HS_LIBTESTBUILT_SRCS); do \
1998 f_nosrc=$${file##src/}; \
1999 f_notst=$${f_nosrc##test/hs/}; \
2000 f_html=$${f_notst%%.hs}.html; \
2001 $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
2003 $(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
2004 -t ganeti -p src/haddock-prologue \
2005 --source-module="%{MODULE/.//}.html" \
2006 --source-entity="%{MODULE/.//}.html#%{NAME}" \
2008 $(HS_LIBTESTBUILT_SRCS)
2011 TAGS: $(GENERATED_FILES)
2013 $(GHC) -e ":etags" -v0 \
2014 $(filter-out -O -Werror,$(HFLAGS)) \
2015 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
2017 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
2018 -path './daemons/ganeti-*' -o -path './tools/*' -o \
2019 -path './qa/*.py' | \
2020 etags -l python -a -
2026 COVERAGE_TESTS += hs-coverage
2029 COVERAGE_TESTS += py-coverage
2032 coverage: $(COVERAGE_TESTS)
2035 py-coverage: $(GENERATED_FILES) $(python_tests)
2036 @test -n "$(PYCOVERAGE)" || \
2037 { echo 'python-coverage' not found during configure; exit 1; }
2039 COVERAGE=$(PYCOVERAGE) \
2040 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2041 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2042 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2043 $(PLAIN_TESTS_ENVIRONMENT) \
2044 $(abs_top_srcdir)/autotools/gen-py-coverage \
2048 hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2050 $(MAKE) $(AM_MAKEFLAGS) hs-check
2051 @mkdir_p@ $(COVERAGE_HS_DIR)
2052 hpc sum --union $(HPCEXCL) \
2053 htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2054 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2055 hpc report coverage-hs.tix
2056 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2058 # Special "kind-of-QA" target for htools, needs special setup (all
2059 # tools compiled with -fhpc)
2064 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2065 rm -f *.tix *.mix; \
2067 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2068 --output=live-test.tix ; \
2069 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2070 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2071 --srcdir=.. $(HPCEXCL) ; \
2072 hpc report --srcdir=.. live-test $(HPCEXCL)
2074 commit-check: autotools-check distcheck lint apidoc
2077 TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
2078 $(abs_top_srcdir)/test/autotools/*-*.test \
2081 .PHONY: gitignore-check
2083 @if [ -n "`git status --short`" ]; then \
2084 echo "Git status is not clean!" 1>&2 ; \
2085 git status --short; \
2089 # target to rebuild all man pages (both groff and html output)
2091 man: $(man_MANS) $(manhtml)
2093 # Target that builds all binaries (including those that are not
2094 # rebuilt except when running the tests)
2096 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2098 # we don't need the ancient implicit rules:
2105 -include ./Makefile.local