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 # Enable colors in shelltest
26 ACLOCAL_AMFLAGS = -I autotools
27 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
28 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
29 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
30 CHECK_HEADER = $(top_srcdir)/autotools/check-header
31 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
32 CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
33 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
34 CHECK_VERSION = $(top_srcdir)/autotools/check-version
35 CHECK_NEWS = $(top_srcdir)/autotools/check-news
36 CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
37 DOCPP = $(top_srcdir)/autotools/docpp
38 REPLACE_VARS_SED = autotools/replace_vars.sed
39 PRINT_PY_CONSTANTS = $(top_srcdir)/autotools/print-py-constants
40 BUILD_RPC = $(top_srcdir)/autotools/build-rpc
41 SHELL_ENV_INIT = autotools/shell-env-init
43 # starting as of Ganeti 2.10, all files are stored in two directories,
44 # with only symbolic links added at other places.
46 # $(versiondir) contains most of Ganeti and all architecture-dependent files
47 # $(versionedsharedir) contains only architecture-independent files; all python
48 # executables need to go directly to $(versionedsharedir), as all ganeti python
49 # mdules are installed outside the usual python path, i.e., as private modules.
51 # $(defaultversiondir) and $(defaultversionedsharedir) are the corresponding
52 # directories for "the currently running" version of Ganeti. We never install
53 # there, but all symbolic links go there, rather than directory to $(versiondir)
54 # or $(versionedsharedir). Note that all links to $(default*dir) need to be stable;
55 # so, if some currently architecture-independent executable is replaced by an
56 # architecture-dependent one (and hence has to go under $(versiondir)), add a link
57 # under $(versionedsharedir) but do not change the external links.
59 DIRVERSION=$(VERSION_FULL)
61 DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
63 versiondir = $(libdir)/ganeti/$(DIRVERSION)
64 defaultversiondir = $(libdir)/ganeti/default
65 versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
66 defaultversionedsharedir = $(prefix)/share/ganeti/default
68 # Note: these are automake-specific variables, and must be named after
69 # the directory + 'dir' suffix
70 pkglibdir = $(versiondir)$(libdir)/ganeti
71 myexeclibdir = $(pkglibdir)
72 bindir = $(versiondir)/$(BINDIR)
73 sbindir = $(versiondir)$(SBINDIR)
74 mandir = $(versionedsharedir)/root$(MANDIR)
75 pkgpythondir = $(versionedsharedir)/ganeti
76 pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub
77 gntpythondir = $(versionedsharedir)
78 pkgpython_bindir = $(versionedsharedir)
79 gnt_python_sbindir = $(versionedsharedir)
80 tools_pythondir = $(versionedsharedir)
82 clientdir = $(pkgpythondir)/client
83 cmdlibdir = $(pkgpythondir)/cmdlib
84 hypervisordir = $(pkgpythondir)/hypervisor
85 hypervisor_hv_kvmdir = $(pkgpythondir)/hypervisor/hv_kvm
86 jqueuedir = $(pkgpythondir)/jqueue
87 storagedir = $(pkgpythondir)/storage
88 httpdir = $(pkgpythondir)/http
89 masterddir = $(pkgpythondir)/masterd
90 confddir = $(pkgpythondir)/confd
91 rapidir = $(pkgpythondir)/rapi
92 rpcdir = $(pkgpythondir)/rpc
93 rpc_stubdir = $(pkgpythondir)/rpc/stub
94 serverdir = $(pkgpythondir)/server
95 watcherdir = $(pkgpythondir)/watcher
96 impexpddir = $(pkgpythondir)/impexpd
97 utilsdir = $(pkgpythondir)/utils
98 toolsdir = $(pkglibdir)/tools
99 iallocatorsdir = $(pkglibdir)/iallocators
100 pytoolsdir = $(pkgpythondir)/tools
101 docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
102 ifupdir = $(sysconfdir)/ganeti
105 backup_dir = $(BACKUP_DIR)
107 backup_dir = $(localstatedir)/lib
110 SYMLINK_TARGET_DIRS = \
111 $(sysconfdir)/ganeti \
112 $(libdir)/ganeti/iallocators \
113 $(libdir)/ganeti/tools \
114 $(prefix)/share/ganeti \
121 # Delete output file if an error occurred while building it
130 src/Ganeti/DataCollectors \
134 src/Ganeti/HTools/Backend \
135 src/Ganeti/HTools/Program \
136 src/Ganeti/Hypervisor \
137 src/Ganeti/Hypervisor/Xen \
141 src/Ganeti/Monitoring \
147 src/Ganeti/Storage/Diskstats \
148 src/Ganeti/Storage/Drbd \
149 src/Ganeti/Storage/Lvm \
155 test/hs/Test/Ganeti \
156 test/hs/Test/Ganeti/Storage \
157 test/hs/Test/Ganeti/Storage/Diskstats \
158 test/hs/Test/Ganeti/Storage/Drbd \
159 test/hs/Test/Ganeti/Storage/Lvm \
160 test/hs/Test/Ganeti/Confd \
161 test/hs/Test/Ganeti/HTools \
162 test/hs/Test/Ganeti/HTools/Backend \
163 test/hs/Test/Ganeti/Hypervisor \
164 test/hs/Test/Ganeti/Hypervisor/Xen \
165 test/hs/Test/Ganeti/Locking \
166 test/hs/Test/Ganeti/Objects \
167 test/hs/Test/Ganeti/Query \
168 test/hs/Test/Ganeti/THH \
169 test/hs/Test/Ganeti/Utils \
170 test/hs/Test/Ganeti/WConfd
172 # Haskell directories without the roots (src, test/hs)
173 HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
184 doc/examples/gnt-debug \
186 doc/examples/systemd \
189 test/data/htools/rapi \
200 lib/hypervisor/hv_kvm \
218 test/data/ovfdata/other \
221 test/py/cmdlib/testsupport \
224 ALL_APIDOC_HS_DIRS = \
226 $(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
228 BUILDTIME_DIR_AUTOCREATE = \
231 $(ALL_APIDOC_HS_DIRS) \
239 $(BUILDTIME_DIR_AUTOCREATE) \
245 ganeti-[0-9]*.[0-9]*.[0-9]* \
252 COVERAGE_DIR = doc/coverage
253 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
254 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
256 APIDOC_PY_DIR = $(APIDOC_DIR)/py
257 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
259 MAINTAINERCLEANFILES = \
261 doc/install-quick.rst \
266 maintainer-clean-local:
267 rm -rf $(BUILDTIME_DIRS)
270 $(addsuffix /*.py[co],$(DIRS)) \
271 $(addsuffix /*.hi,$(HS_DIRS)) \
272 $(addsuffix /*.o,$(HS_DIRS)) \
273 $(addsuffix /*.$(HTEST_SUFFIX)_hi,$(HS_DIRS)) \
274 $(addsuffix /*.$(HTEST_SUFFIX)_o,$(HS_DIRS)) \
278 $(PYTHON_BOOTSTRAP) \
279 $(gnt_python_sbin_SCRIPTS) \
281 $(REPLACE_VARS_SED) \
283 daemons/daemon-util \
284 daemons/ganeti-cleaner \
285 devel/squeeze-amd64.tar.gz \
286 devel/squeeze-amd64.conf \
288 doc/manpages-enabled.rst \
290 doc/examples/bash_completion \
291 doc/examples/bash_completion-debug \
293 lib/_generated_rpc.py \
300 tools/vif-ganeti-metad \
304 tools/vcluster-setup \
305 $(python_scripts_shebang) \
308 $(nodist_pkgpython_PYTHON) \
309 $(nodist_pkgpython_rpc_stub_PYTHON) \
311 $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
312 $(HS_BUILT_TEST_HELPERS) \
318 .hpc/*.mix src/*.tix test/hs/*.tix *.tix \
322 $(built_base_sources) \
323 $(built_python_sources) \
324 $(PYTHON_BOOTSTRAP) \
325 $(gnt_python_sbin_SCRIPTS)
330 HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
332 HS_GENERATED_FILES += src/hconfd src/ganeti-confd
335 HS_GENERATED_FILES += src/ganeti-mond
338 HS_GENERATED_FILES += src/ganeti-metad
341 built_base_sources = \
345 built_python_base_sources = \
349 lib/rpc/stub/wconfd.py
351 built_python_sources = \
352 $(nodist_pkgpython_PYTHON) \
353 $(nodist_pkgpython_rpc_stub_PYTHON)
355 # Generating the RPC wrappers depends on many things, so make sure
356 # it's built at the end of the built sources
357 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
359 # these are all built from the underlying %.in sources
361 doc/examples/ganeti-kvm-poweroff.initd \
362 doc/examples/ganeti.cron \
363 doc/examples/ganeti.initd \
364 doc/examples/ganeti.logrotate \
365 doc/examples/ganeti-master-role.ocf \
366 doc/examples/ganeti-node-role.ocf \
367 doc/examples/gnt-config-backup \
368 doc/examples/hooks/ipsec \
369 doc/examples/systemd/ganeti-common.service \
370 doc/examples/systemd/ganeti-confd.service \
371 doc/examples/systemd/ganeti-kvmd.service \
372 doc/examples/systemd/ganeti-luxid.service \
373 doc/examples/systemd/ganeti-metad.service \
374 doc/examples/systemd/ganeti-mond.service \
375 doc/examples/systemd/ganeti-noded.service \
376 doc/examples/systemd/ganeti-rapi.service \
377 doc/examples/systemd/ganeti-wconfd.service
379 dist_ifup_SCRIPTS = \
383 nodist_pkgpython_PYTHON = \
384 $(built_python_base_sources) \
385 lib/_generated_rpc.py
387 nodist_pkgpython_rpc_stub_PYTHON = \
388 lib/rpc/stub/wconfd.py
390 nodist_pkgpython_bin_SCRIPTS = \
391 $(nodist_pkglib_python_scripts)
393 pkgpython_bin_SCRIPTS = \
394 $(pkglib_python_scripts)
397 lib/build/__init__.py \
398 lib/build/shell_example_lexer.py \
399 lib/build/sphinx_ext.py
403 lib/asyncnotifier.py \
420 lib/opcodes_base.py \
438 lib/client/__init__.py \
440 lib/client/gnt_backup.py \
441 lib/client/gnt_cluster.py \
442 lib/client/gnt_debug.py \
443 lib/client/gnt_group.py \
444 lib/client/gnt_instance.py \
445 lib/client/gnt_job.py \
446 lib/client/gnt_node.py \
447 lib/client/gnt_network.py \
448 lib/client/gnt_os.py \
449 lib/client/gnt_storage.py
452 lib/cmdlib/__init__.py \
453 lib/cmdlib/backup.py \
455 lib/cmdlib/cluster.py \
456 lib/cmdlib/common.py \
457 lib/cmdlib/group.py \
458 lib/cmdlib/instance.py \
459 lib/cmdlib/instance_migration.py \
460 lib/cmdlib/instance_operation.py \
461 lib/cmdlib/instance_query.py \
462 lib/cmdlib/instance_storage.py \
463 lib/cmdlib/instance_utils.py \
465 lib/cmdlib/network.py \
467 lib/cmdlib/operating_system.py \
468 lib/cmdlib/query.py \
472 hypervisor_PYTHON = \
473 lib/hypervisor/__init__.py \
474 lib/hypervisor/hv_base.py \
475 lib/hypervisor/hv_chroot.py \
476 lib/hypervisor/hv_fake.py \
477 lib/hypervisor/hv_lxc.py \
478 lib/hypervisor/hv_xen.py
480 hypervisor_hv_kvm_PYTHON = \
481 lib/hypervisor/hv_kvm/__init__.py \
482 lib/hypervisor/hv_kvm/monitor.py \
483 lib/hypervisor/hv_kvm/netdev.py
486 lib/jqueue/__init__.py \
490 lib/storage/__init__.py \
491 lib/storage/bdev.py \
492 lib/storage/base.py \
493 lib/storage/container.py \
494 lib/storage/drbd.py \
495 lib/storage/drbd_info.py \
496 lib/storage/drbd_cmdgen.py \
497 lib/storage/filestorage.py \
498 lib/storage/gluster.py
501 lib/rapi/__init__.py \
502 lib/rapi/baserlib.py \
504 lib/rapi/client_utils.py \
505 lib/rapi/connector.py \
507 lib/rapi/testutils.py
510 lib/http/__init__.py \
516 lib/confd/__init__.py \
520 lib/masterd/__init__.py \
521 lib/masterd/iallocator.py \
522 lib/masterd/instance.py
525 lib/impexpd/__init__.py
528 lib/watcher/__init__.py \
529 lib/watcher/nodemaint.py \
533 lib/server/__init__.py \
534 lib/server/masterd.py \
535 lib/server/noded.py \
539 lib/rpc/__init__.py \
546 lib/rpc/stub/__init__.py
549 lib/tools/__init__.py \
550 lib/tools/burnin.py \
551 lib/tools/common.py \
552 lib/tools/ensure_dirs.py \
553 lib/tools/node_cleanup.py \
554 lib/tools/node_daemon_setup.py \
555 lib/tools/prepare_node_join.py \
556 lib/tools/ssl_update.py
559 lib/utils/__init__.py \
561 lib/utils/filelock.py \
564 lib/utils/livelock.py \
568 lib/utils/nodesetup.py \
569 lib/utils/process.py \
571 lib/utils/security.py \
572 lib/utils/storage.py \
574 lib/utils/version.py \
575 lib/utils/wrapper.py \
580 doc/cluster-keys-replacement.rst \
581 doc/cluster-merge.rst \
594 doc/design-2.10.rst \
595 doc/design-2.11.rst \
596 doc/design-2.12.rst \
597 doc/design-autorepair.rst \
598 doc/design-bulk-create.rst \
599 doc/design-ceph-ganeti-support.rst \
600 doc/design-chained-jobs.rst \
601 doc/design-cmdlib-unittests.rst \
602 doc/design-cpu-pinning.rst \
603 doc/design-cpu-speed.rst \
604 doc/design-daemons.rst \
605 doc/design-device-uuid-name.rst \
606 doc/design-disks.rst \
607 doc/design-draft.rst \
608 doc/design-file-based-storage.rst \
609 doc/design-glusterfs-ganeti-support.rst \
610 doc/design-hotplug.rst \
611 doc/design-hroller.rst \
612 doc/design-hsqueeze.rst \
613 doc/design-htools-2.3.rst \
614 doc/design-http-server.rst \
615 doc/design-hugepages-support.rst \
616 doc/design-impexp2.rst \
617 doc/design-internal-shutdown.rst \
618 doc/design-kvmd.rst \
619 doc/design-linuxha.rst \
620 doc/design-lu-generated-jobs.rst \
621 doc/design-monitoring-agent.rst \
622 doc/design-move-instance-improvements.rst \
623 doc/design-multi-reloc.rst \
624 doc/design-multi-version-tests.rst \
625 doc/design-network.rst \
626 doc/design-node-add.rst \
627 doc/design-node-security.rst \
629 doc/design-openvswitch.rst \
630 doc/design-opportunistic-locking.rst \
631 doc/design-optables.rst \
633 doc/design-ovf-support.rst \
634 doc/design-partitioned.rst \
635 doc/design-performance-tests.rst \
636 doc/design-query-splitting.rst \
637 doc/design-query2.rst \
638 doc/design-query-splitting.rst \
639 doc/design-reason-trail.rst \
640 doc/design-resource-model.rst \
641 doc/design-restricted-commands.rst \
642 doc/design-shared-storage.rst \
643 doc/design-ssh-ports.rst \
644 doc/design-storagetypes.rst \
645 doc/design-systemd.rst \
646 doc/design-upgrade.rst \
647 doc/design-virtual-clusters.rst \
648 doc/design-x509-ca.rst \
649 doc/dev-codestyle.rst \
655 doc/install-quick.rst \
658 doc/manpages-disabled.rst \
659 doc/monitoring-query-format.rst \
660 doc/move-instance.rst \
662 doc/ovfconverter.rst \
666 doc/virtual-cluster.rst \
669 # Generates file names such as "doc/man-gnt-instance.rst"
670 mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
672 # Haskell programs to be installed in $PREFIX/bin
673 HS_BIN_PROGS=src/htools
675 # Haskell programs to be installed in the MYEXECLIB dir
677 HS_MYEXECLIB_PROGS=src/mon-collector
682 # Haskell programs to be compiled by "make really-all"
690 HS_COMPILE_PROGS += src/hconfd
693 HS_COMPILE_PROGS += src/ganeti-mond
696 HS_COMPILE_PROGS += src/ganeti-metad
699 # All Haskell non-test programs to be compiled but not automatically installed
700 HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
702 HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
703 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
705 # Haskell programs that cannot be disabled at configure (e.g., unlike
710 test/hs/hpc-mon-collector \
714 HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)
716 HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
717 HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))
719 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
720 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
724 -fwarn-monomorphism-restriction \
726 $(GHC_BYVERSION_FLAGS)
736 DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX) -dep-suffix $(HTEST_SUFFIX)
738 # GHC >= 7.8 stopped putting underscores into -dep-suffix by itself
739 # (https://ghc.haskell.org/trac/ghc/ticket/9749) so we have to put them.
740 # It also needs -dep-suffix "" for the .o file.
741 DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX)_ -dep-suffix $(HTEST_SUFFIX)_ \
745 # GHC > 7.6 needs -dynamic-too when using Template Haskell since its
746 # ghci is switched to loading dynamic libraries by default.
747 # It must only be used in non-profiling GHC invocations.
748 # We also don't use it in compilations that use HTEST_SUFFIX (which are
749 # compiled with -fhpc) because HPC coverage doesn't interact well with
750 # GHCI shared lib loading (https://ghc.haskell.org/trac/ghc/ticket/9762).
753 HFLAGS_DYNAMIC += -dynamic-too
757 HPROFFLAGS = -prof -fprof-auto-top -osuf $(HPROF_SUFFIX)_o \
758 -hisuf $(HPROF_SUFFIX)_hi -rtsopts
767 HTEST_FLAGS = $(HFLAGS) -fhpc -itest/hs \
768 -osuf $(HTEST_SUFFIX)_o \
769 -hisuf $(HTEST_SUFFIX)_hi
771 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
773 # internal extra flags (used for test/hs/htest mainly)
775 # combination of HEXTRA and HEXTRA_CONFIGURE
776 HEXTRA_COMBINED = $(HEXTRA) $(HEXTRA_CONFIGURE)
777 # exclude options for coverage reports
778 HPCEXCL = --exclude Main \
779 --exclude Ganeti.Constants \
780 --exclude Ganeti.HTools.QC \
781 --exclude Ganeti.THH \
782 --exclude Ganeti.Version \
783 --exclude Test.Ganeti.Attoparsec \
784 --exclude Test.Ganeti.TestCommon \
785 --exclude Test.Ganeti.TestHTools \
786 --exclude Test.Ganeti.TestHelper \
787 --exclude Test.Ganeti.TestImports \
788 $(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
791 src/Ganeti/BasicTypes.hs \
792 src/Ganeti/Codec.hs \
793 src/Ganeti/Common.hs \
794 src/Ganeti/Compat.hs \
795 src/Ganeti/Confd/Client.hs \
796 src/Ganeti/Confd/ClientFunctions.hs \
797 src/Ganeti/Confd/Server.hs \
798 src/Ganeti/Confd/Types.hs \
799 src/Ganeti/Confd/Utils.hs \
800 src/Ganeti/Config.hs \
801 src/Ganeti/ConfigReader.hs \
802 src/Ganeti/Constants.hs \
803 src/Ganeti/ConstantUtils.hs \
804 src/Ganeti/Cpu/LoadParser.hs \
805 src/Ganeti/Cpu/Types.hs \
806 src/Ganeti/Curl/Multi.hs \
807 src/Ganeti/Daemon.hs \
808 src/Ganeti/Daemon/Utils.hs \
809 src/Ganeti/DataCollectors/CLI.hs \
810 src/Ganeti/DataCollectors/CPUload.hs \
811 src/Ganeti/DataCollectors/Diskstats.hs \
812 src/Ganeti/DataCollectors/Drbd.hs \
813 src/Ganeti/DataCollectors/InstStatus.hs \
814 src/Ganeti/DataCollectors/InstStatusTypes.hs \
815 src/Ganeti/DataCollectors/Lv.hs \
816 src/Ganeti/DataCollectors/Program.hs \
817 src/Ganeti/DataCollectors/Types.hs \
818 src/Ganeti/Errors.hs \
819 src/Ganeti/HTools/Backend/IAlloc.hs \
820 src/Ganeti/HTools/Backend/Luxi.hs \
821 src/Ganeti/HTools/Backend/Rapi.hs \
822 src/Ganeti/HTools/Backend/Simu.hs \
823 src/Ganeti/HTools/Backend/Text.hs \
824 src/Ganeti/HTools/CLI.hs \
825 src/Ganeti/HTools/Cluster.hs \
826 src/Ganeti/HTools/Container.hs \
827 src/Ganeti/HTools/ExtLoader.hs \
828 src/Ganeti/HTools/Graph.hs \
829 src/Ganeti/HTools/Group.hs \
830 src/Ganeti/HTools/Instance.hs \
831 src/Ganeti/HTools/Loader.hs \
832 src/Ganeti/HTools/Nic.hs \
833 src/Ganeti/HTools/Node.hs \
834 src/Ganeti/HTools/PeerMap.hs \
835 src/Ganeti/HTools/Program/Hail.hs \
836 src/Ganeti/HTools/Program/Harep.hs \
837 src/Ganeti/HTools/Program/Hbal.hs \
838 src/Ganeti/HTools/Program/Hcheck.hs \
839 src/Ganeti/HTools/Program/Hinfo.hs \
840 src/Ganeti/HTools/Program/Hscan.hs \
841 src/Ganeti/HTools/Program/Hspace.hs \
842 src/Ganeti/HTools/Program/Hsqueeze.hs \
843 src/Ganeti/HTools/Program/Hroller.hs \
844 src/Ganeti/HTools/Program/Main.hs \
845 src/Ganeti/HTools/Types.hs \
846 src/Ganeti/Hypervisor/Xen.hs \
847 src/Ganeti/Hypervisor/Xen/XmParser.hs \
848 src/Ganeti/Hypervisor/Xen/Types.hs \
850 src/Ganeti/Hs2Py/GenConstants.hs \
851 src/Ganeti/Hs2Py/GenOpCodes.hs \
852 src/Ganeti/Hs2Py/OpDoc.hs \
853 src/Ganeti/JQueue.hs \
854 src/Ganeti/JQueue/Lens.hs \
855 src/Ganeti/JQueue/Objects.hs \
856 src/Ganeti/JQScheduler.hs \
861 src/Ganeti/Locking/Allocation.hs \
862 src/Ganeti/Locking/Types.hs \
863 src/Ganeti/Locking/Locks.hs \
864 src/Ganeti/Locking/Waiting.hs \
865 src/Ganeti/Logging.hs \
866 src/Ganeti/Logging/Lifted.hs \
867 src/Ganeti/Logging/WriterLog.hs \
869 src/Ganeti/Metad/Config.hs \
870 src/Ganeti/Metad/ConfigServer.hs \
871 src/Ganeti/Metad/Server.hs \
872 src/Ganeti/Metad/Types.hs \
873 src/Ganeti/Metad/WebServer.hs \
874 src/Ganeti/Monitoring/Server.hs \
875 src/Ganeti/Network.hs \
876 src/Ganeti/Objects.hs \
877 src/Ganeti/Objects/BitArray.hs \
878 src/Ganeti/Objects/Lens.hs \
879 src/Ganeti/OpCodes.hs \
880 src/Ganeti/OpCodes/Lens.hs \
881 src/Ganeti/OpParams.hs \
883 src/Ganeti/Parsers.hs \
884 src/Ganeti/PyValue.hs \
885 src/Ganeti/Query/Cluster.hs \
886 src/Ganeti/Query/Common.hs \
887 src/Ganeti/Query/Exec.hs \
888 src/Ganeti/Query/Export.hs \
889 src/Ganeti/Query/Filter.hs \
890 src/Ganeti/Query/Group.hs \
891 src/Ganeti/Query/Instance.hs \
892 src/Ganeti/Query/Job.hs \
893 src/Ganeti/Query/Language.hs \
894 src/Ganeti/Query/Locks.hs \
895 src/Ganeti/Query/Network.hs \
896 src/Ganeti/Query/Node.hs \
897 src/Ganeti/Query/Query.hs \
898 src/Ganeti/Query/Server.hs \
899 src/Ganeti/Query/Types.hs \
901 src/Ganeti/Runtime.hs \
902 src/Ganeti/Ssconf.hs \
903 src/Ganeti/Storage/Diskstats/Parser.hs \
904 src/Ganeti/Storage/Diskstats/Types.hs \
905 src/Ganeti/Storage/Drbd/Parser.hs \
906 src/Ganeti/Storage/Drbd/Types.hs \
907 src/Ganeti/Storage/Lvm/LVParser.hs \
908 src/Ganeti/Storage/Lvm/Types.hs \
909 src/Ganeti/Storage/Utils.hs \
911 src/Ganeti/THH/Field.hs \
912 src/Ganeti/THH/HsRPC.hs \
913 src/Ganeti/THH/PyRPC.hs \
914 src/Ganeti/THH/PyType.hs \
915 src/Ganeti/THH/Types.hs \
916 src/Ganeti/THH/RPC.hs \
917 src/Ganeti/Types.hs \
918 src/Ganeti/UDSServer.hs \
919 src/Ganeti/Utils.hs \
920 src/Ganeti/Utils/Atomic.hs \
921 src/Ganeti/Utils/AsyncWorker.hs \
922 src/Ganeti/Utils/IORef.hs \
923 src/Ganeti/Utils/Livelock.hs \
924 src/Ganeti/Utils/MonadPlus.hs \
925 src/Ganeti/Utils/MultiMap.hs \
926 src/Ganeti/Utils/MVarLock.hs \
927 src/Ganeti/Utils/Random.hs \
928 src/Ganeti/Utils/Statistics.hs \
929 src/Ganeti/Utils/UniStd.hs \
930 src/Ganeti/Utils/Validate.hs \
931 src/Ganeti/VCluster.hs \
932 src/Ganeti/WConfd/ConfigState.hs \
933 src/Ganeti/WConfd/ConfigVerify.hs \
934 src/Ganeti/WConfd/ConfigWriter.hs \
935 src/Ganeti/WConfd/Client.hs \
936 src/Ganeti/WConfd/Core.hs \
937 src/Ganeti/WConfd/DeathDetection.hs \
938 src/Ganeti/WConfd/Language.hs \
939 src/Ganeti/WConfd/Monad.hs \
940 src/Ganeti/WConfd/Persistent.hs \
941 src/Ganeti/WConfd/Server.hs \
942 src/Ganeti/WConfd/Ssconf.hs \
943 src/Ganeti/WConfd/TempRes.hs
946 test/hs/Test/AutoConf.hs \
947 test/hs/Test/Ganeti/Attoparsec.hs \
948 test/hs/Test/Ganeti/BasicTypes.hs \
949 test/hs/Test/Ganeti/Common.hs \
950 test/hs/Test/Ganeti/Confd/Types.hs \
951 test/hs/Test/Ganeti/Confd/Utils.hs \
952 test/hs/Test/Ganeti/Constants.hs \
953 test/hs/Test/Ganeti/Daemon.hs \
954 test/hs/Test/Ganeti/Errors.hs \
955 test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
956 test/hs/Test/Ganeti/HTools/Backend/Text.hs \
957 test/hs/Test/Ganeti/HTools/CLI.hs \
958 test/hs/Test/Ganeti/HTools/Cluster.hs \
959 test/hs/Test/Ganeti/HTools/Container.hs \
960 test/hs/Test/Ganeti/HTools/ExtLoader.hs \
961 test/hs/Test/Ganeti/HTools/Graph.hs \
962 test/hs/Test/Ganeti/HTools/Instance.hs \
963 test/hs/Test/Ganeti/HTools/Loader.hs \
964 test/hs/Test/Ganeti/HTools/Node.hs \
965 test/hs/Test/Ganeti/HTools/PeerMap.hs \
966 test/hs/Test/Ganeti/HTools/Types.hs \
967 test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
968 test/hs/Test/Ganeti/JSON.hs \
969 test/hs/Test/Ganeti/Jobs.hs \
970 test/hs/Test/Ganeti/JQueue.hs \
971 test/hs/Test/Ganeti/Kvmd.hs \
972 test/hs/Test/Ganeti/Luxi.hs \
973 test/hs/Test/Ganeti/Locking/Allocation.hs \
974 test/hs/Test/Ganeti/Locking/Locks.hs \
975 test/hs/Test/Ganeti/Locking/Waiting.hs \
976 test/hs/Test/Ganeti/Network.hs \
977 test/hs/Test/Ganeti/Objects.hs \
978 test/hs/Test/Ganeti/Objects/BitArray.hs \
979 test/hs/Test/Ganeti/OpCodes.hs \
980 test/hs/Test/Ganeti/Query/Aliases.hs \
981 test/hs/Test/Ganeti/Query/Filter.hs \
982 test/hs/Test/Ganeti/Query/Instance.hs \
983 test/hs/Test/Ganeti/Query/Language.hs \
984 test/hs/Test/Ganeti/Query/Network.hs \
985 test/hs/Test/Ganeti/Query/Query.hs \
986 test/hs/Test/Ganeti/Rpc.hs \
987 test/hs/Test/Ganeti/Runtime.hs \
988 test/hs/Test/Ganeti/Ssconf.hs \
989 test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
990 test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
991 test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
992 test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
993 test/hs/Test/Ganeti/THH.hs \
994 test/hs/Test/Ganeti/THH/Types.hs \
995 test/hs/Test/Ganeti/TestCommon.hs \
996 test/hs/Test/Ganeti/TestHTools.hs \
997 test/hs/Test/Ganeti/TestHelper.hs \
998 test/hs/Test/Ganeti/Types.hs \
999 test/hs/Test/Ganeti/Utils.hs \
1000 test/hs/Test/Ganeti/Utils/MultiMap.hs \
1001 test/hs/Test/Ganeti/Utils/Statistics.hs \
1002 test/hs/Test/Ganeti/WConfd/TempRes.hs
1005 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
1008 test/hs/Test/Ganeti/TestImports.hs \
1010 src/Ganeti/Hs2Py/ListConstants.hs \
1011 src/Ganeti/Curl/Internal.hs \
1012 src/Ganeti/Version.hs
1013 HS_BUILT_SRCS_IN = \
1014 $(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
1015 src/Ganeti/Curl/Internal.hsc \
1016 lib/_constants.py.in \
1017 lib/opcodes.py.in_after \
1018 lib/opcodes.py.in_before
1020 HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
1022 $(RUN_IN_TEMPDIR): | stamp-directories
1024 doc/html/index.html: ENABLE_MANPAGES =
1025 doc/man-html/index.html: ENABLE_MANPAGES = 1
1026 doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
1029 SPHINX_HTML_THEME=default
1031 SPHINX_HTML_THEME=classic
1033 # Note: we use here an order-only prerequisite, as the contents of
1034 # _constants.py are not actually influencing the html build output: it
1035 # has to exist in order for the sphinx module to be loaded
1036 # successfully, but we certainly don't want the docs to be rebuilt if
1038 doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
1039 configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
1040 lib/build/shell_example_lexer.py lib/ht.py \
1041 doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
1042 autotools/sphinx-wrapper | $(built_python_sources)
1043 @test -n "$(SPHINX)" || \
1044 { echo 'sphinx-build' not found during configure; exit 1; }
1046 if test -n '$(ENABLE_MANPAGES)'; then \
1047 echo 'Man pages in documentation were disabled at configure time' >&2; \
1051 ## Sphinx provides little control over what content should be included. Some
1052 ## mechanisms exist, but they all have drawbacks or actual issues. Since we
1053 ## build two different versions of the documentation--once without man pages and
1054 ## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
1055 ## us with this, but requires running in a temporary directory. It moves the
1056 ## correct files into place depending on environment variables.
1058 @mkdir_p@ $$dir && \
1059 PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
1060 HTML_THEME=$(SPHINX_HTML_THEME) \
1061 $(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
1063 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
1064 -D release="$(PACKAGE_VERSION)" \
1065 -D graphviz_dot="$(DOT)" \
1066 doc $(CURDIR)/$$dir && \
1067 rm -f $$dir/.buildinfo $$dir/objects.inv
1070 doc/html: doc/html/index.html
1072 doc/man-html: doc/man-html/index.html
1074 doc/install-quick.rst: INSTALL
1076 doc/upgrade.rst: UPGRADE
1078 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
1080 { echo '.. This file is automatically updated at build time from $<.'; \
1081 echo '.. Do not edit.'; \
1086 doc/manpages-enabled.rst: Makefile | $(built_base_sources)
1087 { echo '.. This file is automatically generated, do not edit!'; \
1092 echo '.. toctree::'; \
1093 echo ' :maxdepth: 1'; \
1095 for i in $(notdir $(mandocrst)); do \
1097 done | LC_ALL=C sort; \
1100 doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
1102 { echo '.. This file is automatically updated at build time from $<.'; \
1103 echo '.. Do not edit.'; \
1106 echo '=========================================='; \
1107 tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
1110 echo 'Man pages in documentation were disabled at configure time' >&2; \
1114 doc/users/%: doc/users/%.in Makefile $(REPLACE_VARS_SED)
1115 cat $< | sed -f $(REPLACE_VARS_SED) | LC_ALL=C sort | uniq | (grep -v '^root' || true) > $@
1120 doc/users/groupmemberships
1122 # Things to build but not to install (add it to EXTRA_DIST if it should be
1126 doc/examples/bash_completion \
1127 doc/examples/bash_completion-debug \
1133 noinst_DATA += doc/man-html
1135 noinst_DATA += doc/html
1140 scripts/gnt-backup \
1141 scripts/gnt-cluster \
1144 scripts/gnt-instance \
1146 scripts/gnt-network \
1151 gnt_scripts_basenames = \
1152 $(patsubst scripts/%,%,$(patsubst daemons/%,%,$(gnt_scripts) $(gnt_python_sbin_SCRIPTS)))
1154 gnt_python_sbin_SCRIPTS = \
1155 $(PYTHON_BOOTSTRAP_SBIN)
1157 gntpython_SCRIPTS = $(gnt_scripts)
1159 PYTHON_BOOTSTRAP_SBIN = \
1160 daemons/ganeti-noded \
1161 daemons/ganeti-rapi \
1162 daemons/ganeti-watcher
1164 PYTHON_BOOTSTRAP = \
1167 tools/node-cleanup \
1168 tools/node-daemon-setup \
1170 tools/prepare-node-join
1182 qa/qa_instance_utils.py \
1184 qa/qa_job_utils.py \
1185 qa/qa_monitoring.py \
1194 bin_SCRIPTS = $(HS_BIN_PROGS)
1196 @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
1197 # FIXME: this is a hardcoded logic, instead of auto-resolving
1198 $(LN_S) -f ../../../bin/htools \
1199 $(DESTDIR)$(iallocatorsdir)/hail
1200 for role in $(HS_BIN_ROLES); do \
1201 $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
1204 HS_SRCS = $(HS_LIBTESTBUILT_SRCS)
1206 # select the last line of output and extract the version number,
1207 # padding with 0s if needed
1209 ghc-pkg list --simple-output lens \
1210 | sed -r -e '$$!d' \
1211 -e 's/^lens-([0-9]+(\.[0-9]+)*)/\1 0 0 0/' \
1212 -e 's/\./ /g' -e 's/([0-9]+) *([0-9]+) *([0-9]+) .*/\
1213 -DLENS_MAJOR=\1 -DLENS_MINOR=\2 -DLENS_REV=\3/' \
1216 ghc-pkg list --simple-output monad-control \
1217 | sed -r -e '$$!d' \
1218 -e 's/^monad-control-([0-9]+(\.[0-9]+)*)/\1 0 0 0/' \
1219 -e 's/\./ /g' -e 's/([0-9]+) *([0-9]+) *([0-9]+) .*/\
1220 -DMONAD_CONTROL_MAJOR=\1 -DMONAD_CONTROL_MINOR=\2 -DMONAD_CONTROL_REV=\3/'\
1223 ghc-pkg list --simple-output QuickCheck \
1224 | sed -r -e '$$!d' \
1225 -e 's/^QuickCheck-([0-9]+(\.[0-9]+)*)/\1 0 0 0/' \
1226 -e 's/\./ /g' -e 's/([0-9]+) *([0-9]+) *([0-9]+) .*/\
1227 -DQUICKCHECK_MAJOR=\1 -DQUICKCHECK_MINOR=\2 -DQUICKCHECK_REV=\3/'\
1231 HS_MAKEFILE_GHC_SRCS = $(HS_SRC_PROGS:%=%.hs)
1233 HS_MAKEFILE_GHC_SRCS += $(HS_TEST_PROGS:%=%.hs)
1235 Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile hs-pkg-versions \
1236 | $(built_base_sources) $(HS_BUILT_SRCS)
1237 $(GHC) -M -dep-makefile $@ $(DEP_SUFFIXES) $(HFLAGS) $(HFLAGS_DYNAMIC) \
1239 $(shell cat hs-pkg-versions) \
1240 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(HS_MAKEFILE_GHC_SRCS)
1241 # Since ghc -M does not generate dependency line for object files, dependencies
1242 # from a target executable seed object (e.g. src/hluxid.o) to objects which
1243 # finally will be linked to the target object (e.g. src/Ganeti/Daemon.o) are
1244 # missing in Makefile.ghc.
1245 # see: https://www.haskell.org/ghc/docs/7.6.2/html/users_guide/separate-compilation.html#makefile-dependencies
1246 # Following substitutions will add dependencies between object files which
1247 # corresponds to the interface file already there as a dependency for each
1248 # object listed in Makefile.ghc.
1249 # e.g. src/hluxid.o : src/Ganeti/Daemon.hi
1250 # => src/hluxid.o : src/Ganeti/Daemon.hi src/Ganeti/Daemon.o
1251 sed -i -r -e 's/([^ ]+)\.hi$$/\1.hi \1.o/' -e 's/([^ ]+)_hi$$/\1_hi \1_o/' $@
1253 @include_makefile_ghc@
1255 # Like the %.o rule, but allows access to the test/hs directory.
1256 # This uses HFLAGS instead of HTEST_FLAGS because it's only for generating
1257 # object files (.o for GHC <= 7.6, .o/.so for newer GHCs) that are loaded
1258 # in GHCI when evaluating TH. The actual test-with-coverage .hpc_o files
1259 # are created in the `%.$(HTEST_SUFFIX)_o` rule.
1260 test/hs/%.o: hs-pkg-versions
1261 @echo '[GHC|test]: $@ <- $^'
1262 @$(GHC) -c $(HFLAGS) $(HFLAGS_DYNAMIC) -itest/hs \
1263 $(shell cat hs-pkg-versions) \
1264 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
1266 %.o: hs-pkg-versions
1267 @echo '[GHC]: $@ <- $^'
1268 @$(GHC) -c $(HFLAGS) $(HFLAGS_DYNAMIC) \
1269 $(shell cat hs-pkg-versions) \
1270 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
1272 # For TH+profiling we need to compile twice: Once without profiling,
1273 # and then once with profiling. See
1274 # http://www.haskell.org/ghc/docs/7.0.4/html/users_guide/template-haskell.html#id636646
1276 %.$(HPROF_SUFFIX)_o: %.o hs-pkg-versions
1277 @echo '[GHC|prof]: $@ <- $^'
1278 @$(GHC) -c $(HFLAGS) \
1279 $(shell cat hs-pkg-versions) \
1281 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) \
1282 $(@:%.$(HPROF_SUFFIX)_o=%.hs)
1285 # We depend on the non-test .o file here because we need the corresponding .so
1286 # file for GHC > 7.6 ghci dynamic loading for TH, and creating the .o file
1287 # will create the .so file since we use -dynamic-too (using the `test/hs/%.o`
1289 %.$(HTEST_SUFFIX)_o: %.o hs-pkg-versions
1290 @echo '[GHC|test]: $@ <- $^'
1291 @$(GHC) -c $(HTEST_FLAGS) \
1292 $(shell cat hs-pkg-versions) \
1293 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.$(HTEST_SUFFIX)_o=%.hs)
1296 %.$(HTEST_SUFFIX)_hi: %.$(HTEST_SUFFIX)_o ;
1297 %.$(HPROF_SUFFIX)_hi: %.$(HPROF_SUFFIX)_o ;
1300 $(HS_SRC_PROGS): %: %.$(HPROF_SUFFIX)_o | stamp-directories
1301 @echo '[GHC-link]: $@'
1302 $(GHC) $(HFLAGS) $(HPROFFLAGS) \
1303 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
1305 $(HS_SRC_PROGS): %: %.o hs-pkg-versions | stamp-directories
1307 @echo '[GHC-link]: $@'
1308 $(GHC) $(HFLAGS) $(HFLAGS_DYNAMIC) \
1309 $(shell cat hs-pkg-versions) \
1311 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
1312 @rm -f $(notdir $@).tix
1315 $(HS_TEST_PROGS): %: %.$(HTEST_SUFFIX)_o hs-pkg-versions \
1316 | stamp-directories $(built_python_sources)
1317 @if [ "$(HS_NODEV)" ]; then \
1318 echo "Error: cannot run unittests without the development" \
1319 " libraries (see devnotes.rst)" 1>&2; \
1322 @echo '[GHC-link|test]: $@'
1323 $(GHC) $(HTEST_FLAGS) \
1324 $(shell cat hs-pkg-versions) \
1325 $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
1326 @rm -f $(notdir $@).tix
1329 dist_sbin_SCRIPTS = \
1330 tools/ganeti-listrunner
1332 nodist_sbin_SCRIPTS = \
1333 daemons/ganeti-cleaner \
1338 src/ganeti-luxid: src/hluxid
1341 # strip path prefixes off the sbin scripts
1342 all_sbin_scripts = \
1343 $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
1344 $(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
1347 src/ganeti-confd: src/hconfd
1350 nodist_sbin_SCRIPTS += src/ganeti-confd
1354 nodist_sbin_SCRIPTS += src/ganeti-mond
1358 nodist_sbin_SCRIPTS += src/ganeti-metad
1364 tools/cfgupgrade12 \
1365 tools/cluster-merge \
1366 tools/confd-client \
1369 tools/move-instance \
1370 tools/ovfconverter \
1371 tools/post-upgrade \
1372 tools/sanitize-config
1374 python_scripts_shebang = \
1375 $(patsubst tools/%,tools/shebang/%, $(python_scripts))
1377 tools/shebang/%: tools/%
1378 mkdir -p tools/shebang
1379 head -1 $< | sed 's|#!/usr/bin/python|#!$(PYTHON)|' > $@
1380 echo '# Generated file; do not edit.' >> $@
1383 dist_tools_SCRIPTS = \
1384 tools/kvm-console-wrapper \
1385 tools/master-ip-setup \
1386 tools/xen-console-wrapper
1388 dist_tools_python_SCRIPTS = \
1391 nodist_tools_python_SCRIPTS = \
1392 tools/node-cleanup \
1393 $(python_scripts_shebang)
1395 tools_python_basenames = \
1396 $(patsubst shebang/%,%,\
1397 $(patsubst tools/%,%,\
1398 $(dist_tools_python_SCRIPTS) $(nodist_tools_python_SCRIPTS)))
1400 nodist_tools_SCRIPTS = \
1402 tools/vcluster-setup
1404 tools_basenames = $(patsubst tools/%,%,$(nodist_tools_SCRIPTS) $(dist_tools_SCRIPTS))
1406 pkglib_python_scripts = \
1407 daemons/import-export \
1408 tools/check-cert-expired
1410 nodist_pkglib_python_scripts = \
1412 tools/node-daemon-setup \
1413 tools/prepare-node-join \
1416 pkglib_python_basenames = \
1417 $(patsubst daemons/%,%,$(patsubst tools/%,%,\
1418 $(pkglib_python_scripts) $(nodist_pkglib_python_scripts)))
1420 myexeclib_SCRIPTS = \
1421 daemons/daemon-util \
1426 tools/vif-ganeti-metad \
1428 $(HS_MYEXECLIB_PROGS)
1430 # compute the basenames of the myexeclib_scripts
1431 myexeclib_scripts_basenames = \
1432 $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst src/%,%,$(myexeclib_SCRIPTS))))
1440 autotools/build-bash-completion \
1441 autotools/build-rpc \
1442 autotools/check-header \
1443 autotools/check-imports \
1444 autotools/check-man-dashes \
1445 autotools/check-man-references \
1446 autotools/check-man-warnings \
1447 autotools/check-news \
1448 autotools/check-python-code \
1449 autotools/check-tar \
1450 autotools/check-version \
1452 autotools/gen-py-coverage \
1453 autotools/print-py-constants \
1454 autotools/sphinx-wrapper \
1455 autotools/testrunner \
1456 autotools/wrong-hardcoded-paths \
1458 daemons/daemon-util.in \
1459 daemons/ganeti-cleaner.in \
1460 $(pkglib_python_scripts) \
1461 devel/build_chroot \
1466 tools/vif-ganeti.in \
1467 tools/vif-ganeti-metad.in \
1468 tools/net-common.in \
1469 tools/vcluster-setup.in \
1473 $(BUILT_EXAMPLES:%=%.in) \
1474 doc/examples/ganeti.default \
1475 doc/examples/ganeti.default-debug \
1476 doc/examples/hooks/ethers \
1477 doc/examples/gnt-debug/README \
1478 doc/examples/gnt-debug/delay0.json \
1479 doc/examples/gnt-debug/delay50.json \
1480 doc/examples/systemd/ganeti-master.target \
1481 doc/examples/systemd/ganeti-node.target \
1482 doc/examples/systemd/ganeti.service \
1483 doc/examples/systemd/ganeti.target \
1484 doc/users/groupmemberships.in \
1485 doc/users/groups.in \
1486 doc/users/users.in \
1489 $(python_test_support) \
1495 $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
1498 test/hs/cli-tests-defs.sh \
1499 test/hs/offline-test.sh \
1503 man/ganeti-cleaner.8 \
1504 man/ganeti-confd.8 \
1505 man/ganeti-luxid.8 \
1506 man/ganeti-listrunner.8 \
1509 man/ganeti-noded.8 \
1510 man/ganeti-os-interface.7 \
1511 man/ganeti-extstorage-interface.7 \
1513 man/ganeti-watcher.8 \
1514 man/ganeti-wconfd.8 \
1521 man/gnt-instance.8 \
1538 # Remove extensions from all filenames in man_MANS
1539 mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1541 manrst = $(patsubst %,%.rst,$(mannoext))
1542 manhtml = $(patsubst %.rst,%.html,$(manrst))
1543 mangen = $(patsubst %.rst,%.gen,$(manrst))
1545 $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1546 $(patsubst %.html,%.html.in,$(manhtml)) \
1549 manfullpath = $(patsubst man/%.1,man1/%.1,\
1550 $(patsubst man/%.7,man7/%.7,\
1551 $(patsubst man/%.8,man8/%.8,$(man_MANS))))
1554 test/autotools/autotools-check-news.test \
1555 test/data/htools/clean-nonzero-score.data \
1556 test/data/htools/common-suffix.data \
1557 test/data/htools/empty-cluster.data \
1558 test/data/htools/hail-alloc-drbd.json \
1559 test/data/htools/hail-alloc-invalid-network.json \
1560 test/data/htools/hail-alloc-invalid-twodisks.json \
1561 test/data/htools/hail-alloc-restricted-network.json \
1562 test/data/htools/hail-alloc-spindles.json \
1563 test/data/htools/hail-alloc-twodisks.json \
1564 test/data/htools/hail-change-group.json \
1565 test/data/htools/hail-invalid-reloc.json \
1566 test/data/htools/hail-node-evac.json \
1567 test/data/htools/hail-reloc-drbd.json \
1568 test/data/htools/hbal-cpu-speed.data \
1569 test/data/htools/hbal-dyn.data \
1570 test/data/htools/hbal-evac.data \
1571 test/data/htools/hbal-excl-tags.data \
1572 test/data/htools/hbal-split-insts.data \
1573 test/data/htools/hspace-groups-one.data \
1574 test/data/htools/hspace-groups-two.data \
1575 test/data/htools/hspace-tiered-dualspec-exclusive.data \
1576 test/data/htools/hspace-tiered-dualspec.data \
1577 test/data/htools/hspace-tiered-exclusive.data \
1578 test/data/htools/hspace-tiered-ipolicy.data \
1579 test/data/htools/hspace-tiered-mixed.data \
1580 test/data/htools/hspace-tiered-resourcetypes.data \
1581 test/data/htools/hspace-tiered-vcpu.data \
1582 test/data/htools/hspace-tiered.data \
1583 test/data/htools/invalid-node.data \
1584 test/data/htools/missing-resources.data \
1585 test/data/htools/multiple-master.data \
1586 test/data/htools/multiple-tags.data \
1587 test/data/htools/n1-failure.data \
1588 test/data/htools/rapi/groups.json \
1589 test/data/htools/rapi/info.json \
1590 test/data/htools/rapi/instances.json \
1591 test/data/htools/rapi/nodes.json \
1592 test/data/htools/hroller-full.data \
1593 test/data/htools/hroller-nodegroups.data \
1594 test/data/htools/hroller-nonredundant.data \
1595 test/data/htools/hroller-online.data \
1596 test/data/htools/hsqueeze-mixed-instances.data \
1597 test/data/htools/hsqueeze-overutilized.data \
1598 test/data/htools/hsqueeze-underutilized.data \
1599 test/data/htools/unique-reboot-order.data \
1600 test/hs/shelltests/htools-balancing.test \
1601 test/hs/shelltests/htools-basic.test \
1602 test/hs/shelltests/htools-dynutil.test \
1603 test/hs/shelltests/htools-excl.test \
1604 test/hs/shelltests/htools-hail.test \
1605 test/hs/shelltests/htools-hbal-evac.test \
1606 test/hs/shelltests/htools-hroller.test \
1607 test/hs/shelltests/htools-hspace.test \
1608 test/hs/shelltests/htools-hsqueeze.test \
1609 test/hs/shelltests/htools-invalid.test \
1610 test/hs/shelltests/htools-multi-group.test \
1611 test/hs/shelltests/htools-no-backend.test \
1612 test/hs/shelltests/htools-rapi.test \
1613 test/hs/shelltests/htools-single-group.test \
1614 test/hs/shelltests/htools-text-backend.test \
1615 test/hs/shelltests/htools-mon-collector.test \
1616 test/data/bdev-drbd-8.0.txt \
1617 test/data/bdev-drbd-8.3.txt \
1618 test/data/bdev-drbd-8.4.txt \
1619 test/data/bdev-drbd-8.4-no-disk-params.txt \
1620 test/data/bdev-drbd-disk.txt \
1621 test/data/bdev-drbd-net-ip4.txt \
1622 test/data/bdev-drbd-net-ip6.txt \
1623 test/data/bdev-rbd/json_output_empty.txt \
1624 test/data/bdev-rbd/json_output_extra_matches.txt \
1625 test/data/bdev-rbd/json_output_no_matches.txt \
1626 test/data/bdev-rbd/json_output_ok.txt \
1627 test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1628 test/data/bdev-rbd/plain_output_new_no_matches.txt \
1629 test/data/bdev-rbd/plain_output_new_ok.txt \
1630 test/data/bdev-rbd/plain_output_old_empty.txt \
1631 test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1632 test/data/bdev-rbd/plain_output_old_no_matches.txt \
1633 test/data/bdev-rbd/plain_output_old_ok.txt \
1634 test/data/bdev-rbd/output_invalid.txt \
1635 test/data/cert1.pem \
1636 test/data/cert2.pem \
1637 test/data/cluster_config_2.7.json \
1638 test/data/cluster_config_2.8.json \
1639 test/data/cluster_config_2.9.json \
1640 test/data/cluster_config_2.10.json \
1641 test/data/cluster_config_2.11.json \
1642 test/data/instance-minor-pairing.txt \
1643 test/data/instance-disks.txt \
1644 test/data/ip-addr-show-dummy0.txt \
1645 test/data/ip-addr-show-lo-ipv4.txt \
1646 test/data/ip-addr-show-lo-ipv6.txt \
1647 test/data/ip-addr-show-lo-oneline-ipv4.txt \
1648 test/data/ip-addr-show-lo-oneline-ipv6.txt \
1649 test/data/ip-addr-show-lo-oneline.txt \
1650 test/data/ip-addr-show-lo.txt \
1651 test/data/kvm_0.12.5_help.txt \
1652 test/data/kvm_0.15.90_help.txt \
1653 test/data/kvm_0.9.1_help.txt \
1654 test/data/kvm_0.9.1_help_boot_test.txt \
1655 test/data/kvm_1.0_help.txt \
1656 test/data/kvm_1.1.2_help.txt \
1657 test/data/kvm_runtime.json \
1658 test/data/lvs_lv.txt \
1659 test/data/NEWS_OK.txt \
1660 test/data/NEWS_previous_unreleased.txt \
1661 test/data/ovfdata/compr_disk.vmdk.gz \
1662 test/data/ovfdata/config.ini \
1663 test/data/ovfdata/corrupted_resources.ovf \
1664 test/data/ovfdata/empty.ini \
1665 test/data/ovfdata/empty.ovf \
1666 test/data/ovfdata/ganeti.mf \
1667 test/data/ovfdata/ganeti.ovf \
1668 test/data/ovfdata/gzip_disk.ovf \
1669 test/data/ovfdata/new_disk.vmdk \
1670 test/data/ovfdata/no_disk.ini \
1671 test/data/ovfdata/no_disk_in_ref.ovf \
1672 test/data/ovfdata/no_os.ini \
1673 test/data/ovfdata/no_ovf.ova \
1674 test/data/ovfdata/other/rawdisk.raw \
1675 test/data/ovfdata/ova.ova \
1676 test/data/ovfdata/rawdisk.raw \
1677 test/data/ovfdata/second_disk.vmdk \
1678 test/data/ovfdata/unsafe_path.ini \
1679 test/data/ovfdata/virtualbox.ovf \
1680 test/data/ovfdata/wrong_config.ini \
1681 test/data/ovfdata/wrong_extension.ovd \
1682 test/data/ovfdata/wrong_manifest.mf \
1683 test/data/ovfdata/wrong_manifest.ovf \
1684 test/data/ovfdata/wrong_ova.ova \
1685 test/data/ovfdata/wrong_xml.ovf \
1686 test/data/proc_diskstats.txt \
1687 test/data/proc_drbd8.txt \
1688 test/data/proc_drbd80-emptyline.txt \
1689 test/data/proc_drbd80-emptyversion.txt \
1690 test/data/proc_drbd83.txt \
1691 test/data/proc_drbd83_sync.txt \
1692 test/data/proc_drbd83_sync_want.txt \
1693 test/data/proc_drbd83_sync_krnl2.6.39.txt \
1694 test/data/proc_drbd84.txt \
1695 test/data/proc_drbd84_emptyfirst.txt \
1696 test/data/proc_drbd84_sync.txt \
1697 test/data/proc_meminfo.txt \
1698 test/data/proc_cpuinfo.txt \
1699 test/data/qa-minimal-nodes-instances-only.json \
1700 test/data/sys_drbd_usermode_helper.txt \
1701 test/data/vgreduce-removemissing-2.02.02.txt \
1702 test/data/vgreduce-removemissing-2.02.66-fail.txt \
1703 test/data/vgreduce-removemissing-2.02.66-ok.txt \
1704 test/data/vgs-missing-pvs-2.02.02.txt \
1705 test/data/vgs-missing-pvs-2.02.66.txt \
1706 test/data/xen-xl-list-4.4-crashed-instances.txt \
1707 test/data/xen-xm-info-4.0.1.txt \
1708 test/data/xen-xm-list-4.0.1-dom0-only.txt \
1709 test/data/xen-xm-list-4.0.1-four-instances.txt \
1710 test/data/xen-xm-list-long-4.0.1.txt \
1711 test/data/xen-xm-uptime-4.0.1.txt \
1712 test/py/ganeti-cli.test \
1713 test/py/gnt-cli.test \
1714 test/py/import-export_unittest-helper
1718 doc/examples/rapi_testutils.py \
1719 test/py/cmdlib/backup_unittest.py \
1720 test/py/cmdlib/cluster_unittest.py \
1721 test/py/cmdlib/cmdlib_unittest.py \
1722 test/py/cmdlib/group_unittest.py \
1723 test/py/cmdlib/instance_unittest.py \
1724 test/py/cmdlib/instance_migration_unittest.py \
1725 test/py/cmdlib/instance_query_unittest.py \
1726 test/py/cmdlib/instance_storage_unittest.py \
1727 test/py/cmdlib/node_unittest.py \
1728 test/py/cmdlib/test_unittest.py \
1729 test/py/cfgupgrade_unittest.py \
1730 test/py/docs_unittest.py \
1731 test/py/ganeti.asyncnotifier_unittest.py \
1732 test/py/ganeti.backend_unittest-runasroot.py \
1733 test/py/ganeti.backend_unittest.py \
1734 test/py/ganeti.bootstrap_unittest.py \
1735 test/py/ganeti.cli_unittest.py \
1736 test/py/ganeti.client.gnt_cluster_unittest.py \
1737 test/py/ganeti.client.gnt_instance_unittest.py \
1738 test/py/ganeti.client.gnt_job_unittest.py \
1739 test/py/ganeti.compat_unittest.py \
1740 test/py/ganeti.confd.client_unittest.py \
1741 test/py/ganeti.config_unittest.py \
1742 test/py/ganeti.constants_unittest.py \
1743 test/py/ganeti.daemon_unittest.py \
1744 test/py/ganeti.errors_unittest.py \
1745 test/py/ganeti.hooks_unittest.py \
1746 test/py/ganeti.ht_unittest.py \
1747 test/py/ganeti.http_unittest.py \
1748 test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1749 test/py/ganeti.hypervisor.hv_fake_unittest.py \
1750 test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1751 test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1752 test/py/ganeti.hypervisor.hv_xen_unittest.py \
1753 test/py/ganeti.hypervisor_unittest.py \
1754 test/py/ganeti.impexpd_unittest.py \
1755 test/py/ganeti.jqueue_unittest.py \
1756 test/py/ganeti.jstore_unittest.py \
1757 test/py/ganeti.locking_unittest.py \
1758 test/py/ganeti.luxi_unittest.py \
1759 test/py/ganeti.masterd.iallocator_unittest.py \
1760 test/py/ganeti.masterd.instance_unittest.py \
1761 test/py/ganeti.mcpu_unittest.py \
1762 test/py/ganeti.netutils_unittest.py \
1763 test/py/ganeti.objects_unittest.py \
1764 test/py/ganeti.opcodes_unittest.py \
1765 test/py/ganeti.outils_unittest.py \
1766 test/py/ganeti.ovf_unittest.py \
1767 test/py/ganeti.qlang_unittest.py \
1768 test/py/ganeti.query_unittest.py \
1769 test/py/ganeti.rapi.baserlib_unittest.py \
1770 test/py/ganeti.rapi.client_unittest.py \
1771 test/py/ganeti.rapi.resources_unittest.py \
1772 test/py/ganeti.rapi.rlib2_unittest.py \
1773 test/py/ganeti.rapi.testutils_unittest.py \
1774 test/py/ganeti.rpc_unittest.py \
1775 test/py/ganeti.rpc.client_unittest.py \
1776 test/py/ganeti.runtime_unittest.py \
1777 test/py/ganeti.serializer_unittest.py \
1778 test/py/ganeti.server.rapi_unittest.py \
1779 test/py/ganeti.ssconf_unittest.py \
1780 test/py/ganeti.ssh_unittest.py \
1781 test/py/ganeti.storage.bdev_unittest.py \
1782 test/py/ganeti.storage.container_unittest.py \
1783 test/py/ganeti.storage.drbd_unittest.py \
1784 test/py/ganeti.storage.filestorage_unittest.py \
1785 test/py/ganeti.storage.gluster_unittest.py \
1786 test/py/ganeti.tools.burnin_unittest.py \
1787 test/py/ganeti.tools.ensure_dirs_unittest.py \
1788 test/py/ganeti.tools.node_daemon_setup_unittest.py \
1789 test/py/ganeti.tools.prepare_node_join_unittest.py \
1790 test/py/ganeti.uidpool_unittest.py \
1791 test/py/ganeti.utils.algo_unittest.py \
1792 test/py/ganeti.utils.filelock_unittest.py \
1793 test/py/ganeti.utils.hash_unittest.py \
1794 test/py/ganeti.utils.io_unittest-runasroot.py \
1795 test/py/ganeti.utils.io_unittest.py \
1796 test/py/ganeti.utils.log_unittest.py \
1797 test/py/ganeti.utils.lvm_unittest.py \
1798 test/py/ganeti.utils.mlock_unittest.py \
1799 test/py/ganeti.utils.nodesetup_unittest.py \
1800 test/py/ganeti.utils.process_unittest.py \
1801 test/py/ganeti.utils.retry_unittest.py \
1802 test/py/ganeti.utils.security_unittest.py \
1803 test/py/ganeti.utils.storage_unittest.py \
1804 test/py/ganeti.utils.text_unittest.py \
1805 test/py/ganeti.utils.version_unittest.py \
1806 test/py/ganeti.utils.wrapper_unittest.py \
1807 test/py/ganeti.utils.x509_unittest.py \
1808 test/py/ganeti.utils_unittest.py \
1809 test/py/ganeti.vcluster_unittest.py \
1810 test/py/ganeti.workerpool_unittest.py \
1811 test/py/pycurl_reset_unittest.py \
1812 test/py/qa.qa_config_unittest.py \
1813 test/py/tempfile_fork_unittest.py
1815 python_test_support = \
1816 test/py/__init__.py \
1817 test/py/lockperf.py \
1818 test/py/testutils.py \
1820 test/py/cmdlib/__init__.py \
1821 test/py/cmdlib/testsupport/__init__.py \
1822 test/py/cmdlib/testsupport/cmdlib_testcase.py \
1823 test/py/cmdlib/testsupport/config_mock.py \
1824 test/py/cmdlib/testsupport/iallocator_mock.py \
1825 test/py/cmdlib/testsupport/livelock_mock.py \
1826 test/py/cmdlib/testsupport/netutils_mock.py \
1827 test/py/cmdlib/testsupport/pathutils_mock.py \
1828 test/py/cmdlib/testsupport/processor_mock.py \
1829 test/py/cmdlib/testsupport/rpc_runner_mock.py \
1830 test/py/cmdlib/testsupport/ssh_mock.py \
1831 test/py/cmdlib/testsupport/utils_mock.py \
1832 test/py/cmdlib/testsupport/util.py \
1833 test/py/cmdlib/testsupport/wconfd_mock.py
1835 haskell_tests = test/hs/htest
1838 test/py/check-cert-expired_unittest.bash \
1839 test/py/daemon-util_unittest.bash \
1840 test/py/systemd_unittest.bash \
1841 test/py/ganeti-cleaner_unittest.bash \
1842 test/py/import-export_unittest.bash \
1843 test/py/cli-test.bash \
1844 test/py/bash_completion.bash
1847 dist_TESTS += $(python_tests)
1854 nodist_TESTS += $(haskell_tests)
1856 test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
1857 dist_TESTS += test/hs/offline-test.sh
1859 test/hs/hpc-htools \
1860 test/hs/hpc-mon-collector \
1861 $(HS_BUILT_TEST_HELPERS)
1864 TESTS = $(dist_TESTS) $(nodist_TESTS)
1866 # Environment for all tests
1867 PLAIN_TESTS_ENVIRONMENT = \
1868 PYTHONPATH=.:./test/py \
1869 TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1870 PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1873 # Environment for tests run by automake
1874 TESTS_ENVIRONMENT = \
1875 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1878 $(dist_sbin_SCRIPTS) \
1880 $(pkglib_python_scripts) \
1881 $(nodist_pkglib_python_scripts) \
1882 $(nodist_tools_python_scripts) \
1883 $(pkgpython_PYTHON) \
1886 $(hypervisor_PYTHON) \
1887 $(hypervisor_hv_kvm_PYTHON) \
1893 $(rpc_stub_PYTHON) \
1905 all_python_code += $(python_tests)
1906 all_python_code += $(python_test_support)
1911 test/py/check-cert-expired_unittest.bash \
1912 test/py/daemon-util_unittest.bash \
1913 test/py/systemd_unittest.bash \
1914 test/py/ganeti-cleaner_unittest.bash \
1915 test/py/import-export_unittest.bash \
1916 test/py/cli-test.bash \
1917 test/py/bash_completion.bash \
1918 test/hs/offline-test.sh \
1919 test/hs/cli-tests-defs.sh \
1920 $(all_python_code) \
1921 $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1924 check_python_code = \
1925 $(BUILD_BASH_COMPLETION) \
1931 lint_python_code = \
1933 ganeti/http/server.py \
1934 $(dist_sbin_SCRIPTS) \
1936 $(pkglib_python_scripts) \
1937 $(BUILD_BASH_COMPLETION) \
1941 $(gnt_python_sbin_SCRIPTS) \
1944 standalone_python_modules = \
1945 lib/rapi/client.py \
1946 tools/ganeti-listrunner
1948 pep8_python_code = \
1950 ganeti/http/server.py \
1951 $(dist_sbin_SCRIPTS) \
1953 $(pkglib_python_scripts) \
1954 $(BUILD_BASH_COMPLETION) \
1957 $(PYTHON_BOOTSTRAP) \
1958 $(gnt_python_sbin_SCRIPTS) \
1960 $(python_test_support)
1962 test/py/daemon-util_unittest.bash: daemons/daemon-util
1964 test/py/systemd_unittest.bash: daemons/daemon-util $(BUILT_EXAMPLES)
1966 test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1968 test/py/bash_completion.bash: doc/examples/bash_completion-debug
1970 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1971 sed -f $(REPLACE_VARS_SED) < $< > $@
1974 tools/kvm-ifup-os: tools/ifup-os.in $(REPLACE_VARS_SED)
1975 sed -f $(REPLACE_VARS_SED) -e "s/ifup-os:/kvm-ifup-os:/" < $< > $@
1978 tools/xen-ifup-os: tools/ifup-os.in $(REPLACE_VARS_SED)
1979 sed -f $(REPLACE_VARS_SED) -e "s/ifup-os:/xen-ifup-os:/" < $< > $@
1982 tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
1983 sed -f $(REPLACE_VARS_SED) < $< > $@
1986 tools/vif-ganeti-metad: tools/vif-ganeti-metad.in $(REPLACE_VARS_SED)
1987 sed -f $(REPLACE_VARS_SED) < $< > $@
1990 tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
1991 sed -f $(REPLACE_VARS_SED) < $< > $@
1994 tools/users-setup: Makefile $(userspecs)
1996 { echo '#!/bin/sh'; \
1997 echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
1998 echo 'then echo "This will do the following changes"'; \
1999 $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
2000 END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \
2001 $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \
2002 else {print "echo + Will add user",$$1}; count++}\
2003 END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \
2004 $(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \
2006 echo 'echo "OK? (y/n)"'; \
2007 echo 'read confirm'; \
2008 echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
2010 $(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
2011 $(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
2012 $(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
2016 tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
2017 sed -f $(REPLACE_VARS_SED) < $< > $@
2020 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
2021 sed -f $(REPLACE_VARS_SED) < $< > $@
2024 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
2025 sed -f $(REPLACE_VARS_SED) < $< > $@
2027 doc/examples/bash_completion: BC_ARGS = --compact
2028 doc/examples/bash_completion-debug: BC_ARGS =
2030 doc/examples/bash_completion doc/examples/bash_completion-debug: \
2031 $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
2032 lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
2033 daemons/ganeti-cleaner \
2034 $(GENERATED_FILES) $(HS_GENERATED_FILES)
2035 PYTHONPATH=. $(RUN_IN_TEMPDIR) \
2036 $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
2038 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
2039 lib/build/shell_example_lexer.py \
2040 | $(RUN_IN_TEMPDIR) $(built_python_sources)
2041 @echo "Checking $< for hardcoded paths..."
2042 @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
2043 echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
2047 trap 'echo auto-removing $@; rm $@' EXIT; \
2048 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
2049 $(CHECK_MAN_REFERENCES) $@; \
2052 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
2053 @test -n "$(PANDOC)" || \
2054 { echo 'pandoc' not found during configure; exit 1; }
2055 set -o pipefail -e; \
2056 trap 'echo auto-removing $@; rm $@' EXIT; \
2057 $(PANDOC) -s -f rst -t man $< man/footer.rst | \
2058 sed -e 's/\\@/@/g' > $@; \
2059 if test -n "$(MAN_HAS_WARNINGS)"; then LC_ALL=en_US.UTF-8 $(CHECK_MAN_WARNINGS) $@; fi; \
2060 $(CHECK_MAN_DASHES) $@; \
2063 man/%.html.in: man/%.gen man/footer.rst
2064 @test -n "$(PANDOC)" || \
2065 { echo 'pandoc' not found during configure; exit 1; }
2067 $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
2068 sed -e 's/\\@/@/g' > $@
2070 man/%: man/%.in $(REPLACE_VARS_SED)
2071 sed -f $(REPLACE_VARS_SED) < $< > $@
2073 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
2074 sed -f $(REPLACE_VARS_SED) < $< > $@
2077 if test -d .git; then \
2078 git describe > $@; \
2079 elif test ! -f $@ ; then \
2080 echo "Cannot auto-generate $@ file"; exit 1; \
2083 .PHONY: clean-vcs-version
2087 .PHONY: regen-vcs-version
2091 if test -d .git; then \
2092 T=`mktemp` ; trap 'rm -f $$T' EXIT; \
2093 git describe > $$T; \
2094 if ! cmp --quiet $$T vcs-version; then \
2095 mv $$T vcs-version; \
2099 src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
2100 vcs-version $(built_base_sources)
2102 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
2103 sed -e "s/%ver%/$$VCSVER/" < $< > $@
2105 src/Ganeti/Hs2Py/ListConstants.hs: src/Ganeti/Hs2Py/ListConstants.hs.in \
2106 src/Ganeti/Constants.hs \
2110 ## Extract constant names from 'Constants.hs' by extracting the left
2111 ## side of all lines containing an equal sign (i.e., '=') and
2112 ## prepending the apostrophe sign (i.e., "'").
2114 ## For example, the constant
2115 ## adminstDown = ...
2118 NAMES=$$(sed -e "/^--/ d" $(abs_top_srcdir)/src/Ganeti/Constants.hs |\
2119 sed -n -e "/=/ s/\(.*\) =.*/ '\1:/g p"); \
2120 m4 -DPY_CONSTANT_NAMES="$$NAMES" \
2121 $(abs_top_srcdir)/src/Ganeti/Hs2Py/ListConstants.hs.in > $@
2123 src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
2126 test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
2127 $(built_base_sources)
2131 for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
2132 echo "import $$name ()" ; \
2136 lib/_constants.py: Makefile src/hs2py lib/_constants.py.in | stamp-directories
2137 cat $(abs_top_srcdir)/lib/_constants.py.in > $@
2138 src/hs2py --constants >> $@
2140 lib/constants.py: lib/_constants.py
2142 src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
2143 | $(built_base_sources)
2145 @m4 -DPACKAGE_VERSION="$(PACKAGE_VERSION)" \
2146 -DVERSION_MAJOR="$(VERSION_MAJOR)" \
2147 -DVERSION_MINOR="$(VERSION_MINOR)" \
2148 -DVERSION_REVISION="$(VERSION_REVISION)" \
2149 -DVERSION_SUFFIX="$(VERSION_SUFFIX)" \
2150 -DVERSION_FULL="$(VERSION_FULL)" \
2151 -DDIRVERSION="$(DIRVERSION)" \
2152 -DLOCALSTATEDIR="$(localstatedir)" \
2153 -DSYSCONFDIR="$(sysconfdir)" \
2154 -DSSH_CONFIG_DIR="$(SSH_CONFIG_DIR)" \
2155 -DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \
2156 -DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \
2157 -DEXPORT_DIR="$(EXPORT_DIR)" \
2158 -DBACKUP_DIR="$(backup_dir)" \
2159 -DOS_SEARCH_PATH="\"$(OS_SEARCH_PATH)\"" \
2160 -DES_SEARCH_PATH="\"$(ES_SEARCH_PATH)\"" \
2161 -DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \
2162 -DXEN_CONFIG_DIR="$(XEN_CONFIG_DIR)" \
2163 -DXEN_KERNEL="$(XEN_KERNEL)" \
2164 -DXEN_INITRD="$(XEN_INITRD)" \
2165 -DKVM_KERNEL="$(KVM_KERNEL)" \
2166 -DSHARED_FILE_STORAGE_DIR="$(SHARED_FILE_STORAGE_DIR)" \
2167 -DIALLOCATOR_SEARCH_PATH="\"$(IALLOCATOR_SEARCH_PATH)\"" \
2168 -DKVM_PATH="$(KVM_PATH)" \
2169 -DIP_PATH="$(IP_PATH)" \
2170 -DSOCAT_PATH="$(SOCAT)" \
2171 -DPYTHON_PATH="$(PYTHON)" \
2172 -DSOCAT_USE_ESCAPE="$(SOCAT_USE_ESCAPE)" \
2173 -DSOCAT_USE_COMPRESS="$(SOCAT_USE_COMPRESS)" \
2174 -DLVM_STRIPECOUNT="$(LVM_STRIPECOUNT)" \
2175 -DTOOLSDIR="$(libdir)/ganeti/tools" \
2176 -DGNT_SCRIPTS="$(foreach i,$(notdir $(gnt_scripts)),\"$(i)\":)" \
2177 -DHS_HTOOLS_PROGS="$(foreach i,$(HS_HTOOLS_PROGS),\"$(i)\":)" \
2178 -DPKGLIBDIR="$(libdir)/ganeti" \
2179 -DSHAREDIR="$(prefix)/share/ganeti" \
2180 -DVERSIONEDSHAREDIR="$(versionedsharedir)" \
2181 -DDRBD_BARRIERS="$(DRBD_BARRIERS)" \
2182 -DDRBD_NO_META_FLUSH="$(DRBD_NO_META_FLUSH)" \
2183 -DSYSLOG_USAGE="$(SYSLOG_USAGE)" \
2184 -DDAEMONS_GROUP="$(DAEMONS_GROUP)" \
2185 -DADMIN_GROUP="$(ADMIN_GROUP)" \
2186 -DMASTERD_USER="$(MASTERD_USER)" \
2187 -DMASTERD_GROUP="$(MASTERD_GROUP)" \
2188 -DMETAD_USER="$(METAD_USER)" \
2189 -DMETAD_GROUP="$(METAD_GROUP)" \
2190 -DRAPI_USER="$(RAPI_USER)" \
2191 -DRAPI_GROUP="$(RAPI_GROUP)" \
2192 -DCONFD_USER="$(CONFD_USER)" \
2193 -DCONFD_GROUP="$(CONFD_GROUP)" \
2194 -DWCONFD_USER="$(WCONFD_USER)" \
2195 -DWCONFD_GROUP="$(WCONFD_GROUP)" \
2196 -DKVMD_USER="$(KVMD_USER)" \
2197 -DKVMD_GROUP="$(KVMD_GROUP)" \
2198 -DLUXID_USER="$(LUXID_USER)" \
2199 -DLUXID_GROUP="$(LUXID_GROUP)" \
2200 -DNODED_USER="$(NODED_USER)" \
2201 -DNODED_GROUP="$(NODED_GROUP)" \
2202 -DMOND_USER="$(MOND_USER)" \
2203 -DMOND_GROUP="$(MOND_GROUP)" \
2204 -DDISK_SEPARATOR="$(DISK_SEPARATOR)" \
2205 -DQEMUIMG_PATH="$(QEMUIMG_PATH)" \
2206 -DENABLE_CONFD="$(ENABLE_CONFD)" \
2207 -DXEN_CMD="$(XEN_CMD)" \
2208 -DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
2209 -DENABLE_METADATA="$(ENABLE_METADATA)" \
2210 -DENABLE_MOND="$(ENABLE_MOND)" \
2211 -DHAS_GNU_LN="$(HAS_GNU_LN)" \
2212 -DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \
2213 echo -n "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/("\1",\2):/g'; \
2215 -DAF_INET4="$$(PYTHONPATH=. $(PYTHON) $(PRINT_PY_CONSTANTS) AF_INET4)" \
2216 -DAF_INET6="$$(PYTHONPATH=. $(PYTHON) $(PRINT_PY_CONSTANTS) AF_INET6)" \
2217 $(abs_top_srcdir)/src/AutoConf.hs.in > $@
2219 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
2221 VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
2222 { echo '# This file is automatically generated, do not edit!'; \
2225 echo '"""Build-time VCS version number for Ganeti.'; \
2227 echo 'This file is autogenerated by the build process.'; \
2228 echo 'For any changes you need to re-run ./configure (and'; \
2229 echo 'not edit by hand).'; \
2233 echo '# pylint: disable=C0301,C0324'; \
2234 echo '# because this is autogenerated, we do not want'; \
2235 echo '# style warnings' ; \
2237 echo "VCS_VERSION = '$$VCSVER'"; \
2240 lib/opcodes.py: Makefile src/hs2py lib/opcodes.py.in_before \
2241 lib/opcodes.py.in_after | stamp-directories
2242 cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
2243 src/hs2py --opcodes >> $@
2244 cat $(abs_top_srcdir)/lib/opcodes.py.in_after >> $@
2246 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
2247 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
2249 lib/rpc/stub/wconfd.py: Makefile src/hs2py | stamp-directories
2250 src/hs2py --wconfd-rpc > $@
2252 $(SHELL_ENV_INIT): Makefile stamp-directories
2254 { echo '# Allow overriding for tests'; \
2255 echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
2256 echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
2258 echo 'readonly PKGLIBDIR=$(libdir)/ganeti'; \
2259 echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
2260 echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
2261 echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
2262 echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
2265 ## Writes sed script to replace placeholders with build-time values. The
2266 ## additional quotes after the first @ sign are necessary to stop configure
2267 ## from replacing those values as well.
2268 $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
2270 { echo 's#@''PREFIX@#$(prefix)#g'; \
2271 echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
2272 echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
2273 echo 's#@''BINDIR@#$(BINDIR)#g'; \
2274 echo 's#@''SBINDIR@#$(SBINDIR)#g'; \
2275 echo 's#@''LIBDIR@#$(libdir)#g'; \
2276 echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
2277 echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
2278 echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
2279 echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
2280 echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
2281 echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
2282 echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
2283 echo 's#@''PKGLIBDIR@#$(libdir)/ganeti#g'; \
2284 echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
2285 echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
2286 echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
2287 echo 's#@''GNTWCONFDUSER@#$(WCONFD_USER)#g'; \
2288 echo 's#@''GNTLUXIDUSER@#$(LUXID_USER)#g'; \
2289 echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
2290 echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
2291 echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
2292 echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
2293 echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
2294 echo 's#@''GNTNODEDGROUP@#$(NODED_GROUP)#g'; \
2295 echo 's#@''GNTWCONFDGROUP@#$(CONFD_GROUP)#g'; \
2296 echo 's#@''GNTLUXIDGROUP@#$(LUXID_GROUP)#g'; \
2297 echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
2298 echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
2299 echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
2300 echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
2301 echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
2302 echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
2303 echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
2305 echo '/^@SHELL_ENV_INIT@$$/ {'; \
2306 echo ' r $(SHELL_ENV_INIT)'; \
2311 # Using deferred evaluation
2312 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
2313 daemons/ganeti-watcher: MODULE = ganeti.watcher
2314 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
2315 tools/burnin: MODULE = ganeti.tools.burnin
2316 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
2317 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
2318 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
2319 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
2320 tools/ssl-update: MODULE = ganeti.tools.ssl_update
2321 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
2323 $(PYTHON_BOOTSTRAP) $(gnt_scripts) $(gnt_python_sbin_SCRIPTS): Makefile | stamp-directories
2324 test -n "$(MODULE)" || { echo Missing module; exit 1; }
2326 { echo '#!${PYTHON}'; \
2327 echo '# This file is automatically generated, do not edit!'; \
2328 echo "# Edit $(MODULE) instead."; \
2330 echo '"""Bootstrap script for L{$(MODULE)}"""'; \
2332 echo '# pylint: disable=C0103'; \
2333 echo '# C0103: Invalid name'; \
2335 echo 'import sys'; \
2336 echo 'import $(MODULE) as main'; \
2338 echo '# Temporarily alias commands until bash completion'; \
2339 echo '# generator is changed'; \
2340 echo 'if hasattr(main, "commands"):'; \
2341 echo ' commands = main.commands # pylint: disable=E1101'; \
2342 echo 'if hasattr(main, "aliases"):'; \
2343 echo ' aliases = main.aliases # pylint: disable=E1101'; \
2345 echo 'if __name__ == "__main__":'; \
2346 echo ' sys.exit(main.Main())'; \
2350 $(HS_BUILT_TEST_HELPERS): Makefile
2351 @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
2353 { echo '#!/bin/sh'; \
2354 echo '# This file is automatically generated, do not edit!'; \
2355 echo "# Edit Makefile.am instead."; \
2357 echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
2361 stamp-directories: Makefile
2362 $(MAKE) $(AM_MAKEFLAGS) ganeti
2363 @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
2366 # We need to create symlinks because "make distcheck" will not install Python
2367 # files when building.
2368 stamp-srclinks: Makefile | stamp-directories
2370 for i in $(srclink_files); do \
2371 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
2372 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
2379 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
2382 check-dirs: $(GENERATED_FILES)
2384 find . -type d \( -name . -o -name .git -prune -o -print \) | { \
2386 while read dir; do \
2388 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
2389 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
2392 for dir in $(DIRS); do \
2393 if ! test -d "$$dir"; then \
2394 echo "Directory $$dir listed in DIRS does not exist" >&2; \
2398 test -z "$$error"; \
2403 RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
2406 check-local: check-dirs check-news $(GENERATED_FILES)
2407 $(CHECK_PYTHON_CODE) $(check_python_code)
2408 PYTHONPATH=. $(CHECK_HEADER) \
2409 $(filter-out $(GENERATED_FILES),$(check_python_code))
2410 $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
2411 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
2413 if [ "x`echo $(VERSION_SUFFIX)|grep 'alpha'`" == "x" ]; then \
2414 expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
2415 if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
2416 echo "Incorrect version in README, expected $$expver" >&2; \
2419 for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
2420 doc/security.rst; do \
2421 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
2422 "Documents Ganeti version $$expver"; then \
2423 echo "Incorrect version in $$file, expected $$expver" >&2; \
2427 if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
2428 echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
2431 if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
2432 ".. Last updated for Ganeti $$expver"; then \
2433 echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
2437 for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
2438 if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
2439 echo "Longest line in $$file is longer than 80 characters" >&2; \
2446 hs-test-%: test/hs/htest
2451 hs-tests: test/hs/htest
2456 py-tests: $(python_tests) ganeti $(built_python_sources)
2458 for file in $(python_tests); \
2459 do if ! $(TESTS_ENVIRONMENT) $$file; then error=1; fi; \
2464 hs-shell-%: test/hs/hpc-htools test/hs/hpc-mon-collector \
2465 $(HS_BUILT_TEST_HELPERS)
2466 @rm -f hpc-htools.tix hpc-mon-collector.tix
2467 HBINARY="./test/hs/hpc-htools" \
2468 SHELLTESTARGS=$(SHELLTESTARGS) \
2469 ./test/hs/offline-test.sh $*
2472 hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
2473 @rm -f hpc-htools.tix hpc-mon-collector.tix
2474 HBINARY="./test/hs/hpc-htools" \
2475 SHELLTESTARGS=$(SHELLTESTARGS) \
2476 ./test/hs/offline-test.sh
2479 hs-check: hs-tests hs-shell
2481 # E111: indentation is not a multiple of four
2482 # E121: continuation line indentation is not a multiple of four
2483 # (since our indent level is not 4)
2484 # E125: continuation line does not distinguish itself from next logical line
2485 # (since our indent level is not 4)
2486 # E123: closing bracket does not match indentation of opening bracket's line
2487 # E127: continuation line over-indented for visual indent
2488 # (since our indent level is not 4)
2489 # note: do NOT add E128 here; it's a valid style error in most cases!
2490 # I've seen real errors, but also some cases were we indent wrongly
2491 # due to line length; try to rework the cases where it is triggered,
2492 # instead of silencing it
2493 # E261: at least two spaces before inline comment
2494 # E501: line too long (80 characters)
2495 PEP8_IGNORE = E111,E121,E123,E125,E127,E261,E501
2497 # For excluding pep8 expects filenames only, not whole paths
2498 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(built_python_sources))))
2500 # A space-separated list of pylint warnings to completely ignore:
2501 # I0013 = disable warnings for ignoring whole files
2502 LINT_DISABLE = I0013
2503 # Additional pylint options
2505 # The combined set of pylint options
2506 LINT_OPTS_ALL = $(LINT_OPTS) \
2507 $(addprefix --disable=,$(LINT_DISABLE))
2509 LINT_TARGETS = pylint pylint-qa pylint-test
2511 LINT_TARGETS += pep8
2514 LINT_TARGETS += hlint
2518 lint: $(LINT_TARGETS)
2521 pylint: $(GENERATED_FILES)
2522 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2523 $(PYLINT) $(LINT_OPTS_ALL) $(lint_python_code)
2526 pylint-qa: $(GENERATED_FILES)
2527 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2528 cd $(top_srcdir)/qa && \
2529 PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS_ALL) \
2530 --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
2531 # FIXME: lint all test code, not just the newly added test support
2532 pylint-test: $(GENERATED_FILES)
2533 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2534 cd $(top_srcdir) && \
2535 PYTHONPATH=.:./test/py $(PYLINT) $(LINT_OPTS_ALL) \
2536 --rcfile=pylintrc-test $(python_test_support)
2539 pep8: $(GENERATED_FILES)
2540 @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
2541 $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
2542 --repeat $(pep8_python_code)
2544 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
2545 HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
2547 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
2548 @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
2549 @rm -f doc/hs-lint.html
2550 if tty -s; then C="-c"; else C=""; fi; \
2551 $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
2552 --ignore "Use first" \
2553 --ignore "Use &&&" \
2555 --ignore "Use void" \
2556 --ignore "Reduce duplication" \
2557 --hint src/lint-hints \
2558 $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
2559 @if [ ! -f doc/hs-lint.html ]; then \
2560 echo "All good" > doc/hs-lint.html; \
2563 # a dist hook rule for updating the vcs-version file; this is
2564 # hardcoded due to where it needs to build the file...
2566 $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
2567 rm -f $(top_distdir)/vcs-version
2568 cp -p $(srcdir)/vcs-version $(top_distdir)
2570 # a distcheck hook rule for catching revision control directories
2572 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
2573 echo "Found revision control files in final archive." 1>&2; \
2576 if find $(top_distdir) -name '*.py[co]' | grep .; then \
2577 echo "Found Python byte code in final archive." 1>&2; \
2580 if find $(top_distdir) -name '*~' | grep .; then \
2581 echo "Found backup files in final archive." 1>&2; \
2584 # Empty files or directories should not be distributed. They can cause
2585 # unnecessary warnings for packagers. Directories used by automake during
2586 # distcheck must be excluded.
2587 if find $(top_distdir) -empty -and -not \( \
2588 -path $(top_distdir)/_build -or \
2589 -path $(top_distdir)/_inst \) | grep .; then \
2590 echo "Found empty files or directories in final archive." 1>&2; \
2593 if test -e $(top_distdir)/doc/man-html; then \
2594 echo "Found documentation including man pages in final archive" >&2; \
2598 # Backwards compatible distcheck-release target
2599 distcheck-release: distcheck
2601 distrebuildcheck: dist
2603 builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
2604 trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
2606 tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
2609 $(MAKE) maintainer-clean; \
2610 cp $(abs_srcdir)/vcs-version .; \
2612 $(MAKE) $(AM_MAKEFLAGS)
2616 for i in $(DIST_ARCHIVES); do \
2617 echo -n "Checking $$i ... "; \
2618 autotools/check-tar < $$i; \
2623 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
2624 "$(DESTDIR)${localstatedir}/log/ganeti" \
2625 "$(DESTDIR)${localstatedir}/run/ganeti"
2626 for dir in $(SYMLINK_TARGET_DIRS); do \
2627 @mkdir_p@ $(DESTDIR)$$dir; \
2629 $(LN_S) -f $(sysconfdir)/ganeti/lib $(DESTDIR)$(defaultversiondir)
2630 $(LN_S) -f $(sysconfdir)/ganeti/share $(DESTDIR)$(defaultversionedsharedir)
2631 for prog in $(HS_BIN_ROLES); do \
2632 $(LN_S) -f $(defaultversiondir)$(BINDIR)/$$prog $(DESTDIR)$(BINDIR)/$$prog; \
2634 $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
2635 for prog in $(all_sbin_scripts); do \
2636 $(LN_S) -f $(defaultversiondir)$(SBINDIR)/$$prog $(DESTDIR)$(SBINDIR)/$$prog; \
2638 for prog in $(gnt_scripts_basenames); do \
2639 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(SBINDIR)/$$prog; \
2641 for prog in $(pkglib_python_basenames); do \
2642 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2644 for prog in $(tools_python_basenames); do \
2645 $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2647 for prog in $(tools_basenames); do \
2648 $(LN_S) -f $(defaultversiondir)/$(libdir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2650 if ! test -n '$(ENABLE_MANPAGES)'; then \
2651 for man in $(manfullpath); do \
2652 $(LN_S) -f $(defaultversionedsharedir)/root$(MANDIR)/$$man $(DESTDIR)$(MANDIR)/$$man; \
2655 for prog in $(myexeclib_scripts_basenames); do \
2656 $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2659 $(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share
2660 $(LN_S) -f $(versiondir) $(DESTDIR)$(sysconfdir)/ganeti/lib
2665 apidoc: py-apidoc hs-apidoc
2671 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
2672 env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
2673 $(RUN_IN_TEMPDIR) epydoc -v \
2674 --conf $(CURDIR)/epydoc.conf \
2675 --output $(CURDIR)/$(APIDOC_PY_DIR)
2678 hs-apidoc: $(APIDOC_HS_DIR)/index.html
2680 $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
2681 @test -n "$(HSCOLOUR)" || \
2682 { echo 'HsColour' not found during configure; exit 1; }
2683 @test -n "$(HADDOCK)" || \
2684 { echo 'haddock' not found during configure; exit 1; }
2685 rm -rf $(APIDOC_HS_DIR)/*
2686 for i in $(ALL_APIDOC_HS_DIRS); do \
2688 $(HSCOLOUR) -print-css > $$i/hscolour.css; \
2691 export LC_ALL=en_US.UTF-8; \
2692 OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
2693 if [ "$(HS_PARALLEL3)" ]; \
2694 then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
2696 if [ "$(HS_REGEX_PCRE)" ]; \
2697 then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
2699 for file in $(HS_LIBTESTBUILT_SRCS); do \
2700 f_nosrc=$${file##src/}; \
2701 f_notst=$${f_nosrc##test/hs/}; \
2702 f_html=$${f_notst%%.hs}.html; \
2703 $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
2705 $(HADDOCK) --odir $(APIDOC_HS_DIR) --html --hoogle --ignore-all-exports -w \
2706 -t ganeti -p src/haddock-prologue \
2707 --source-module="%{MODULE/.//}.html" \
2708 --source-entity="%{MODULE/.//}.html#%{NAME}" \
2710 $(HS_LIBTESTBUILT_SRCS)
2713 TAGS: $(GENERATED_FILES) hs-pkg-versions
2715 $(GHC) -e ":etags TAGS_hs" -v0 \
2716 $(filter-out -O -Werror,$(HFLAGS)) \
2717 $(shell cat hs-pkg-versions) \
2721 $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
2723 find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
2724 -path './daemons/ganeti-*' -o -path './tools/*' -o \
2725 -path './qa/*.py' | \
2726 etags --etags-include=TAGS_hs -L -
2732 COVERAGE_TESTS += hs-coverage
2735 COVERAGE_TESTS += py-coverage
2738 coverage: $(COVERAGE_TESTS)
2740 test/py/docs_unittest.py: $(gnt_scripts)
2743 py-coverage: $(GENERATED_FILES) $(python_tests)
2744 @test -n "$(PYCOVERAGE)" || \
2745 { echo 'python-coverage' not found during configure; exit 1; }
2747 COVERAGE=$(PYCOVERAGE) \
2748 COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2749 TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2750 HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2751 $(PLAIN_TESTS_ENVIRONMENT) \
2752 $(abs_top_srcdir)/autotools/gen-py-coverage \
2756 hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2758 $(MAKE) $(AM_MAKEFLAGS) hs-check
2759 @mkdir_p@ $(COVERAGE_HS_DIR)
2760 hpc sum --union $(HPCEXCL) \
2761 htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2762 hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2763 hpc report coverage-hs.tix | tee $(COVERAGE_HS_DIR)/report.txt
2764 $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2766 # Special "kind-of-QA" target for htools, needs special setup (all
2767 # tools compiled with -fhpc)
2772 rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2773 rm -f *.tix *.mix; \
2775 hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2776 --output=live-test.tix ; \
2777 @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2778 hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2779 --srcdir=.. $(HPCEXCL) ; \
2780 hpc report --srcdir=.. live-test $(HPCEXCL)
2782 commit-check: autotools-check distcheck lint apidoc
2785 TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
2786 $(abs_top_srcdir)/test/autotools/*-*.test \
2789 .PHONY: gitignore-check
2791 @if [ -n "`git status --short`" ]; then \
2792 echo "Git status is not clean!" 1>&2 ; \
2793 git status --short; \
2797 # target to rebuild all man pages (both groff and html output)
2799 man: $(man_MANS) $(manhtml)
2801 # Target that builds all binaries (including those that are not
2802 # rebuilt except when running the tests)
2804 really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2806 # we don't need the ancient implicit rules:
2813 -include ./Makefile.local
2815 # support inspecting the value of a make variable