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
67 src/Ganeti/Block/Diskstats \
68 src/Ganeti/Block/Drbd \
71 src/Ganeti/DataCollectors \
73 src/Ganeti/HTools/Backend \
74 src/Ganeti/HTools/Program \
75 src/Ganeti/Hypervisor \
76 src/Ganeti/Hypervisor/Xen \
77 src/Ganeti/Monitoring \
82 test/hs/Test/Ganeti/Block \
83 test/hs/Test/Ganeti/Block/Diskstats \
84 test/hs/Test/Ganeti/Block/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 \
130 test/data/ovfdata/other \
134 ALL_APIDOC_HS_DIRS = \
136 $(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
138 BUILDTIME_DIR_AUTOCREATE = \
141 $(ALL_APIDOC_HS_DIRS) \
149 $(BUILDTIME_DIR_AUTOCREATE) \
155 ganeti-[0-9]*.[0-9]*.[0-9]* \
161 COVERAGE_DIR = doc/coverage
162 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
163 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
165 APIDOC_PY_DIR = $(APIDOC_DIR)/py
166 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
168 MAINTAINERCLEANFILES = \
170 doc/install-quick.rst \
175 maintainer-clean-local:
176 rm -rf $(BUILDTIME_DIRS)
179 $(addsuffix /*.py[co],$(DIRS)) \
180 $(addsuffix /*.hi,$(HS_DIRS)) \
181 $(addsuffix /*.o,$(HS_DIRS)) \
182 $(PYTHON_BOOTSTRAP) \
184 $(REPLACE_VARS_SED) \
186 daemons/daemon-util \
187 daemons/ganeti-cleaner \
188 devel/squeeze-amd64.tar.gz \
189 devel/squeeze-amd64.conf \
191 doc/manpages-enabled.rst \
193 doc/examples/bash_completion \
194 doc/examples/bash_completion-debug \
195 lib/_generated_rpc.py \
200 tools/vcluster-setup \
203 $(nodist_pkgpython_PYTHON) \
204 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
205 $(HS_BUILT_TEST_HELPERS) \
208 .hpc/*.mix src/*.tix test/hs/*.tix \
212 $(built_base_sources) \
213 $(BUILT_PYTHON_SOURCES) \
218 HS_GENERATED_FILES += $(HS_PROGS)
220 HS_GENERATED_FILES += src/hconfd src/ganeti-confd
224 HS_GENERATED_FILES += src/ganeti-mond
228 built_base_sources = \
232 built_python_base_sources = \
236 BUILT_PYTHON_SOURCES = \
237 $(built_python_base_sources) \
238 lib/_generated_rpc.py
240 # Generating the RPC wrappers depends on many things, so make sure
241 # it's built at the end of the built sources
242 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
244 # these are all built from the underlying %.in sources
246 doc/examples/ganeti-kvm-poweroff.initd \
247 doc/examples/ganeti.cron \
248 doc/examples/ganeti.initd \
249 doc/examples/ganeti-master-role.ocf \
250 doc/examples/ganeti-node-role.ocf \
251 doc/examples/gnt-config-backup \
252 doc/examples/hooks/ipsec
254 nodist_pkgpython_PYTHON = \
255 $(BUILT_PYTHON_SOURCES)
258 lib/build/__init__.py \
259 lib/build/shell_example_lexer.py \
260 lib/build/sphinx_ext.py
264 lib/asyncnotifier.py \
300 lib/client/__init__.py \
301 lib/client/gnt_backup.py \
302 lib/client/gnt_cluster.py \
303 lib/client/gnt_debug.py \
304 lib/client/gnt_group.py \
305 lib/client/gnt_instance.py \
306 lib/client/gnt_job.py \
307 lib/client/gnt_node.py \
308 lib/client/gnt_network.py \
309 lib/client/gnt_os.py \
310 lib/client/gnt_storage.py
313 lib/cmdlib/__init__.py \
314 lib/cmdlib/backup.py \
316 lib/cmdlib/cluster.py \
317 lib/cmdlib/common.py \
318 lib/cmdlib/group.py \
319 lib/cmdlib/instance.py \
320 lib/cmdlib/instance_migration.py \
321 lib/cmdlib/instance_operation.py \
322 lib/cmdlib/instance_query.py \
323 lib/cmdlib/instance_storage.py \
324 lib/cmdlib/instance_utils.py \
326 lib/cmdlib/network.py \
328 lib/cmdlib/operating_system.py \
329 lib/cmdlib/query.py \
333 hypervisor_PYTHON = \
334 lib/hypervisor/__init__.py \
335 lib/hypervisor/hv_base.py \
336 lib/hypervisor/hv_chroot.py \
337 lib/hypervisor/hv_fake.py \
338 lib/hypervisor/hv_kvm.py \
339 lib/hypervisor/hv_lxc.py \
340 lib/hypervisor/hv_xen.py
343 lib/storage/__init__.py \
344 lib/storage/bdev.py \
345 lib/storage/base.py \
346 lib/storage/container.py \
347 lib/storage/drbd.py \
348 lib/storage/drbd_info.py \
349 lib/storage/drbd_cmdgen.py \
350 lib/storage/filestorage.py
353 lib/rapi/__init__.py \
354 lib/rapi/baserlib.py \
356 lib/rapi/client_utils.py \
357 lib/rapi/connector.py \
359 lib/rapi/testutils.py
362 lib/http/__init__.py \
368 lib/confd/__init__.py \
372 lib/masterd/__init__.py \
373 lib/masterd/iallocator.py \
374 lib/masterd/instance.py
377 lib/impexpd/__init__.py
380 lib/watcher/__init__.py \
381 lib/watcher/nodemaint.py \
385 lib/server/__init__.py \
386 lib/server/masterd.py \
387 lib/server/noded.py \
391 lib/tools/__init__.py \
392 lib/tools/burnin.py \
393 lib/tools/ensure_dirs.py \
394 lib/tools/node_cleanup.py \
395 lib/tools/node_daemon_setup.py \
396 lib/tools/prepare_node_join.py
399 lib/utils/__init__.py \
401 lib/utils/filelock.py \
407 lib/utils/nodesetup.py \
408 lib/utils/process.py \
410 lib/utils/storage.py \
412 lib/utils/wrapper.py \
419 doc/cluster-merge.rst \
429 doc/design-autorepair.rst \
430 doc/design-bulk-create.rst \
431 doc/design-chained-jobs.rst \
432 doc/design-cpu-pinning.rst \
433 doc/design-device-uuid-name.rst \
434 doc/design-draft.rst \
435 doc/design-htools-2.3.rst \
436 doc/design-http-server.rst \
437 doc/design-impexp2.rst \
438 doc/design-internal-shutdown.rst \
439 doc/design-lu-generated-jobs.rst \
440 doc/design-linuxha.rst \
441 doc/design-multi-reloc.rst \
442 doc/design-network.rst \
443 doc/design-node-add.rst \
445 doc/design-ovf-support.rst \
446 doc/design-opportunistic-locking.rst \
447 doc/design-partitioned.rst \
448 doc/design-query-splitting.rst \
449 doc/design-query2.rst \
450 doc/design-reason-trail.rst \
451 doc/design-resource-model.rst \
452 doc/design-restricted-commands.rst \
453 doc/design-shared-storage.rst \
454 doc/design-monitoring-agent.rst \
455 doc/design-virtual-clusters.rst \
456 doc/design-x509-ca.rst \
457 doc/design-hroller.rst \
458 doc/design-storagetypes.rst \
464 doc/install-quick.rst \
467 doc/manpages-disabled.rst \
468 doc/move-instance.rst \
470 doc/ovfconverter.rst \
474 doc/virtual-cluster.rst \
477 # Generates file names such as "doc/man-gnt-instance.rst"
478 mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
480 # Haskell programs to be installed in $PREFIX/bin
481 HS_BIN_PROGS=src/htools
483 # Haskell programs to be installed in the MYEXECLIB dir
485 HS_MYEXECLIB_PROGS=src/mon-collector
490 # Haskell programs to be compiled by "make really-all"
496 # All Haskell non-test programs to be compiled but not automatically installed
497 HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
499 HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
500 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
505 test/hs/hpc-mon-collector \
509 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
510 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
513 -O -Wall -Werror -isrc \
514 -fwarn-monomorphism-restriction \
516 $(GHC_BYVERSION_FLAGS)
518 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
520 # internal extra flags (used for test/hs/htest mainly)
522 # exclude options for coverage reports
523 HPCEXCL = --exclude Main \
524 --exclude Ganeti.Constants \
525 --exclude Ganeti.HTools.QC \
526 --exclude Ganeti.THH \
527 --exclude Ganeti.Version \
528 --exclude Test.Ganeti.Attoparsec \
529 --exclude Test.Ganeti.TestCommon \
530 --exclude Test.Ganeti.TestHTools \
531 --exclude Test.Ganeti.TestHelper \
532 --exclude Test.Ganeti.TestImports \
533 $(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
536 src/Ganeti/Block/Diskstats/Parser.hs \
537 src/Ganeti/Block/Diskstats/Types.hs \
538 src/Ganeti/Block/Drbd/Parser.hs \
539 src/Ganeti/Block/Drbd/Types.hs \
540 src/Ganeti/BasicTypes.hs \
541 src/Ganeti/Common.hs \
542 src/Ganeti/Compat.hs \
543 src/Ganeti/Confd/Client.hs \
544 src/Ganeti/Confd/Server.hs \
545 src/Ganeti/Confd/Types.hs \
546 src/Ganeti/Confd/Utils.hs \
547 src/Ganeti/Config.hs \
548 src/Ganeti/Curl/Multi.hs \
549 src/Ganeti/Daemon.hs \
550 src/Ganeti/DataCollectors/CLI.hs \
551 src/Ganeti/DataCollectors/Diskstats.hs \
552 src/Ganeti/DataCollectors/Drbd.hs \
553 src/Ganeti/DataCollectors/InstStatus.hs \
554 src/Ganeti/DataCollectors/InstStatusTypes.hs \
555 src/Ganeti/DataCollectors/Program.hs \
556 src/Ganeti/DataCollectors/Types.hs \
557 src/Ganeti/Errors.hs \
558 src/Ganeti/HTools/Backend/IAlloc.hs \
559 src/Ganeti/HTools/Backend/Luxi.hs \
560 src/Ganeti/HTools/Backend/Rapi.hs \
561 src/Ganeti/HTools/Backend/Simu.hs \
562 src/Ganeti/HTools/Backend/Text.hs \
563 src/Ganeti/HTools/CLI.hs \
564 src/Ganeti/HTools/Cluster.hs \
565 src/Ganeti/HTools/Container.hs \
566 src/Ganeti/HTools/ExtLoader.hs \
567 src/Ganeti/HTools/Graph.hs \
568 src/Ganeti/HTools/Group.hs \
569 src/Ganeti/HTools/Instance.hs \
570 src/Ganeti/HTools/Loader.hs \
571 src/Ganeti/HTools/Nic.hs \
572 src/Ganeti/HTools/Node.hs \
573 src/Ganeti/HTools/PeerMap.hs \
574 src/Ganeti/HTools/Program/Hail.hs \
575 src/Ganeti/HTools/Program/Harep.hs \
576 src/Ganeti/HTools/Program/Hbal.hs \
577 src/Ganeti/HTools/Program/Hcheck.hs \
578 src/Ganeti/HTools/Program/Hinfo.hs \
579 src/Ganeti/HTools/Program/Hscan.hs \
580 src/Ganeti/HTools/Program/Hspace.hs \
581 src/Ganeti/HTools/Program/Hroller.hs \
582 src/Ganeti/HTools/Program/Main.hs \
583 src/Ganeti/HTools/Types.hs \
584 src/Ganeti/Hypervisor/Xen.hs \
585 src/Ganeti/Hypervisor/Xen/XmParser.hs \
586 src/Ganeti/Hypervisor/Xen/Types.hs \
588 src/Ganeti/JQueue.hs \
591 src/Ganeti/Logging.hs \
593 src/Ganeti/Monitoring/Server.hs \
594 src/Ganeti/Network.hs \
595 src/Ganeti/Objects.hs \
596 src/Ganeti/OpCodes.hs \
597 src/Ganeti/OpParams.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 \
614 src/Ganeti/Types.hs \
618 test/hs/Test/Ganeti/Attoparsec.hs \
619 test/hs/Test/Ganeti/BasicTypes.hs \
620 test/hs/Test/Ganeti/Block/Diskstats/Parser.hs \
621 test/hs/Test/Ganeti/Block/Drbd/Parser.hs \
622 test/hs/Test/Ganeti/Block/Drbd/Types.hs \
623 test/hs/Test/Ganeti/Common.hs \
624 test/hs/Test/Ganeti/Confd/Types.hs \
625 test/hs/Test/Ganeti/Confd/Utils.hs \
626 test/hs/Test/Ganeti/Daemon.hs \
627 test/hs/Test/Ganeti/Errors.hs \
628 test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
629 test/hs/Test/Ganeti/HTools/Backend/Text.hs \
630 test/hs/Test/Ganeti/HTools/CLI.hs \
631 test/hs/Test/Ganeti/HTools/Cluster.hs \
632 test/hs/Test/Ganeti/HTools/Container.hs \
633 test/hs/Test/Ganeti/HTools/Graph.hs \
634 test/hs/Test/Ganeti/HTools/Instance.hs \
635 test/hs/Test/Ganeti/HTools/Loader.hs \
636 test/hs/Test/Ganeti/HTools/Node.hs \
637 test/hs/Test/Ganeti/HTools/PeerMap.hs \
638 test/hs/Test/Ganeti/HTools/Types.hs \
639 test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
640 test/hs/Test/Ganeti/JSON.hs \
641 test/hs/Test/Ganeti/Jobs.hs \
642 test/hs/Test/Ganeti/JQueue.hs \
643 test/hs/Test/Ganeti/Luxi.hs \
644 test/hs/Test/Ganeti/Network.hs \
645 test/hs/Test/Ganeti/Objects.hs \
646 test/hs/Test/Ganeti/OpCodes.hs \
647 test/hs/Test/Ganeti/Query/Filter.hs \
648 test/hs/Test/Ganeti/Query/Language.hs \
649 test/hs/Test/Ganeti/Query/Network.hs \
650 test/hs/Test/Ganeti/Query/Query.hs \
651 test/hs/Test/Ganeti/Rpc.hs \
652 test/hs/Test/Ganeti/Runtime.hs \
653 test/hs/Test/Ganeti/Ssconf.hs \
654 test/hs/Test/Ganeti/THH.hs \
655 test/hs/Test/Ganeti/TestCommon.hs \
656 test/hs/Test/Ganeti/TestHTools.hs \
657 test/hs/Test/Ganeti/TestHelper.hs \
658 test/hs/Test/Ganeti/Types.hs \
659 test/hs/Test/Ganeti/Utils.hs
661 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
664 test/hs/Test/Ganeti/TestImports.hs \
665 src/Ganeti/Constants.hs \
666 src/Ganeti/Curl/Internal.hs \
667 src/Ganeti/Version.hs
669 $(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
670 src/Ganeti/Curl/Internal.hsc
672 HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
674 $(RUN_IN_TEMPDIR): | stamp-directories
676 doc/html/index.html: ENABLE_MANPAGES =
677 doc/man-html/index.html: ENABLE_MANPAGES = 1
678 doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
680 # Note: we use here an order-only prerequisite, as the contents of
681 # _autoconf.py are not actually influencing the html build output: it
682 # has to exist in order for the sphinx module to be loaded
683 # successfully, but we certainly don't want the docs to be rebuilt if
685 doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
686 configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
687 lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
688 doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
689 | $(BUILT_PYTHON_SOURCES)
690 @test -n "$(SPHINX)" || \
691 { echo 'sphinx-build' not found during configure; exit 1; }
693 if test -n '$(ENABLE_MANPAGES)'; then \
694 echo 'Man pages in documentation were disabled at configure time' >&2; \
698 ## Sphinx provides little control over what content should be included. Some
699 ## mechanisms exist, but they all have drawbacks or actual issues. Since we
700 ## build two different versions of the documentation--once without man pages and
701 ## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
702 ## us with this, but requires running in a temporary directory. It moves the
703 ## correct files into place depending on environment variables.
706 PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
707 $(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
709 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
710 -D release="$(PACKAGE_VERSION)" \
711 -D graphviz_dot="$(DOT)" \
712 -D enable_manpages="$(ENABLE_MANPAGES)" \
713 doc $(CURDIR)/$$dir && \
714 rm -f $$dir/.buildinfo $$dir/objects.inv
717 doc/html: doc/html/index.html
719 doc/man-html: doc/man-html/index.html
721 doc/install-quick.rst: INSTALL
723 doc/upgrade.rst: UPGRADE
725 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
727 { echo '.. This file is automatically updated at build time from $<.'; \
728 echo '.. Do not edit.'; \
733 doc/manpages-enabled.rst: Makefile | $(built_base_sources)
734 { echo '.. This file is automatically generated, do not edit!'; \
739 echo '.. toctree::'; \
740 echo ' :maxdepth: 1'; \
742 for i in $(notdir $(mandocrst)); do \
744 done | LC_ALL=C sort; \
747 doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
749 { echo '.. This file is automatically updated at build time from $<.'; \
750 echo '.. Do not edit.'; \
753 echo '=========================================='; \
754 tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
757 echo 'Man pages in documentation were disabled at configure time' >&2; \
761 # Things to build but not to install (add it to EXTRA_DIST if it should be
766 doc/examples/bash_completion \
767 doc/examples/bash_completion-debug \
771 noinst_DATA += doc/man-html
776 scripts/gnt-cluster \
779 scripts/gnt-instance \
781 scripts/gnt-network \
786 PYTHON_BOOTSTRAP_SBIN = \
787 daemons/ganeti-masterd \
788 daemons/ganeti-noded \
789 daemons/ganeti-rapi \
790 daemons/ganeti-watcher \
794 $(PYTHON_BOOTSTRAP_SBIN) \
798 tools/node-daemon-setup \
799 tools/prepare-node-join
811 qa/qa_instance_utils.py \
813 qa/qa_monitoring.py \
822 bin_SCRIPTS += $(HS_BIN_PROGS)
824 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
825 # FIXME: this is a hardcoded logic, instead of auto-resolving
826 $(LN_S) -f ../../../bin/htools \
827 $(DESTDIR)$(iallocatorsdir)/hail
828 for role in $(HS_BIN_ROLES); do \
829 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
833 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) Makefile
834 @if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
835 echo "Error: cannot run unittests without the development" \
836 " libraries (see devnotes.rst)" 1>&2; \
839 @rm -f $(notdir $@).tix
842 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
843 -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
844 $(HEXTRA) $(HEXTRA_INT) $@
847 # for the test/hs/htest binary, we need to enable profiling/coverage
848 test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
850 # we compile the hpc-htools binary with the program coverage
851 test/hs/hpc-htools: HEXTRA_INT=-fhpc
853 # we compile the hpc-mon-collector binary with the program coverage
854 test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
857 test/hs/offline-tests.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
859 # rules for building profiling-enabled versions of the haskell
860 # programs: hs-prof does the full two-step build, whereas
861 # hs-prof-quick does only the final rebuild (hs-prof must have been
863 .PHONY: hs-prof hs-prof-quick
865 @if [ -z "$(TARGET)" ]; then \
866 echo "You need to define TARGET when running this rule" 1>&2; \
869 $(MAKE) $(AM_MAKEFLAGS) clean
870 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf o"
871 rm -f $(HS_ALL_PROGS)
872 $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
875 @if [ -z "$(TARGET)" ]; then \
876 echo "You need to define TARGET when running this rule" 1>&2; \
879 $(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf prof_o -prof -auto-all"
881 dist_sbin_SCRIPTS = \
882 tools/ganeti-listrunner
884 nodist_sbin_SCRIPTS = \
885 $(PYTHON_BOOTSTRAP_SBIN) \
886 daemons/ganeti-cleaner
889 src/ganeti-confd: src/hconfd
892 nodist_sbin_SCRIPTS += src/ganeti-confd
896 nodist_sbin_SCRIPTS += src/ganeti-mond
903 tools/cluster-merge \
907 tools/move-instance \
909 tools/sanitize-config
911 dist_tools_SCRIPTS = \
914 tools/kvm-console-wrapper \
915 tools/master-ip-setup \
916 tools/xen-console-wrapper
918 nodist_tools_python_scripts = \
921 nodist_tools_SCRIPTS = \
922 $(nodist_tools_python_scripts) \
926 pkglib_python_scripts = \
927 daemons/import-export \
928 tools/check-cert-expired
930 nodist_pkglib_python_scripts = \
932 tools/node-daemon-setup \
933 tools/prepare-node-join
935 myexeclib_SCRIPTS = \
936 daemons/daemon-util \
938 $(pkglib_python_scripts) \
939 $(HS_MYEXECLIB_PROGS)
941 nodist_myexeclib_SCRIPTS = \
942 $(nodist_pkglib_python_scripts)
949 autotools/build-bash-completion \
950 autotools/build-rpc \
951 autotools/check-header \
952 autotools/check-imports \
953 autotools/check-man-dashes \
954 autotools/check-man-references \
955 autotools/check-man-warnings \
956 autotools/check-news \
957 autotools/check-python-code \
958 autotools/check-tar \
959 autotools/check-version \
960 autotools/convert-constants \
962 autotools/gen-py-coverage \
963 autotools/sphinx-wrapper \
964 autotools/testrunner \
965 autotools/wrong-hardcoded-paths \
967 daemons/daemon-util.in \
968 daemons/ganeti-cleaner.in \
969 $(pkglib_python_scripts) \
973 tools/users-setup.in \
974 tools/vcluster-setup.in \
977 $(BUILT_EXAMPLES:%=%.in) \
978 doc/examples/ganeti.default \
979 doc/examples/ganeti.default-debug \
980 doc/examples/hooks/ethers \
981 doc/examples/gnt-debug/README \
982 doc/examples/gnt-debug/delay0.json \
983 doc/examples/gnt-debug/delay50.json \
984 test/py/lockperf.py \
985 test/py/testutils.py \
994 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
997 test/hs/cli-tests-defs.sh \
998 test/hs/offline-test.sh \
1002 man/ganeti-cleaner.8 \
1003 man/ganeti-confd.8 \
1004 man/ganeti-listrunner.8 \
1005 man/ganeti-masterd.8 \
1007 man/ganeti-noded.8 \
1008 man/ganeti-os-interface.7 \
1009 man/ganeti-extstorage-interface.7 \
1011 man/ganeti-watcher.8 \
1018 man/gnt-instance.8 \
1034 # Remove extensions from all filenames in man_MANS
1035 mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1037 manrst = $(patsubst %,%.rst,$(mannoext))
1038 manhtml = $(patsubst %.rst,%.html,$(manrst))
1039 mangen = $(patsubst %.rst,%.gen,$(manrst))
1041 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1042 $(patsubst %.html,%.html.in,$(manhtml)) \
1046 test/data/htools/clean-nonzero-score.data \
1047 test/data/htools/common-suffix.data \
1048 test/data/htools/empty-cluster.data \
1049 test/data/htools/hail-alloc-drbd.json \
1050 test/data/htools/hail-alloc-invalid-network.json \
1051 test/data/htools/hail-alloc-invalid-twodisks.json \
1052 test/data/htools/hail-alloc-restricted-network.json \
1053 test/data/htools/hail-alloc-spindles.json \
1054 test/data/htools/hail-alloc-twodisks.json \
1055 test/data/htools/hail-change-group.json \
1056 test/data/htools/hail-invalid-reloc.json \
1057 test/data/htools/hail-node-evac.json \
1058 test/data/htools/hail-reloc-drbd.json \
1059 test/data/htools/hbal-excl-tags.data \
1060 test/data/htools/hbal-split-insts.data \
1061 test/data/htools/hspace-tiered-dualspec-exclusive.data \
1062 test/data/htools/hspace-tiered-dualspec.data \
1063 test/data/htools/hspace-tiered-exclusive.data \
1064 test/data/htools/hspace-tiered-mixed.data \
1065 test/data/htools/hspace-tiered.data \
1066 test/data/htools/invalid-node.data \
1067 test/data/htools/missing-resources.data \
1068 test/data/htools/multiple-master.data \
1069 test/data/htools/multiple-tags.data \
1070 test/data/htools/n1-failure.data \
1071 test/data/htools/rapi/groups.json \
1072 test/data/htools/rapi/info.json \
1073 test/data/htools/rapi/instances.json \
1074 test/data/htools/rapi/nodes.json \
1075 test/data/htools/hroller-nodegroups.data \
1076 test/data/htools/hroller-nonredundant.data \
1077 test/data/htools/hroller-online.data \
1078 test/data/htools/unique-reboot-order.data \
1079 test/hs/shelltests/htools-balancing.test \
1080 test/hs/shelltests/htools-basic.test \
1081 test/hs/shelltests/htools-dynutil.test \
1082 test/hs/shelltests/htools-excl.test \
1083 test/hs/shelltests/htools-hail.test \
1084 test/hs/shelltests/htools-hroller.test \
1085 test/hs/shelltests/htools-hspace.test \
1086 test/hs/shelltests/htools-invalid.test \
1087 test/hs/shelltests/htools-multi-group.test \
1088 test/hs/shelltests/htools-no-backend.test \
1089 test/hs/shelltests/htools-rapi.test \
1090 test/hs/shelltests/htools-single-group.test \
1091 test/hs/shelltests/htools-text-backend.test \
1092 test/hs/shelltests/htools-mon-collector.test \
1093 test/data/bdev-drbd-8.0.txt \
1094 test/data/bdev-drbd-8.3.txt \
1095 test/data/bdev-drbd-8.4.txt \
1096 test/data/bdev-drbd-disk.txt \
1097 test/data/bdev-drbd-net-ip4.txt \
1098 test/data/bdev-drbd-net-ip6.txt \
1099 test/data/bdev-rbd/json_output_empty.txt \
1100 test/data/bdev-rbd/json_output_extra_matches.txt \
1101 test/data/bdev-rbd/json_output_no_matches.txt \
1102 test/data/bdev-rbd/json_output_ok.txt \
1103 test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1104 test/data/bdev-rbd/plain_output_new_no_matches.txt \
1105 test/data/bdev-rbd/plain_output_new_ok.txt \
1106 test/data/bdev-rbd/plain_output_old_empty.txt \
1107 test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1108 test/data/bdev-rbd/plain_output_old_no_matches.txt \
1109 test/data/bdev-rbd/plain_output_old_ok.txt \
1110 test/data/bdev-rbd/output_invalid.txt \
1111 test/data/cert1.pem \
1112 test/data/cert2.pem \
1113 test/data/cluster_config_2.7.json \
1114 test/data/cluster_config_2.8.json \
1115 test/data/instance-minor-pairing.txt \
1116 test/data/ip-addr-show-dummy0.txt \
1117 test/data/ip-addr-show-lo-ipv4.txt \
1118 test/data/ip-addr-show-lo-ipv6.txt \
1119 test/data/ip-addr-show-lo-oneline-ipv4.txt \
1120 test/data/ip-addr-show-lo-oneline-ipv6.txt \
1121 test/data/ip-addr-show-lo-oneline.txt \
1122 test/data/ip-addr-show-lo.txt \
1123 test/data/kvm_0.12.5_help.txt \
1124 test/data/kvm_0.15.90_help.txt \
1125 test/data/kvm_0.9.1_help.txt \
1126 test/data/kvm_0.9.1_help_boot_test.txt \
1127 test/data/kvm_1.0_help.txt \
1128 test/data/kvm_1.1.2_help.txt \
1129 test/data/ovfdata/compr_disk.vmdk.gz \
1130 test/data/ovfdata/config.ini \
1131 test/data/ovfdata/corrupted_resources.ovf \
1132 test/data/ovfdata/empty.ini \
1133 test/data/ovfdata/empty.ovf \
1134 test/data/ovfdata/ganeti.mf \
1135 test/data/ovfdata/ganeti.ovf \
1136 test/data/ovfdata/gzip_disk.ovf \
1137 test/data/ovfdata/new_disk.vmdk \
1138 test/data/ovfdata/no_disk.ini \
1139 test/data/ovfdata/no_disk_in_ref.ovf \
1140 test/data/ovfdata/no_os.ini \
1141 test/data/ovfdata/no_ovf.ova \
1142 test/data/ovfdata/other/rawdisk.raw \
1143 test/data/ovfdata/ova.ova \
1144 test/data/ovfdata/rawdisk.raw \
1145 test/data/ovfdata/second_disk.vmdk \
1146 test/data/ovfdata/unsafe_path.ini \
1147 test/data/ovfdata/virtualbox.ovf \
1148 test/data/ovfdata/wrong_config.ini \
1149 test/data/ovfdata/wrong_extension.ovd \
1150 test/data/ovfdata/wrong_manifest.mf \
1151 test/data/ovfdata/wrong_manifest.ovf \
1152 test/data/ovfdata/wrong_ova.ova \
1153 test/data/ovfdata/wrong_xml.ovf \
1154 test/data/proc_diskstats.txt \
1155 test/data/proc_drbd8.txt \
1156 test/data/proc_drbd80-emptyline.txt \
1157 test/data/proc_drbd80-emptyversion.txt \
1158 test/data/proc_drbd83.txt \
1159 test/data/proc_drbd83_sync.txt \
1160 test/data/proc_drbd83_sync_want.txt \
1161 test/data/proc_drbd83_sync_krnl2.6.39.txt \
1162 test/data/proc_drbd84.txt \
1163 test/data/proc_drbd84_sync.txt \
1164 test/data/qa-minimal-nodes-instances-only.json \
1165 test/data/sys_drbd_usermode_helper.txt \
1166 test/data/vgreduce-removemissing-2.02.02.txt \
1167 test/data/vgreduce-removemissing-2.02.66-fail.txt \
1168 test/data/vgreduce-removemissing-2.02.66-ok.txt \
1169 test/data/vgs-missing-pvs-2.02.02.txt \
1170 test/data/vgs-missing-pvs-2.02.66.txt \
1171 test/data/xen-xm-info-4.0.1.txt \
1172 test/data/xen-xm-list-4.0.1-dom0-only.txt \
1173 test/data/xen-xm-list-4.0.1-four-instances.txt \
1174 test/data/xen-xm-list-long-4.0.1.txt \
1175 test/data/xen-xm-uptime-4.0.1.txt \
1176 test/py/ganeti-cli.test \
1177 test/py/gnt-cli.test \
1178 test/py/import-export_unittest-helper
1181 doc/examples/rapi_testutils.py \
1182 test/py/cfgupgrade_unittest.py \
1183 test/py/docs_unittest.py \
1184 test/py/ganeti.asyncnotifier_unittest.py \
1185 test/py/ganeti.backend_unittest-runasroot.py \
1186 test/py/ganeti.backend_unittest.py \
1187 test/py/ganeti.cli_unittest.py \
1188 test/py/ganeti.client.gnt_cluster_unittest.py \
1189 test/py/ganeti.client.gnt_instance_unittest.py \
1190 test/py/ganeti.client.gnt_job_unittest.py \
1191 test/py/ganeti.cmdlib_unittest.py \
1192 test/py/ganeti.compat_unittest.py \
1193 test/py/ganeti.confd.client_unittest.py \
1194 test/py/ganeti.config_unittest.py \
1195 test/py/ganeti.constants_unittest.py \
1196 test/py/ganeti.daemon_unittest.py \
1197 test/py/ganeti.errors_unittest.py \
1198 test/py/ganeti.hooks_unittest.py \
1199 test/py/ganeti.ht_unittest.py \
1200 test/py/ganeti.http_unittest.py \
1201 test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1202 test/py/ganeti.hypervisor.hv_fake_unittest.py \
1203 test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1204 test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1205 test/py/ganeti.hypervisor.hv_xen_unittest.py \
1206 test/py/ganeti.hypervisor_unittest.py \
1207 test/py/ganeti.impexpd_unittest.py \
1208 test/py/ganeti.jqueue_unittest.py \
1209 test/py/ganeti.jstore_unittest.py \
1210 test/py/ganeti.locking_unittest.py \
1211 test/py/ganeti.luxi_unittest.py \
1212 test/py/ganeti.masterd.iallocator_unittest.py \
1213 test/py/ganeti.masterd.instance_unittest.py \
1214 test/py/ganeti.mcpu_unittest.py \
1215 test/py/ganeti.netutils_unittest.py \
1216 test/py/ganeti.objects_unittest.py \
1217 test/py/ganeti.opcodes_unittest.py \
1218 test/py/ganeti.outils_unittest.py \
1219 test/py/ganeti.ovf_unittest.py \
1220 test/py/ganeti.qlang_unittest.py \
1221 test/py/ganeti.query_unittest.py \
1222 test/py/ganeti.rapi.baserlib_unittest.py \
1223 test/py/ganeti.rapi.client_unittest.py \
1224 test/py/ganeti.rapi.resources_unittest.py \
1225 test/py/ganeti.rapi.rlib2_unittest.py \
1226 test/py/ganeti.rapi.testutils_unittest.py \
1227 test/py/ganeti.rpc_unittest.py \
1228 test/py/ganeti.runtime_unittest.py \
1229 test/py/ganeti.serializer_unittest.py \
1230 test/py/ganeti.server.rapi_unittest.py \
1231 test/py/ganeti.ssconf_unittest.py \
1232 test/py/ganeti.ssh_unittest.py \
1233 test/py/ganeti.storage.bdev_unittest.py \
1234 test/py/ganeti.storage.container_unittest.py \
1235 test/py/ganeti.storage.drbd_unittest.py \
1236 test/py/ganeti.storage.filestorage_unittest.py \
1237 test/py/ganeti.tools.burnin_unittest.py \
1238 test/py/ganeti.tools.ensure_dirs_unittest.py \
1239 test/py/ganeti.tools.node_daemon_setup_unittest.py \
1240 test/py/ganeti.tools.prepare_node_join_unittest.py \
1241 test/py/ganeti.uidpool_unittest.py \
1242 test/py/ganeti.utils.algo_unittest.py \
1243 test/py/ganeti.utils.filelock_unittest.py \
1244 test/py/ganeti.utils.hash_unittest.py \
1245 test/py/ganeti.utils.io_unittest-runasroot.py \
1246 test/py/ganeti.utils.io_unittest.py \
1247 test/py/ganeti.utils.log_unittest.py \
1248 test/py/ganeti.utils.lvm_unittest.py \
1249 test/py/ganeti.utils.mlock_unittest.py \
1250 test/py/ganeti.utils.nodesetup_unittest.py \
1251 test/py/ganeti.utils.process_unittest.py \
1252 test/py/ganeti.utils.retry_unittest.py \
1253 test/py/ganeti.utils.text_unittest.py \
1254 test/py/ganeti.utils.wrapper_unittest.py \
1255 test/py/ganeti.utils.x509_unittest.py \
1256 test/py/ganeti.utils_unittest.py \
1257 test/py/ganeti.vcluster_unittest.py \
1258 test/py/ganeti.workerpool_unittest.py \
1259 test/py/pycurl_reset_unittest.py \
1260 test/py/qa.qa_config_unittest.py \
1261 test/py/tempfile_fork_unittest.py
1263 haskell_tests = test/hs/htest
1266 test/py/check-cert-expired_unittest.bash \
1267 test/py/daemon-util_unittest.bash \
1268 test/py/ganeti-cleaner_unittest.bash \
1269 test/py/import-export_unittest.bash \
1270 test/py/cli-test.bash \
1271 test/py/bash_completion.bash \
1278 nodist_TESTS += $(haskell_tests)
1279 dist_TESTS += test/hs/offline-test.sh
1281 test/hs/hpc-htools \
1282 test/hs/hpc-mon-collector \
1283 $(HS_BUILT_TEST_HELPERS)
1286 TESTS = $(dist_TESTS) $(nodist_TESTS)
1288 # Environment for all tests
1289 PLAIN_TESTS_ENVIRONMENT = \
1291 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1292 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1295 # Environment for tests run by automake
1296 TESTS_ENVIRONMENT = \
1297 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1300 $(dist_sbin_SCRIPTS) \
1302 $(pkglib_python_scripts) \
1303 $(nodist_pkglib_python_scripts) \
1304 $(nodist_tools_python_scripts) \
1306 $(pkgpython_PYTHON) \
1309 $(hypervisor_PYTHON) \
1325 test/py/check-cert-expired_unittest.bash \
1326 test/py/daemon-util_unittest.bash \
1327 test/py/ganeti-cleaner_unittest.bash \
1328 test/py/import-export_unittest.bash \
1329 test/py/cli-test.bash \
1330 test/py/bash_completion.bash \
1331 test/hs/offline-test.sh \
1332 test/hs/cli-tests-defs.sh \
1333 $(all_python_code) \
1334 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1337 check_python_code = \
1338 $(BUILD_BASH_COMPLETION) \
1344 lint_python_code = \
1346 ganeti/http/server.py \
1347 $(dist_sbin_SCRIPTS) \
1349 $(pkglib_python_scripts) \
1350 $(BUILD_BASH_COMPLETION) \
1356 standalone_python_modules = \
1357 lib/rapi/client.py \
1358 tools/ganeti-listrunner
1360 pep8_python_code = \
1362 ganeti/http/server.py \
1363 $(dist_sbin_SCRIPTS) \
1365 $(pkglib_python_scripts) \
1366 $(BUILD_BASH_COMPLETION) \
1369 $(PYTHON_BOOTSTRAP) \
1372 test/py/daemon-util_unittest.bash: daemons/daemon-util
1374 test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1376 test/py/bash_completion.bash: doc/examples/bash_completion-debug
1378 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1379 sed -f $(REPLACE_VARS_SED) < $< > $@
1382 tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
1383 sed -f $(REPLACE_VARS_SED) < $< > $@
1386 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1387 sed -f $(REPLACE_VARS_SED) < $< > $@
1390 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1391 sed -f $(REPLACE_VARS_SED) < $< > $@
1394 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1395 sed -f $(REPLACE_VARS_SED) < $< > $@
1397 doc/examples/bash_completion: BC_ARGS = --compact
1398 doc/examples/bash_completion-debug: BC_ARGS =
1400 doc/examples/bash_completion doc/examples/bash_completion-debug: \
1401 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1402 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1403 daemons/ganeti-cleaner \
1404 $(GENERATED_FILES) $(HS_GENERATED_FILES)
1405 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1406 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1408 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1409 lib/build/shell_example_lexer.py \
1410 | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1411 @echo "Checking $< for hardcoded paths..."
1412 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1413 echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1417 trap 'echo auto-removing $@; rm $@' EXIT; \
1418 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1419 $(CHECK_MAN_REFERENCES) $@; \
1422 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1423 @test -n "$(PANDOC)" || \
1424 { echo 'pandoc' not found during configure; exit 1; }
1425 set -o pipefail -e; \
1426 trap 'echo auto-removing $@; rm $@' EXIT; \
1427 $(PANDOC) -s -f rst -t man $< man/footer.rst | \
1428 sed -e 's/\\@/@/g' > $@; \
1429 if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1430 $(CHECK_MAN_DASHES) $@; \
1433 man/%.html.in: man/%.gen man/footer.rst
1434 @test -n "$(PANDOC)" || \
1435 { echo 'pandoc' not found during configure; exit 1; }
1437 $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1438 sed -e 's/\\@/@/g' > $@
1440 man/%: man/%.in $(REPLACE_VARS_SED)
1441 sed -f $(REPLACE_VARS_SED) < $< > $@
1443 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1444 sed -f $(REPLACE_VARS_SED) < $< > $@
1447 if test -d .git; then \
1448 git describe > $@; \
1449 elif test ! -f $@ ; then \
1450 echo "Cannot auto-generate $@ file"; exit 1; \
1453 .PHONY: clean-vcs-version
1457 .PHONY: regen-vcs-version
1461 if test -d .git; then \
1462 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1463 git describe > $$T; \
1464 if ! cmp --quiet $$T vcs-version; then \
1465 mv $$T vcs-version; \
1469 src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1470 vcs-version $(built_base_sources)
1472 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1473 sed -e "s/%ver%/$$VCSVER/" < $< > $@
1475 src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
1476 lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
1477 lib/jstore.py $(RUN_IN_TEMPDIR) \
1478 $(CONVERT_CONSTANTS) $(built_base_sources) \
1479 | lib/_vcsversion.py
1482 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
1485 src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
1488 test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1489 $(built_base_sources)
1493 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1494 echo "import $$name ()" ; \
1498 lib/_autoconf.py: Makefile | stamp-directories
1500 { echo '# This file is automatically generated, do not edit!'; \
1503 echo '"""Build-time configuration for Ganeti.'; \
1505 echo 'This file is autogenerated by the build process.'; \
1506 echo 'For any changes you need to re-run ./configure (and'; \
1507 echo 'not edit by hand).'; \
1511 echo '# pylint: disable=C0301,C0324'; \
1512 echo '# because this is autogenerated, we do not want'; \
1513 echo '# style warnings' ; \
1515 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1516 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1517 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1518 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1519 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1520 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1521 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1522 echo "SYSCONFDIR = '$(sysconfdir)'"; \
1523 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1524 echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1525 echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1526 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1527 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1528 echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
1529 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1530 echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
1531 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1532 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1533 echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1534 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1535 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1536 echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1537 echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1538 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1539 echo "KVM_PATH = '$(KVM_PATH)'"; \
1540 echo "IP_PATH = '$(IP_PATH)'"; \
1541 echo "SOCAT_PATH = '$(SOCAT)'"; \
1542 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1543 echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1544 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1545 echo "TOOLSDIR = '$(toolsdir)'"; \
1546 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1547 echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1548 echo "PKGLIBDIR = '$(pkglibdir)'"; \
1549 echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1550 echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1551 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1552 echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1553 echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1554 echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1555 echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1556 echo "RAPI_USER = '$(RAPI_USER)'"; \
1557 echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1558 echo "CONFD_USER = '$(CONFD_USER)'"; \
1559 echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1560 echo "NODED_USER = '$(NODED_USER)'"; \
1561 echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1562 echo "MOND_USER = '$(MOND_USER)'"; \
1563 echo "MOND_GROUP = '$(MOND_GROUP)'"; \
1564 echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1565 echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1566 echo "HTOOLS = True"; \
1567 echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1568 echo "XEN_CMD = '$(XEN_CMD)'"; \
1569 echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1570 echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1571 echo "ENABLE_MOND = $(ENABLE_MOND)"; \
1572 ## Write dictionary with man page name as the key and the section number as the
1574 echo "MAN_PAGES = {"; \
1575 for i in $(notdir $(man_MANS)); do \
1576 echo "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/ "\1": \2,/g'; \
1581 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1583 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1584 { echo '# This file is automatically generated, do not edit!'; \
1587 echo '"""Build-time VCS version number for Ganeti.'; \
1589 echo 'This file is autogenerated by the build process.'; \
1590 echo 'For any changes you need to re-run ./configure (and'; \
1591 echo 'not edit by hand).'; \
1595 echo '# pylint: disable=C0301,C0324'; \
1596 echo '# because this is autogenerated, we do not want'; \
1597 echo '# style warnings' ; \
1599 echo "VCS_VERSION = '$$VCSVER'"; \
1602 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1603 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1605 $(SHELL_ENV_INIT): Makefile stamp-directories
1607 { echo '# Allow overriding for tests'; \
1608 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1609 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1611 echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1612 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1613 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1614 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1615 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1618 ## Writes sed script to replace placeholders with build-time values. The
1619 ## additional quotes after the first @ sign are necessary to stop configure
1620 ## from replacing those values as well.
1621 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1623 { echo 's#@''PREFIX@#$(prefix)#g'; \
1624 echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1625 echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1626 echo 's#@''BINDIR@#$(bindir)#g'; \
1627 echo 's#@''SBINDIR@#$(sbindir)#g'; \
1628 echo 's#@''LIBDIR@#$(libdir)#g'; \
1629 echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1630 echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1631 echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1632 echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1633 echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1634 echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1635 echo 's#@''RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1636 echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1637 echo 's#@''PKGLIBDIR@#$(pkglibdir)#g'; \
1638 echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1639 echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1640 echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1641 echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1642 echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
1643 echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1644 echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1645 echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1646 echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1647 echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
1648 echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1649 echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1650 echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
1651 echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1652 echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1654 echo '/^@SHELL_ENV_INIT@$$/ {'; \
1655 echo ' r $(SHELL_ENV_INIT)'; \
1660 # Using deferred evaluation
1661 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1662 daemons/ganeti-watcher: MODULE = ganeti.watcher
1663 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1664 tools/burnin: MODULE = ganeti.tools.burnin
1665 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1666 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1667 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1668 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1669 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1671 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1672 test -n "$(MODULE)" || { echo Missing module; exit 1; }
1674 { echo '#!/usr/bin/python'; \
1675 echo '# This file is automatically generated, do not edit!'; \
1676 echo "# Edit $(MODULE) instead."; \
1678 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1680 echo '# pylint: disable=C0103'; \
1681 echo '# C0103: Invalid name'; \
1683 echo 'import sys'; \
1684 echo 'import $(MODULE) as main'; \
1686 echo '# Temporarily alias commands until bash completion'; \
1687 echo '# generator is changed'; \
1688 echo 'if hasattr(main, "commands"):'; \
1689 echo ' commands = main.commands # pylint: disable=E1101'; \
1690 echo 'if hasattr(main, "aliases"):'; \
1691 echo ' aliases = main.aliases # pylint: disable=E1101'; \
1693 echo 'if __name__ == "__main__":'; \
1694 echo ' sys.exit(main.Main())'; \
1698 $(HS_BUILT_TEST_HELPERS): Makefile
1699 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1701 { echo '#!/bin/sh'; \
1702 echo '# This file is automatically generated, do not edit!'; \
1703 echo "# Edit Makefile.am instead."; \
1705 echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
1709 stamp-directories: Makefile
1710 $(MAKE) $(AM_MAKEFLAGS) ganeti
1711 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1714 # We need to create symlinks because "make distcheck" will not install Python
1715 # files when building.
1716 stamp-srclinks: Makefile | stamp-directories
1718 for i in $(srclink_files); do \
1719 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1720 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1727 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1730 check-dirs: $(GENERATED_FILES)
1732 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1734 while read dir; do \
1736 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1737 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1740 for dir in $(DIRS); do \
1741 if ! test -d "$$dir"; then \
1742 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1746 test -z "$$error"; \
1750 check-local: check-dirs $(GENERATED_FILES)
1751 $(CHECK_PYTHON_CODE) $(check_python_code)
1752 PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1753 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1754 RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
1755 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1756 @expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1758 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1759 echo "Incorrect version in README, expected $$expver" >&2; \
1762 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1763 doc/security.rst; do \
1764 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1765 "Documents Ganeti version $$expver"; then \
1766 echo "Incorrect version in $$file, expected $$expver" >&2; \
1770 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1771 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
1774 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
1775 ".. Last updated for Ganeti $$expver"; then \
1776 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
1779 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1780 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1781 echo "Longest line in $$file is longer than 80 characters" >&2; \
1788 hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1793 hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
1794 @rm -f hpc-htools.tix hpc-mon-collector.tix
1795 HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
1798 hs-check: hs-tests hs-shell
1800 # E111: indentation is not a multiple of four
1801 # E121: continuation line indentation is not a multiple of four
1802 # (since our indent level is not 4)
1803 # E125: continuation line does not distinguish itself from next logical line
1804 # (since our indent level is not 4)
1805 # E127: continuation line over-indented for visual indent
1806 # (since our indent level is not 4)
1807 # note: do NOT add E128 here; it's a valid style error in most cases!
1808 # I've seen real errors, but also some cases were we indent wrongly
1809 # due to line length; try to rework the cases where it is triggered,
1810 # instead of silencing it
1811 # E261: at least two spaces before inline comment
1812 # E501: line too long (80 characters)
1813 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1815 # For excluding pep8 expects filenames only, not whole paths
1816 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1818 LINT_TARGETS = pylint pylint-qa
1820 LINT_TARGETS += pep8
1823 LINT_TARGETS += hlint
1827 lint: $(LINT_TARGETS)
1830 pylint: $(GENERATED_FILES)
1831 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1832 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1835 pylint-qa: $(GENERATED_FILES)
1836 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1837 cd $(top_srcdir)/qa && \
1838 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1839 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1842 pep8: $(GENERATED_FILES)
1843 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1844 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1845 --repeat $(pep8_python_code)
1847 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1848 HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
1850 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
1851 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1852 @rm -f doc/hs-lint.html
1853 if tty -s; then C="-c"; else C=""; fi; \
1854 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1855 --ignore "Use first" \
1856 --ignore "Use &&&" \
1857 --ignore "Use void" \
1858 --ignore "Reduce duplication" \
1859 --hint src/lint-hints \
1860 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1861 @if [ ! -f doc/hs-lint.html ]; then \
1862 echo "All good" > doc/hs-lint.html; \
1865 # a dist hook rule for updating the vcs-version file; this is
1866 # hardcoded due to where it needs to build the file...
1868 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1869 rm -f $(top_distdir)/vcs-version
1870 cp -p $(srcdir)/vcs-version $(top_distdir)
1872 # a distcheck hook rule for catching revision control directories
1874 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1875 echo "Found revision control files in final archive." 1>&2; \
1878 if find $(top_distdir) -name '*.py[co]' | grep .; then \
1879 echo "Found Python byte code in final archive." 1>&2; \
1882 if find $(top_distdir) -name '*~' | grep .; then \
1883 echo "Found backup files in final archive." 1>&2; \
1886 # Empty files or directories should not be distributed. They can cause
1887 # unnecessary warnings for packagers. Directories used by automake during
1888 # distcheck must be excluded.
1889 if find $(top_distdir) -empty -and -not \( \
1890 -path $(top_distdir)/_build -or \
1891 -path $(top_distdir)/_inst \) | grep .; then \
1892 echo "Found empty files or directories in final archive." 1>&2; \
1895 if test -e $(top_distdir)/doc/man-html; then \
1896 echo "Found documentation including man pages in final archive" >&2; \
1900 # Backwards compatible distcheck-release target
1901 distcheck-release: distcheck
1903 distrebuildcheck: dist
1905 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1906 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1908 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1911 $(MAKE) maintainer-clean; \
1912 cp $(abs_srcdir)/vcs-version .; \
1914 $(MAKE) $(AM_MAKEFLAGS)
1918 for i in $(DIST_ARCHIVES); do \
1919 echo -n "Checking $$i ... "; \
1920 autotools/check-tar < $$i; \
1925 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1926 "$(DESTDIR)${localstatedir}/log/ganeti" \
1927 "$(DESTDIR)${localstatedir}/run/ganeti"
1931 apidoc: py-apidoc hs-apidoc
1937 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1938 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
1939 $(RUN_IN_TEMPDIR) epydoc -v \
1940 --conf $(CURDIR)/epydoc.conf \
1941 --output $(CURDIR)/$(APIDOC_PY_DIR)
1944 hs-apidoc: $(APIDOC_HS_DIR)/index.html
1946 $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
1947 @test -n "$(HSCOLOUR)" || \
1948 { echo 'HsColour' not found during configure; exit 1; }
1949 @test -n "$(HADDOCK)" || \
1950 { echo 'haddock' not found during configure; exit 1; }
1951 rm -rf $(APIDOC_HS_DIR)/*
1952 for i in $(ALL_APIDOC_HS_DIRS); do \
1954 $(HSCOLOUR) -print-css > $$i/hscolour.css; \
1957 export LC_ALL=en_US.UTF-8; \
1958 OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
1959 if [ "$(HS_PARALLEL3)" ]; \
1960 then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
1962 if [ "$(HS_REGEX_PCRE)" ]; \
1963 then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
1965 for file in $(HS_LIBTESTBUILT_SRCS); do \
1966 f_nosrc=$${file##src/}; \
1967 f_notst=$${f_nosrc##test/hs/}; \
1968 f_html=$${f_notst%%.hs}.html; \
1969 $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
1971 $(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1972 -t ganeti -p src/haddock-prologue \
1973 --source-module="%{MODULE/.//}.html" \
1974 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1976 $(HS_LIBTESTBUILT_SRCS)
1979 TAGS: $(GENERATED_FILES)
1981 $(GHC) -e ":etags" -v0 \
1982 $(filter-out -O -Werror,$(HFLAGS)) \
1983 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
1985 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1986 -path './daemons/ganeti-*' -o -path './tools/*' -o \
1987 -path './qa/*.py' | \
1988 etags -l python -a -
1992 coverage: py-coverage hs-coverage
1994 coverage: py-coverage
1998 py-coverage: $(GENERATED_FILES) $(python_tests)
1999 @test -n "$(PYCOVERAGE)" || \
2000 { echo 'python-coverage' not found during configure; exit 1; }
2002 COVERAGE=$(PYCOVERAGE) \
2003 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2004 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2005 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2006 $(PLAIN_TESTS_ENVIRONMENT) \
2007 $(abs_top_srcdir)/autotools/gen-py-coverage \
2011 hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2013 $(MAKE) $(AM_MAKEFLAGS) hs-check
2014 @mkdir_p@ $(COVERAGE_HS_DIR)
2015 hpc sum --union $(HPCEXCL) \
2016 htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2017 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2018 hpc report coverage-hs.tix
2019 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2021 # Special "kind-of-QA" target for htools, needs special setup (all
2022 # tools compiled with -fhpc)
2027 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2028 rm -f *.tix *.mix; \
2030 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2031 --output=live-test.tix ; \
2032 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2033 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2034 --srcdir=.. $(HPCEXCL) ; \
2035 hpc report --srcdir=.. live-test $(HPCEXCL)
2037 commit-check: distcheck lint apidoc
2039 .PHONY: gitignore-check
2041 @if [ -n "`git status --short`" ]; then \
2042 echo "Git status is not clean!" 1>&2 ; \
2043 git status --short; \
2047 # target to rebuild all man pages (both groff and html output)
2049 man: $(man_MANS) $(manhtml)
2051 # Target that builds all binaries (including those that are not
2052 # rebuilt except when running the tests)
2054 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2056 # we don't need the ancient implicit rules:
2063 -include ./Makefile.local