Fix typo in the DRBD parser types file
[ganeti-local] / Makefile.am
index 0b0bfe7..871f73f 100644 (file)
@@ -23,6 +23,7 @@ RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
 CHECK_HEADER = $(top_srcdir)/autotools/check-header
 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
+CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
 CHECK_VERSION = $(top_srcdir)/autotools/check-version
 CHECK_NEWS = $(top_srcdir)/autotools/check-news
@@ -65,15 +66,15 @@ HS_DIRS = \
        src/Ganeti/HTools/Backend \
        src/Ganeti/HTools/Program \
        src/Ganeti/Query \
-       htest \
-       htest/Test \
-       htest/Test/Ganeti \
-       htest/Test/Ganeti/Block \
-       htest/Test/Ganeti/Block/Drbd \
-       htest/Test/Ganeti/Confd \
-       htest/Test/Ganeti/HTools \
-       htest/Test/Ganeti/HTools/Backend \
-       htest/Test/Ganeti/Query
+       test/hs \
+       test/hs/Test \
+       test/hs/Test/Ganeti \
+       test/hs/Test/Ganeti/Block \
+       test/hs/Test/Ganeti/Block/Drbd \
+       test/hs/Test/Ganeti/Confd \
+       test/hs/Test/Ganeti/HTools \
+       test/hs/Test/Ganeti/HTools/Backend \
+       test/hs/Test/Ganeti/Query
 
 DIRS = \
        $(HS_DIRS) \
@@ -81,12 +82,13 @@ DIRS = \
        daemons \
        devel \
        doc \
+       doc/css \
        doc/examples \
        doc/examples/gnt-debug \
        doc/examples/hooks \
-       htest/data \
-       htest/data/rapi \
-       htest/shelltests \
+       test/data/htools \
+       test/data/htools/rapi \
+       test/hs/shelltests \
        lib \
        lib/build \
        lib/client \
@@ -150,7 +152,6 @@ APIDOC_PY_DIR = $(APIDOC_DIR)/py
 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
 
 MAINTAINERCLEANFILES = \
-       $(docpng) \
        $(maninput) \
        doc/install-quick.rst \
        doc/news.rst \
@@ -184,7 +185,7 @@ CLEANFILES = \
        $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
        $(HS_BUILT_TEST_HELPERS) \
        src/ganeti-confd \
-       .hpc/*.mix src/*.tix htest/*.tix \
+       .hpc/*.mix src/*.tix test/hs/*.tix \
        doc/hs-lint.html
 
 GENERATED_FILES = \
@@ -409,20 +410,33 @@ docrst = \
        doc/virtual-cluster.rst \
        doc/walkthrough.rst
 
-HS_PROGS = src/htools src/mon-collector
+# Haskell programs to be installed in $PREFIX/bin
+HS_BIN_PROGS=src/htools
+
+# Haskell programs to be installed in the MYEXECLIB dir
+HS_MYEXECLIB_PROGS=src/mon-collector
+
+# Haskell programs to compiled but not installed automatically
+# Usually they have their own specific installation rules
+HS_COMPILE_PROGS= \
+       src/hconfd \
+       src/rpc-test
+
+# All Haskell non-test programs to be compiled but not automatically installed
+HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
+
 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck hroller
 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
 
 HS_ALL_PROGS = \
        $(HS_PROGS) \
-       htest/hpc-htools \
-       htest/hpc-mon-collector \
-       htest/test \
-       src/hconfd \
-       src/rpc-test
+       test/hs/hpc-htools \
+       test/hs/hpc-mon-collector \
+       test/hs/htest \
+       $(HS_COMPILE_PROGS)
 
 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
-HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
+HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
 
 HFLAGS = \
        -O -Wall -Werror -isrc \
@@ -432,7 +446,7 @@ HFLAGS = \
 
 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
 HEXTRA =
-# internal extra flags (used for htest/test mainly)
+# internal extra flags (used for test/hs/htest mainly)
 HEXTRA_INT =
 # exclude options for coverage reports
 HPCEXCL = --exclude Main \
@@ -478,7 +492,6 @@ HS_LIB_SRCS = \
        src/Ganeti/HTools/Loader.hs \
        src/Ganeti/HTools/Node.hs \
        src/Ganeti/HTools/PeerMap.hs \
-       src/Ganeti/HTools/Program.hs \
        src/Ganeti/HTools/Program/Hail.hs \
        src/Ganeti/HTools/Program/Hbal.hs \
        src/Ganeti/HTools/Program/Hcheck.hs \
@@ -486,6 +499,7 @@ HS_LIB_SRCS = \
        src/Ganeti/HTools/Program/Hscan.hs \
        src/Ganeti/HTools/Program/Hspace.hs \
        src/Ganeti/HTools/Program/Hroller.hs \
+       src/Ganeti/HTools/Program/Main.hs \
        src/Ganeti/HTools/Types.hs \
        src/Ganeti/Hash.hs \
        src/Ganeti/JQueue.hs \
@@ -515,49 +529,49 @@ HS_LIB_SRCS = \
        src/Ganeti/Utils.hs
 
 HS_TEST_SRCS = \
-       htest/Test/Ganeti/Attoparsec.hs \
-       htest/Test/Ganeti/BasicTypes.hs \
-       htest/Test/Ganeti/Block/Drbd/Parser.hs \
-       htest/Test/Ganeti/Block/Drbd/Types.hs \
-       htest/Test/Ganeti/Common.hs \
-       htest/Test/Ganeti/Confd/Types.hs \
-       htest/Test/Ganeti/Confd/Utils.hs \
-       htest/Test/Ganeti/Daemon.hs \
-       htest/Test/Ganeti/Errors.hs \
-       htest/Test/Ganeti/HTools/Backend/Simu.hs \
-       htest/Test/Ganeti/HTools/Backend/Text.hs \
-       htest/Test/Ganeti/HTools/CLI.hs \
-       htest/Test/Ganeti/HTools/Cluster.hs \
-       htest/Test/Ganeti/HTools/Container.hs \
-       htest/Test/Ganeti/HTools/Graph.hs \
-       htest/Test/Ganeti/HTools/Instance.hs \
-       htest/Test/Ganeti/HTools/Loader.hs \
-       htest/Test/Ganeti/HTools/Node.hs \
-       htest/Test/Ganeti/HTools/PeerMap.hs \
-       htest/Test/Ganeti/HTools/Types.hs \
-       htest/Test/Ganeti/JSON.hs \
-       htest/Test/Ganeti/Jobs.hs \
-       htest/Test/Ganeti/JQueue.hs \
-       htest/Test/Ganeti/Luxi.hs \
-       htest/Test/Ganeti/Network.hs \
-       htest/Test/Ganeti/Objects.hs \
-       htest/Test/Ganeti/OpCodes.hs \
-       htest/Test/Ganeti/Query/Filter.hs \
-       htest/Test/Ganeti/Query/Language.hs \
-       htest/Test/Ganeti/Query/Query.hs \
-       htest/Test/Ganeti/Rpc.hs \
-       htest/Test/Ganeti/Ssconf.hs \
-       htest/Test/Ganeti/THH.hs \
-       htest/Test/Ganeti/TestCommon.hs \
-       htest/Test/Ganeti/TestHTools.hs \
-       htest/Test/Ganeti/TestHelper.hs \
-       htest/Test/Ganeti/Types.hs \
-       htest/Test/Ganeti/Utils.hs
+       test/hs/Test/Ganeti/Attoparsec.hs \
+       test/hs/Test/Ganeti/BasicTypes.hs \
+       test/hs/Test/Ganeti/Block/Drbd/Parser.hs \
+       test/hs/Test/Ganeti/Block/Drbd/Types.hs \
+       test/hs/Test/Ganeti/Common.hs \
+       test/hs/Test/Ganeti/Confd/Types.hs \
+       test/hs/Test/Ganeti/Confd/Utils.hs \
+       test/hs/Test/Ganeti/Daemon.hs \
+       test/hs/Test/Ganeti/Errors.hs \
+       test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
+       test/hs/Test/Ganeti/HTools/Backend/Text.hs \
+       test/hs/Test/Ganeti/HTools/CLI.hs \
+       test/hs/Test/Ganeti/HTools/Cluster.hs \
+       test/hs/Test/Ganeti/HTools/Container.hs \
+       test/hs/Test/Ganeti/HTools/Graph.hs \
+       test/hs/Test/Ganeti/HTools/Instance.hs \
+       test/hs/Test/Ganeti/HTools/Loader.hs \
+       test/hs/Test/Ganeti/HTools/Node.hs \
+       test/hs/Test/Ganeti/HTools/PeerMap.hs \
+       test/hs/Test/Ganeti/HTools/Types.hs \
+       test/hs/Test/Ganeti/JSON.hs \
+       test/hs/Test/Ganeti/Jobs.hs \
+       test/hs/Test/Ganeti/JQueue.hs \
+       test/hs/Test/Ganeti/Luxi.hs \
+       test/hs/Test/Ganeti/Network.hs \
+       test/hs/Test/Ganeti/Objects.hs \
+       test/hs/Test/Ganeti/OpCodes.hs \
+       test/hs/Test/Ganeti/Query/Filter.hs \
+       test/hs/Test/Ganeti/Query/Language.hs \
+       test/hs/Test/Ganeti/Query/Query.hs \
+       test/hs/Test/Ganeti/Rpc.hs \
+       test/hs/Test/Ganeti/Ssconf.hs \
+       test/hs/Test/Ganeti/THH.hs \
+       test/hs/Test/Ganeti/TestCommon.hs \
+       test/hs/Test/Ganeti/TestHTools.hs \
+       test/hs/Test/Ganeti/TestHelper.hs \
+       test/hs/Test/Ganeti/Types.hs \
+       test/hs/Test/Ganeti/Utils.hs
 
 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
 
 HS_BUILT_SRCS = \
-       htest/Test/Ganeti/TestImports.hs \
+       test/hs/Test/Ganeti/TestImports.hs \
        src/Ganeti/Constants.hs \
        src/Ganeti/Version.hs
 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
@@ -569,9 +583,10 @@ $(RUN_IN_TEMPDIR): | stamp-directories
 # has to exist in order for the sphinx module to be loaded
 # successfully, but we certainly don't want the docs to be rebuilt if
 # it changes
-doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
+doc/html/index.html: $(docrst) doc/conf.py configure.ac \
        $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
        lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
+       doc/css/style.css \
        | $(BUILT_PYTHON_SOURCES)
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
@@ -580,6 +595,7 @@ doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
            -d . \
            -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
            -D release="$(PACKAGE_VERSION)" \
+           -D graphviz_dot="$(DOT)" \
            $(abs_top_srcdir)/doc $(CURDIR)/doc/html
        rm -f doc/html/.buildinfo doc/html/objects.inv
        touch $@
@@ -598,13 +614,6 @@ doc/install-quick.rst doc/news.rst doc/upgrade.rst:
          cat $<; \
        } > $@
 
-docdot = \
-       doc/arch-2.0.dot \
-       doc/design-2.1-lock-acquire.dot \
-       doc/design-2.1-lock-release.dot
-
-docpng = $(patsubst %.dot,%.png,$(docdot))
-
 # Things to build but not to install (add it to EXTRA_DIST if it should be
 # distributed)
 noinst_DATA = \
@@ -659,7 +668,7 @@ qa_scripts = \
 
 bin_SCRIPTS =
 if WANT_HTOOLS
-bin_SCRIPTS += $(filter-out src/hail,$(HS_PROGS))
+bin_SCRIPTS += $(HS_BIN_PROGS)
 install-exec-hook:
        @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
 # FIXME: this is a hardcoded logic, instead of auto-resolving
@@ -684,17 +693,17 @@ $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
          $(HEXTRA) $(HEXTRA_INT) $@
        @touch "$@"
 
-# for the htest/test binary, we need to enable profiling/coverage
-htest/test: HEXTRA_INT=-fhpc -ihtest
+# for the test/hs/htest binary, we need to enable profiling/coverage
+test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
 
 # we compile the hpc-htools binary with the program coverage
-htest/hpc-htools: HEXTRA_INT=-fhpc
+test/hs/hpc-htools: HEXTRA_INT=-fhpc
 
 # we compile the hpc-mon-collector binary with the program coverage
-htest/hpc-mon-collector: HEXTRA_INT=-fhpc
+test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
 
 # test dependency
-htest/offline-tests.sh: htest/hpc-htools htest/hpc-mon-collector
+test/hs/offline-tests.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
 
 # rules for building profiling-enabled versions of the haskell
 # programs: hs-prof does the full two-step build, whereas
@@ -771,7 +780,7 @@ myexeclib_SCRIPTS = \
        daemons/daemon-util \
        tools/kvm-ifup \
        $(pkglib_python_scripts) \
-       src/mon-collector
+       $(HS_MYEXECLIB_PROGS)
 
 nodist_myexeclib_SCRIPTS = \
        $(nodist_pkglib_python_scripts)
@@ -786,6 +795,7 @@ EXTRA_DIST = \
        autotools/check-header \
        autotools/check-imports \
        autotools/check-man-dashes \
+       autotools/check-man-references \
        autotools/check-man-warnings \
        autotools/check-news \
        autotools/check-python-code \
@@ -793,7 +803,7 @@ EXTRA_DIST = \
        autotools/check-version \
        autotools/convert-constants \
        autotools/docpp \
-       autotools/gen-coverage \
+       autotools/gen-py-coverage \
        autotools/testrunner \
        autotools/wrong-hardcoded-paths \
        $(RUN_IN_TEMPDIR) \
@@ -801,12 +811,12 @@ EXTRA_DIST = \
        daemons/ganeti-cleaner.in \
        $(pkglib_python_scripts) \
        devel/upload \
+       devel/webserver \
        tools/kvm-ifup.in \
        tools/vcluster-setup.in \
-       $(docdot) \
-       $(docpng) \
        $(docrst) \
        doc/conf.py \
+       doc/css/style.css \
        doc/html \
        $(BUILT_EXAMPLES:%=%.in) \
        doc/examples/ganeti.default \
@@ -828,8 +838,8 @@ EXTRA_DIST = \
        $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
        $(HS_PROG_SRCS) \
        src/lint-hints.hs \
-       htest/cli-tests-defs.sh \
-       htest/offline-test.sh \
+       test/hs/cli-tests-defs.sh \
+       test/hs/offline-test.sh \
        .ghci
 
 man_MANS = \
@@ -869,39 +879,39 @@ mangen = $(patsubst %.rst,%.gen,$(manrst))
 maninput = \
        $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
        $(patsubst %.html,%.html.in,$(manhtml)) \
-       man/footer.man man/footer.html $(mangen)
+       $(mangen)
 
 TEST_FILES = \
-       htest/data/clean-nonzero-score.data \
-       htest/data/common-suffix.data \
-       htest/data/empty-cluster.data \
-       htest/data/hail-alloc-drbd.json \
-       htest/data/hail-change-group.json \
-       htest/data/hail-invalid-reloc.json \
-       htest/data/hail-node-evac.json \
-       htest/data/hail-reloc-drbd.json \
-       htest/data/hbal-excl-tags.data \
-       htest/data/hbal-split-insts.data \
-       htest/data/invalid-node.data \
-       htest/data/missing-resources.data \
-       htest/data/n1-failure.data \
-       htest/data/rapi/groups.json \
-       htest/data/rapi/info.json \
-       htest/data/rapi/instances.json \
-       htest/data/rapi/nodes.json \
-       htest/shelltests/htools-balancing.test \
-       htest/shelltests/htools-basic.test \
-       htest/shelltests/htools-dynutil.test \
-       htest/shelltests/htools-excl.test \
-       htest/shelltests/htools-hail.test \
-       htest/shelltests/htools-hspace.test \
-       htest/shelltests/htools-invalid.test \
-       htest/shelltests/htools-multi-group.test \
-       htest/shelltests/htools-no-backend.test \
-       htest/shelltests/htools-rapi.test \
-       htest/shelltests/htools-single-group.test \
-       htest/shelltests/htools-text-backend.test \
-       htest/shelltests/htools-mon-collector.test \
+       test/data/htools/clean-nonzero-score.data \
+       test/data/htools/common-suffix.data \
+       test/data/htools/empty-cluster.data \
+       test/data/htools/hail-alloc-drbd.json \
+       test/data/htools/hail-change-group.json \
+       test/data/htools/hail-invalid-reloc.json \
+       test/data/htools/hail-node-evac.json \
+       test/data/htools/hail-reloc-drbd.json \
+       test/data/htools/hbal-excl-tags.data \
+       test/data/htools/hbal-split-insts.data \
+       test/data/htools/invalid-node.data \
+       test/data/htools/missing-resources.data \
+       test/data/htools/n1-failure.data \
+       test/data/htools/rapi/groups.json \
+       test/data/htools/rapi/info.json \
+       test/data/htools/rapi/instances.json \
+       test/data/htools/rapi/nodes.json \
+       test/hs/shelltests/htools-balancing.test \
+       test/hs/shelltests/htools-basic.test \
+       test/hs/shelltests/htools-dynutil.test \
+       test/hs/shelltests/htools-excl.test \
+       test/hs/shelltests/htools-hail.test \
+       test/hs/shelltests/htools-hspace.test \
+       test/hs/shelltests/htools-invalid.test \
+       test/hs/shelltests/htools-multi-group.test \
+       test/hs/shelltests/htools-no-backend.test \
+       test/hs/shelltests/htools-rapi.test \
+       test/hs/shelltests/htools-single-group.test \
+       test/hs/shelltests/htools-text-backend.test \
+       test/hs/shelltests/htools-mon-collector.test \
        test/data/bdev-drbd-8.0.txt \
        test/data/bdev-drbd-8.3.txt \
        test/data/bdev-drbd-disk.txt \
@@ -909,6 +919,7 @@ TEST_FILES = \
        test/data/bdev-drbd-net-ip6.txt \
        test/data/cert1.pem \
        test/data/cert2.pem \
+       test/data/instance-minor-pairing.txt \
        test/data/ip-addr-show-dummy0.txt \
        test/data/ip-addr-show-lo-ipv4.txt \
        test/data/ip-addr-show-lo-ipv6.txt \
@@ -1026,6 +1037,7 @@ python_tests = \
        test/py/ganeti.utils.io_unittest-runasroot.py \
        test/py/ganeti.utils.io_unittest.py \
        test/py/ganeti.utils.log_unittest.py \
+       test/py/ganeti.utils.lvm_unittest.py \
        test/py/ganeti.utils.mlock_unittest.py \
        test/py/ganeti.utils.nodesetup_unittest.py \
        test/py/ganeti.utils.process_unittest.py \
@@ -1040,7 +1052,7 @@ python_tests = \
        test/py/qa.qa_config_unittest.py \
        test/py/tempfile_fork_unittest.py
 
-haskell_tests = htest/test
+haskell_tests = test/hs/htest
 
 dist_TESTS = \
        test/py/check-cert-expired_unittest.bash \
@@ -1056,10 +1068,10 @@ check_SCRIPTS =
 
 if WANT_HSTESTS
 nodist_TESTS += $(haskell_tests)
-dist_TESTS += htest/offline-test.sh
+dist_TESTS += test/hs/offline-test.sh
 check_SCRIPTS += \
-       htest/hpc-htools \
-       htest/hpc-mon-collector \
+       test/hs/hpc-htools \
+       test/hs/hpc-mon-collector \
        $(HS_BUILT_TEST_HELPERS)
 endif
 
@@ -1106,8 +1118,8 @@ srclink_files = \
        test/py/import-export_unittest.bash \
        test/py/cli-test.bash \
        test/py/bash_completion.bash \
-       htest/offline-test.sh \
-       htest/cli-tests-defs.sh \
+       test/hs/offline-test.sh \
+       test/hs/cli-tests-defs.sh \
        $(all_python_code) \
        $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
 
@@ -1178,50 +1190,36 @@ doc/examples/bash_completion doc/examples/bash_completion-debug: \
        PYTHONPATH=. $(RUN_IN_TEMPDIR) \
          $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
 
-doc/%.png: doc/%.dot
-       @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
-       $(DOT) -Tpng -o $@ $<
-
-man/footer.man: man/footer.rst
-       @test -n "$(PANDOC)" || \
-         { echo 'pandoc' not found during configure; exit 1; }
-       $(PANDOC) -f rst -t man -o $@ $<
-
-man/footer.html: man/footer.rst
-       @test -n "$(PANDOC)" || \
-         { echo 'pandoc' not found during configure; exit 1; }
-       $(PANDOC) -f rst -t html -o $@ $<
-
 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
        lib/build/shell_example_lexer.py \
        | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
        @echo "Checking $< for hardcoded paths..."
        @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
-         echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
+         echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
          exit 1; \
        fi
        set -e ; \
        trap 'echo auto-removing $@; rm $@' EXIT; \
        PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
+       $(CHECK_MAN_REFERENCES) $@; \
        trap - EXIT
 
-man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
+man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        set -o pipefail ; \
        trap 'echo auto-removing $@; rm $@' EXIT; \
-       $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
+       $(PANDOC) -s -f rst -t man $< man/footer.rst | \
          sed -e 's/\\@/@/g' > $@; \
        if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
        $(CHECK_MAN_DASHES) $@; \
        trap - EXIT
 
-
-man/%.html.in: man/%.gen man/footer.html
+man/%.html.in: man/%.gen man/footer.rst
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        set -o pipefail ; \
-       $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
+       $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
          sed -e 's/\\@/@/g' > $@
 
 man/%: man/%.in  $(REPLACE_VARS_SED)
@@ -1261,7 +1259,7 @@ src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
 
 src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
        lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
-       lib/jstore.py $(RUN_IN_TEMPDIR)\
+       lib/jstore.py $(RUN_IN_TEMPDIR) \
        $(CONVERT_CONSTANTS) $(built_base_sources) \
        | lib/_vcsversion.py
        set -e; \
@@ -1269,7 +1267,7 @@ src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
          PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
        } > $@
 
-htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
+test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
        $(built_base_sources)
        set -e; \
        { cat $< ; \
@@ -1433,7 +1431,7 @@ tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
 tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
 tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
 tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
-$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
+$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
 
 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
        test -n "$(MODULE)" || { echo Missing module; exit 1; }
@@ -1469,7 +1467,7 @@ $(HS_BUILT_TEST_HELPERS): Makefile
          echo '# This file is automatically generated, do not edit!'; \
          echo "# Edit Makefile.am instead."; \
          echo; \
-         echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
+         echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
        } > $@
        chmod u+x $@
 
@@ -1551,12 +1549,18 @@ check-local: check-dirs $(GENERATED_FILES)
        done; \
        test -z "$$error"
 
+.PHONY: hs-tests
+hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
+       @rm -f htest.tix
+       ./test/hs/htest
+
+.PHONY: hs-shell
+hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
+       @rm -f hpc-htools.tix hpc-mon-collector.tix
+       HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
+
 .PHONY: hs-check
-hs-check: htest/test htest/hpc-htools htest/hpc-mon-collector $(HS_BUILT_TEST_HELPERS) \
-       | $(BUILT_PYTHON_SOURCES)
-       @rm -f *.tix
-       ./htest/test
-       HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
+hs-check: hs-tests hs-shell
 
 # E111: indentation is not a multiple of four
 # E121: continuation line indentation is not a multiple of four
@@ -1606,7 +1610,7 @@ pep8: $(GENERATED_FILES)
          --repeat $(pep8_python_code)
 
 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
-HLINT_EXCLUDES = src/Ganeti/THH.hs htest/hpc-htools.hs
+HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
 .PHONY: hlint
 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
        @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
@@ -1764,18 +1768,19 @@ py-coverage: $(GENERATED_FILES) $(python_tests)
        COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
        TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
        HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
-       $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
+       $(PLAIN_TESTS_ENVIRONMENT) \
+       $(abs_top_srcdir)/autotools/gen-py-coverage \
        $(python_tests)
 
 .PHONY: hs-coverage
-hs-coverage: $(haskell_tests) htest/hpc-htools htest/hpc-mon-collector
+hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
        rm -f *.tix
        $(MAKE) $(AM_MAKEFLAGS) hs-check
        @mkdir_p@ $(COVERAGE_HS_DIR)
        hpc sum --union $(HPCEXCL) \
-         test.tix hpc-htools.tix hpc-mon-collector.tix > coverage-htools.tix
-       hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
-       hpc report coverage-htools.tix
+         htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
+       hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
+       hpc report coverage-hs.tix
        $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
 
 # Special "kind-of-QA" target for htools, needs special setup (all
@@ -1804,6 +1809,10 @@ gitignore-check:
          exit 1; \
        fi
 
+# target to rebuild all man pages (both groff and html output)
+.PHONY: man
+man: $(man_MANS) $(manhtml)
+
 # Target that builds all binaries (including those that are not
 # rebuilt except when running the tests)
 .PHONY: really-all