Two small Makefile fixes related to htools
[ganeti-local] / Makefile.am
1 # Ganeti makefile
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.
7
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@
11
12 # Use bash in order to be able to use pipefail
13 SHELL=/bin/bash
14
15 ACLOCAL_AMFLAGS = -I autotools
16 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
17 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
18 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
19 CHECK_MAN = $(top_srcdir)/autotools/check-man
20 CHECK_VERSION = $(top_srcdir)/autotools/check-version
21 CHECK_NEWS = $(top_srcdir)/autotools/check-news
22 DOCPP = $(top_srcdir)/autotools/docpp
23 REPLACE_VARS_SED = autotools/replace_vars.sed
24
25 # Note: these are automake-specific variables, and must be named after
26 # the directory + 'dir' suffix
27 clientdir = $(pkgpythondir)/client
28 hypervisordir = $(pkgpythondir)/hypervisor
29 httpdir = $(pkgpythondir)/http
30 masterddir = $(pkgpythondir)/masterd
31 confddir = $(pkgpythondir)/confd
32 rapidir = $(pkgpythondir)/rapi
33 serverdir = $(pkgpythondir)/server
34 watcherdir = $(pkgpythondir)/watcher
35 impexpddir = $(pkgpythondir)/impexpd
36 utilsdir = $(pkgpythondir)/utils
37 toolsdir = $(pkglibdir)/tools
38 iallocatorsdir = $(pkglibdir)/iallocators
39 pytoolsdir = $(pkgpythondir)/tools
40 docdir = $(datadir)/doc/$(PACKAGE)
41
42 # Delete output file if an error occurred while building it
43 .DELETE_ON_ERROR:
44
45 HTOOLS_DIRS = \
46         htools \
47         htools/Ganeti \
48         htools/Ganeti/HTools
49
50 DIRS = \
51         autotools \
52         daemons \
53         devel \
54         doc \
55         doc/examples \
56         doc/examples/hooks \
57         doc/examples/gnt-debug \
58         $(HTOOLS_DIRS) \
59         lib \
60         lib/client \
61         lib/build \
62         lib/confd \
63         lib/http \
64         lib/hypervisor \
65         lib/impexpd \
66         lib/masterd \
67         lib/rapi \
68         lib/server \
69         lib/tools \
70         lib/utils \
71         lib/watcher \
72         man \
73         qa \
74         test \
75         test/data \
76         tools
77
78 BUILDTIME_DIR_AUTOCREATE = \
79         scripts \
80         $(APIDOC_DIR) \
81         $(APIDOC_PY_DIR) \
82         $(APIDOC_HS_DIR) \
83         $(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
84         $(COVERAGE_DIR) \
85         $(COVERAGE_PY_DIR) \
86         $(COVERAGE_HS_DIR) \
87         .hpc
88
89 BUILDTIME_DIRS = \
90         $(BUILDTIME_DIR_AUTOCREATE) \
91         doc/html
92
93 DIRCHECK_EXCLUDE = \
94         $(BUILDTIME_DIRS) \
95         ganeti-[0-9]*.[0-9]*.[0-9]* \
96         doc/html/_*
97
98 all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
99
100 # some helper vars
101 COVERAGE_DIR = doc/coverage
102 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
103 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
104 APIDOC_DIR = doc/api
105 APIDOC_PY_DIR = $(APIDOC_DIR)/py
106 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
107
108 MAINTAINERCLEANFILES = \
109         $(docpng) \
110         $(maninput) \
111         doc/install-quick.rst \
112         doc/news.rst \
113         doc/upgrade.rst \
114         vcs-version
115
116 maintainer-clean-local:
117         rm -rf $(BUILDTIME_DIRS)
118
119 CLEANFILES = \
120         $(addsuffix /*.py[co],$(DIRS)) \
121         $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
122         $(addsuffix /*.o,$(HTOOLS_DIRS)) \
123         $(all_dirfiles) \
124         $(PYTHON_BOOTSTRAP) \
125         epydoc.conf \
126         autotools/replace_vars.sed \
127         daemons/daemon-util \
128         daemons/ganeti-cleaner \
129         devel/upload \
130         doc/examples/bash_completion \
131         doc/examples/ganeti.initd \
132         doc/examples/ganeti-kvm-poweroff.initd \
133         doc/examples/ganeti.cron \
134         doc/examples/gnt-config-backup \
135         doc/examples/hooks/ipsec \
136         $(man_MANS) \
137         $(manhtml) \
138         tools/kvm-ifup \
139         stamp-srclinks \
140         $(nodist_pkgpython_PYTHON) \
141         $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
142         .hpc/*.mix htools/*.tix \
143         doc/hs-lint.html
144
145 # BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
146 # it'll cause the target to rebuild every time.
147 BUILT_SOURCES = \
148         ganeti \
149         stamp-srclinks \
150         lib/_autoconf.py \
151         $(all_dirfiles) \
152         $(PYTHON_BOOTSTRAP)
153
154 nodist_pkgpython_PYTHON = \
155         lib/_autoconf.py
156
157 noinst_PYTHON = \
158         lib/build/__init__.py \
159         lib/build/sphinx_ext.py
160
161 pkgpython_PYTHON = \
162         lib/__init__.py \
163         lib/asyncnotifier.py \
164         lib/backend.py \
165         lib/bdev.py \
166         lib/bootstrap.py \
167         lib/cli.py \
168         lib/cmdlib.py \
169         lib/compat.py \
170         lib/config.py \
171         lib/constants.py \
172         lib/daemon.py \
173         lib/errors.py \
174         lib/ht.py \
175         lib/jqueue.py \
176         lib/jstore.py \
177         lib/locking.py \
178         lib/luxi.py \
179         lib/mcpu.py \
180         lib/netutils.py \
181         lib/objects.py \
182         lib/opcodes.py \
183         lib/qlang.py \
184         lib/query.py \
185         lib/rpc.py \
186         lib/runtime.py \
187         lib/serializer.py \
188         lib/ssconf.py \
189         lib/ssh.py \
190         lib/storage.py \
191         lib/uidpool.py \
192         lib/workerpool.py
193
194 client_PYTHON = \
195         lib/client/__init__.py \
196         lib/client/gnt_backup.py \
197         lib/client/gnt_cluster.py \
198         lib/client/gnt_debug.py \
199         lib/client/gnt_group.py \
200         lib/client/gnt_instance.py \
201         lib/client/gnt_job.py \
202         lib/client/gnt_node.py \
203         lib/client/gnt_os.py
204
205 hypervisor_PYTHON = \
206         lib/hypervisor/__init__.py \
207         lib/hypervisor/hv_base.py \
208         lib/hypervisor/hv_chroot.py \
209         lib/hypervisor/hv_fake.py \
210         lib/hypervisor/hv_kvm.py \
211         lib/hypervisor/hv_lxc.py \
212         lib/hypervisor/hv_xen.py
213
214 rapi_PYTHON = \
215         lib/rapi/__init__.py \
216         lib/rapi/baserlib.py \
217         lib/rapi/client.py \
218         lib/rapi/client_utils.py \
219         lib/rapi/connector.py \
220         lib/rapi/rlib2.py
221
222 http_PYTHON = \
223         lib/http/__init__.py \
224         lib/http/auth.py \
225         lib/http/client.py \
226         lib/http/server.py
227
228 confd_PYTHON = \
229         lib/confd/__init__.py \
230         lib/confd/client.py \
231         lib/confd/querylib.py \
232         lib/confd/server.py
233
234 masterd_PYTHON = \
235         lib/masterd/__init__.py \
236         lib/masterd/instance.py
237
238 impexpd_PYTHON = \
239         lib/impexpd/__init__.py
240
241 watcher_PYTHON = \
242         lib/watcher/__init__.py
243
244 server_PYTHON = \
245         lib/server/__init__.py \
246         lib/server/confd.py \
247         lib/server/masterd.py \
248         lib/server/noded.py \
249         lib/server/rapi.py
250
251 pytools_PYTHON = \
252         lib/tools/__init__.py \
253         lib/tools/ensure_dirs.py
254
255 utils_PYTHON = \
256         lib/utils/__init__.py \
257         lib/utils/algo.py \
258         lib/utils/filelock.py \
259         lib/utils/hash.py \
260         lib/utils/io.py \
261         lib/utils/log.py \
262         lib/utils/mlock.py \
263         lib/utils/nodesetup.py \
264         lib/utils/process.py \
265         lib/utils/retry.py \
266         lib/utils/text.py \
267         lib/utils/wrapper.py \
268         lib/utils/x509.py
269
270 docrst = \
271         doc/admin.rst \
272         doc/design-2.0.rst \
273         doc/design-2.1.rst \
274         doc/design-2.2.rst \
275         doc/design-2.3.rst \
276         doc/design-htools-2.3.rst \
277         doc/design-2.4.rst \
278         doc/design-draft.rst \
279         doc/design-oob.rst \
280         doc/design-query2.rst \
281         doc/design-x509-ca.rst \
282         doc/design-http-server.rst \
283         doc/design-impexp2.rst \
284         doc/design-lu-generated-jobs.rst \
285         doc/design-multi-reloc.rst \
286         doc/cluster-merge.rst \
287         doc/design-shared-storage.rst \
288         doc/devnotes.rst \
289         doc/glossary.rst \
290         doc/hooks.rst \
291         doc/iallocator.rst \
292         doc/index.rst \
293         doc/install-quick.rst \
294         doc/install.rst \
295         doc/locking.rst \
296         doc/move-instance.rst \
297         doc/news.rst \
298         doc/rapi.rst \
299         doc/security.rst \
300         doc/upgrade.rst \
301         doc/walkthrough.rst
302
303 HS_PROGS = \
304         htools/hbal \
305         htools/hscan \
306         htools/hail \
307         htools/hspace
308
309 HS_ALL_PROGS = $(HS_PROGS) htools/test
310 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
311 # we don't add -Werror by default
312 HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
313 # extra flags that can be overriden on the command line
314 HEXTRA =
315 # exclude options for coverage reports
316 HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
317
318 HS_LIB_SRCS = \
319         htools/Ganeti/HTools/CLI.hs \
320         htools/Ganeti/HTools/Cluster.hs \
321         htools/Ganeti/HTools/Container.hs \
322         htools/Ganeti/HTools/ExtLoader.hs \
323         htools/Ganeti/HTools/Group.hs \
324         htools/Ganeti/HTools/IAlloc.hs \
325         htools/Ganeti/HTools/Instance.hs \
326         htools/Ganeti/HTools/Loader.hs \
327         htools/Ganeti/HTools/Luxi.hs \
328         htools/Ganeti/HTools/Node.hs \
329         htools/Ganeti/HTools/PeerMap.hs \
330         htools/Ganeti/HTools/QC.hs \
331         htools/Ganeti/HTools/Rapi.hs \
332         htools/Ganeti/HTools/Simu.hs \
333         htools/Ganeti/HTools/Text.hs \
334         htools/Ganeti/HTools/Types.hs \
335         htools/Ganeti/HTools/Utils.hs \
336         htools/Ganeti/Jobs.hs \
337         htools/Ganeti/Luxi.hs \
338         htools/Ganeti/OpCodes.hs
339
340 HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
341 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
342
343 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
344
345 # Note: we use here an order-only prerequisite, as the contents of
346 # _autoconf.py are not actually influencing the html build output: it
347 # has to exist in order for the sphinx module to be loaded
348 # successfully, but we certainly don't want the docs to be rebuilt if
349 # it changes
350 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
351         $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
352         | lib/_autoconf.py
353         @test -n "$(SPHINX)" || \
354             { echo 'sphinx-build' not found during configure; exit 1; }
355         @mkdir_p@ $(dir $@)
356         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
357             -d . \
358             -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
359             -D release="$(PACKAGE_VERSION)" \
360             $(abs_top_srcdir)/doc $(CURDIR)/doc/html
361         rm -f doc/html/.buildinfo doc/html/objects.inv
362         touch $@
363
364 doc/html: doc/html/index.html
365
366 doc/install-quick.rst: INSTALL
367 doc/news.rst: NEWS
368 doc/upgrade.rst: UPGRADE
369
370 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
371         set -e; \
372         { echo '.. This file is automatically updated at build time from $<.'; \
373           echo '.. Do not edit.'; \
374           echo; \
375           cat $<; \
376         } > $@
377
378 docdot = \
379         doc/arch-2.0.dot \
380         doc/design-2.1-lock-acquire.dot \
381         doc/design-2.1-lock-release.dot
382
383 docpng = $(patsubst %.dot,%.png,$(docdot))
384
385 # Things to build but not to install (add it to EXTRA_DIST if it should be
386 # distributed)
387 noinst_DATA = \
388         devel/upload \
389         doc/html \
390         doc/examples/bash_completion \
391         doc/examples/ganeti.cron \
392         doc/examples/ganeti.initd \
393         doc/examples/ganeti-kvm-poweroff.initd \
394         doc/examples/gnt-config-backup \
395         doc/examples/hooks/ipsec \
396         $(manhtml)
397
398 gnt_scripts = \
399         scripts/gnt-backup \
400         scripts/gnt-cluster \
401         scripts/gnt-debug \
402         scripts/gnt-group \
403         scripts/gnt-instance \
404         scripts/gnt-job \
405         scripts/gnt-node \
406         scripts/gnt-os
407
408 PYTHON_BOOTSTRAP_SBIN = \
409         daemons/ganeti-confd \
410         daemons/ganeti-masterd \
411         daemons/ganeti-noded \
412         daemons/ganeti-watcher \
413         daemons/ganeti-rapi \
414         scripts/gnt-backup \
415         scripts/gnt-cluster \
416         scripts/gnt-debug \
417         scripts/gnt-group \
418         scripts/gnt-instance \
419         scripts/gnt-job \
420         scripts/gnt-node \
421         scripts/gnt-os
422
423 PYTHON_BOOTSTRAP = \
424         $(PYTHON_BOOTSTRAP_SBIN) \
425         tools/ensure-dirs
426
427 qa_scripts = \
428         qa/ganeti-qa.py \
429         qa/qa_cluster.py \
430         qa/qa_config.py \
431         qa/qa_daemon.py \
432         qa/qa_env.py \
433         qa/qa_error.py \
434         qa/qa_instance.py \
435         qa/qa_node.py \
436         qa/qa_os.py \
437         qa/qa_rapi.py \
438         qa/qa_tags.py \
439         qa/qa_utils.py
440
441 bin_SCRIPTS =
442 iallocators_SCRIPTS =
443 if WANT_HTOOLS
444 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
445 iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
446 endif
447
448 $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
449         @if [ -z "$(HTOOLS)" ]; then \
450           echo "Error: htools compilation disabled at configure time" 1>&2 ;\
451           exit 1; \
452         fi
453         BINARY=$(@:htools/%=%); \
454         if [ "$$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
455           echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
456           exit 1; \
457         fi; \
458         $(GHC) --make \
459           $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
460           -osuf $$BINARY.o -hisuf $$BINARY.hi \
461           $@
462
463 # for the htools/test binary, we need to enable profiling/coverage
464 htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
465         -fno-warn-monomorphism-restriction -fno-warn-orphans \
466         -fno-warn-missing-methods -fno-warn-unused-imports
467
468 dist_sbin_SCRIPTS = \
469         tools/ganeti-listrunner
470
471 nodist_sbin_SCRIPTS = \
472         $(PYTHON_BOOTSTRAP_SBIN) \
473         daemons/ganeti-cleaner
474
475 dist_tools_SCRIPTS = \
476         tools/burnin \
477         tools/cfgshell \
478         tools/cfgupgrade \
479         tools/cfgupgrade12 \
480         tools/cluster-merge \
481         tools/lvmstrap \
482         tools/move-instance \
483         tools/setup-ssh \
484         tools/sanitize-config
485
486 pkglib_python_scripts = \
487         daemons/import-export \
488         tools/check-cert-expired
489
490 nodist_pkglib_python_scripts = \
491         tools/ensure-dirs
492
493 pkglib_SCRIPTS = \
494         daemons/daemon-util \
495         tools/kvm-ifup \
496         $(pkglib_python_scripts)
497
498 nodist_pkglib_SCRIPTS = \
499         $(nodist_pkglib_python_scripts)
500
501 EXTRA_DIST = \
502         NEWS \
503         UPGRADE \
504         epydoc.conf.in \
505         pylintrc \
506         autotools/build-bash-completion \
507         autotools/check-python-code \
508         autotools/check-man \
509         autotools/check-news \
510         autotools/check-tar \
511         autotools/check-version \
512         autotools/docpp \
513         autotools/gen-coverage \
514         autotools/testrunner \
515         $(RUN_IN_TEMPDIR) \
516         daemons/daemon-util.in \
517         daemons/ganeti-cleaner.in \
518         $(pkglib_python_scripts) \
519         devel/upload.in \
520         tools/kvm-ifup.in \
521         $(docdot) \
522         $(docpng) \
523         $(docrst) \
524         doc/conf.py \
525         doc/html \
526         doc/examples/ganeti.initd.in \
527         doc/examples/ganeti-kvm-poweroff.initd.in \
528         doc/examples/ganeti.cron.in \
529         doc/examples/gnt-config-backup.in \
530         doc/examples/ganeti.default \
531         doc/examples/ganeti.default-debug \
532         doc/examples/hooks/ethers \
533         doc/examples/hooks/ipsec.in \
534         doc/examples/gnt-debug/README \
535         doc/examples/gnt-debug/delay0.json \
536         doc/examples/gnt-debug/delay50.json \
537         test/testutils.py \
538         test/mocks.py \
539         $(dist_TESTS) \
540         $(TEST_FILES) \
541         man/footer.rst \
542         $(manrst) \
543         $(maninput) \
544         qa/qa-sample.json \
545         $(qa_scripts) \
546         $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
547         $(HS_PROG_SRCS)
548
549 man_MANS = \
550         man/ganeti.7 \
551         man/ganeti-cleaner.8 \
552         man/ganeti-confd.8 \
553         man/ganeti-listrunner.8 \
554         man/ganeti-masterd.8 \
555         man/ganeti-noded.8 \
556         man/ganeti-os-interface.7 \
557         man/ganeti-rapi.8 \
558         man/ganeti-watcher.8 \
559         man/gnt-backup.8 \
560         man/gnt-cluster.8 \
561         man/gnt-debug.8 \
562         man/gnt-group.8 \
563         man/gnt-instance.8 \
564         man/gnt-job.8 \
565         man/gnt-node.8 \
566         man/gnt-os.8 \
567         man/hail.1 \
568         man/hbal.1 \
569         man/hscan.1 \
570         man/hspace.1
571
572 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
573 manhtml = $(patsubst %.rst,%.html,$(manrst))
574 mangen = $(patsubst %.rst,%.gen,$(manrst))
575 maninput = \
576         $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
577         $(patsubst %.html,%.html.in,$(manhtml)) \
578         man/footer.man man/footer.html $(mangen)
579
580 TEST_FILES = \
581         test/data/bdev-drbd-8.0.txt \
582         test/data/bdev-drbd-8.3.txt \
583         test/data/bdev-drbd-disk.txt \
584         test/data/bdev-drbd-net-ip4.txt \
585         test/data/bdev-drbd-net-ip6.txt \
586         test/data/cert1.pem \
587         test/data/proc_drbd8.txt \
588         test/data/proc_drbd80-emptyline.txt \
589         test/data/proc_drbd83.txt \
590         test/data/sys_drbd_usermode_helper.txt \
591         test/import-export_unittest-helper
592
593 python_tests = \
594         test/ganeti.asyncnotifier_unittest.py \
595         test/ganeti.backend_unittest.py \
596         test/ganeti.bdev_unittest.py \
597         test/ganeti.cli_unittest.py \
598         test/ganeti.client.gnt_cluster_unittest.py \
599         test/ganeti.client.gnt_instance_unittest.py \
600         test/ganeti.daemon_unittest.py \
601         test/ganeti.cmdlib_unittest.py \
602         test/ganeti.compat_unittest.py \
603         test/ganeti.confd.client_unittest.py \
604         test/ganeti.config_unittest.py \
605         test/ganeti.constants_unittest.py \
606         test/ganeti.errors_unittest.py \
607         test/ganeti.hooks_unittest.py \
608         test/ganeti.ht_unittest.py \
609         test/ganeti.http_unittest.py \
610         test/ganeti.hypervisor_unittest.py \
611         test/ganeti.hypervisor.hv_chroot_unittest.py \
612         test/ganeti.hypervisor.hv_fake_unittest.py \
613         test/ganeti.hypervisor.hv_kvm_unittest.py \
614         test/ganeti.hypervisor.hv_lxc_unittest.py \
615         test/ganeti.hypervisor.hv_xen_unittest.py \
616         test/ganeti.impexpd_unittest.py \
617         test/ganeti.jqueue_unittest.py \
618         test/ganeti.locking_unittest.py \
619         test/ganeti.luxi_unittest.py \
620         test/ganeti.masterd.instance_unittest.py \
621         test/ganeti.mcpu_unittest.py \
622         test/ganeti.netutils_unittest.py \
623         test/ganeti.objects_unittest.py \
624         test/ganeti.opcodes_unittest.py \
625         test/ganeti.qlang_unittest.py \
626         test/ganeti.query_unittest.py \
627         test/ganeti.rapi.baserlib_unittest.py \
628         test/ganeti.rapi.client_unittest.py \
629         test/ganeti.rapi.resources_unittest.py \
630         test/ganeti.rapi.rlib2_unittest.py \
631         test/ganeti.rpc_unittest.py \
632         test/ganeti.runtime_unittest.py \
633         test/ganeti.serializer_unittest.py \
634         test/ganeti.ssh_unittest.py \
635         test/ganeti.tools.ensure_dirs_unittest.py \
636         test/ganeti.uidpool_unittest.py \
637         test/ganeti.utils.algo_unittest.py \
638         test/ganeti.utils.filelock_unittest.py \
639         test/ganeti.utils.hash_unittest.py \
640         test/ganeti.utils.io_unittest.py \
641         test/ganeti.utils.log_unittest.py \
642         test/ganeti.utils.mlock_unittest.py \
643         test/ganeti.utils.nodesetup_unittest.py \
644         test/ganeti.utils.process_unittest.py \
645         test/ganeti.utils.retry_unittest.py \
646         test/ganeti.utils.text_unittest.py \
647         test/ganeti.utils.wrapper_unittest.py \
648         test/ganeti.utils.x509_unittest.py \
649         test/ganeti.utils_unittest.py \
650         test/ganeti.workerpool_unittest.py \
651         test/cfgupgrade_unittest.py \
652         test/docs_unittest.py \
653         test/tempfile_fork_unittest.py
654
655 haskell_tests = htools/test
656
657 dist_TESTS = \
658         test/check-cert-expired_unittest.bash \
659         test/daemon-util_unittest.bash \
660         test/ganeti-cleaner_unittest.bash \
661         test/import-export_unittest.bash \
662         $(python_tests)
663
664 nodist_TESTS =
665 if WANT_HTOOLS
666 nodist_TESTS += $(haskell_tests)
667 endif
668
669 TESTS = $(dist_TESTS) $(nodist_TESTS)
670
671 # Environment for all tests
672 PLAIN_TESTS_ENVIRONMENT = \
673         PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
674
675 # Environment for tests run by automake
676 TESTS_ENVIRONMENT = \
677         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
678
679 all_python_code = \
680         $(dist_sbin_SCRIPTS) \
681         $(dist_tools_SCRIPTS) \
682         $(pkglib_python_scripts) \
683         $(nodist_pkglib_python_scripts) \
684         $(python_tests) \
685         $(pkgpython_PYTHON) \
686         $(client_PYTHON) \
687         $(hypervisor_PYTHON) \
688         $(rapi_PYTHON) \
689         $(server_PYTHON) \
690         $(pytools_PYTHON) \
691         $(http_PYTHON) \
692         $(confd_PYTHON) \
693         $(masterd_PYTHON) \
694         $(impexpd_PYTHON) \
695         $(utils_PYTHON) \
696         $(watcher_PYTHON) \
697         $(noinst_PYTHON) \
698         $(qa_scripts)
699
700 srclink_files = \
701         man/footer.rst \
702         test/check-cert-expired_unittest.bash \
703         test/daemon-util_unittest.bash \
704         test/ganeti-cleaner_unittest.bash \
705         test/import-export_unittest.bash \
706         $(all_python_code) \
707         $(HS_LIB_SRCS) $(HS_PROG_SRCS)
708
709 check_python_code = \
710         $(BUILD_BASH_COMPLETION) \
711         $(DOCPP) \
712         $(all_python_code)
713
714 lint_python_code = \
715         ganeti \
716         ganeti/http/server.py \
717         $(dist_sbin_SCRIPTS) \
718         $(dist_tools_SCRIPTS) \
719         $(pkglib_python_scripts) \
720         $(BUILD_BASH_COMPLETION) \
721         $(DOCPP) \
722         $(PYTHON_BOOTSTRAP)
723
724 test/daemon-util_unittest.bash: daemons/daemon-util
725
726 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
727
728 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
729         sed -f $(REPLACE_VARS_SED) < $< > $@
730         chmod +x $@
731
732 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
733         sed -f $(REPLACE_VARS_SED) < $< > $@
734         chmod u+x $@
735
736 daemons/%: daemons/%.in $(REPLACE_VARS_SED)
737         sed -f $(REPLACE_VARS_SED) < $< > $@
738         chmod +x $@
739
740 doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
741         sed -f $(REPLACE_VARS_SED) < $< > $@
742
743 doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
744         sed -f $(REPLACE_VARS_SED) < $< > $@
745
746 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
747         lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
748         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
749
750 doc/%.png: doc/%.dot
751         @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
752         $(DOT) -Tpng -o $@ $<
753
754 man/footer.man: man/footer.rst
755         @test -n "$(PANDOC)" || \
756           { echo 'pandoc' not found during configure; exit 1; }
757         $(PANDOC) -f rst -t man -o $@ $<
758
759 man/footer.html: man/footer.rst
760         @test -n "$(PANDOC)" || \
761           { echo 'pandoc' not found during configure; exit 1; }
762         $(PANDOC) -f rst -t html -o $@ $<
763
764 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
765         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
766
767 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
768         @test -n "$(PANDOC)" || \
769           { echo 'pandoc' not found during configure; exit 1; }
770         set -o pipefail ; \
771         $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
772           sed -e 's/\\@/@/g' > $@
773         if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
774
775 man/%.html.in: man/%.gen man/footer.html
776         @test -n "$(PANDOC)" || \
777           { echo 'pandoc' not found during configure; exit 1; }
778         set -o pipefail ; \
779         $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
780           sed -e 's/\\@/@/g' > $@
781
782 man/%.1: man/%.1.in $(REPLACE_VARS_SED)
783         sed -f $(REPLACE_VARS_SED) < $< > $@
784
785 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
786         sed -f $(REPLACE_VARS_SED) < $< > $@
787
788 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
789         sed -f $(REPLACE_VARS_SED) < $< > $@
790
791 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
792         sed -f $(REPLACE_VARS_SED) < $< > $@
793
794 epydoc.conf: epydoc.conf.in Makefile
795         sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
796
797 vcs-version:
798         if test -d .git; then \
799           git describe > $@; \
800         elif test ! -f $@ ; then \
801           echo "Cannot auto-generate $@ file"; exit 1; \
802         fi
803
804 .PHONY: regen-vcs-version
805 regen-vcs-version:
806         set -e; \
807         cd $(srcdir); \
808         if test -d .git; then \
809           rm -f vcs-version; \
810           $(MAKE) vcs-version; \
811         fi
812
813 htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version
814         set -e; \
815         VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
816         sed -e "s/%ver%/$$VCSVER/" < $< > $@
817
818 lib/_autoconf.py: Makefile vcs-version | lib/.dir
819         set -e; \
820         VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
821         { echo '# This file is automatically generated, do not edit!'; \
822           echo '#'; \
823           echo ''; \
824           echo '"""Build-time configuration for Ganeti.'; \
825           echo '';\
826           echo 'This file is autogenerated by the build process.'; \
827           echo 'For any changes you need to re-run ./configure (and'; \
828           echo 'not edit by hand).'; \
829           echo ''; \
830           echo '"""'; \
831           echo ''; \
832           echo '# pylint: disable-msg=C0301,C0324'; \
833           echo '# because this is autogenerated, we do not want'; \
834           echo '# style warnings' ; \
835           echo ''; \
836           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
837           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
838           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
839           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
840           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
841           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
842           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
843           echo "SYSCONFDIR = '$(sysconfdir)'"; \
844           echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
845           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
846           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
847           echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
848           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
849           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
850           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
851           echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
852           echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
853           echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
854           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
855           echo "KVM_PATH = '$(KVM_PATH)'"; \
856           echo "SOCAT_PATH = '$(SOCAT)'"; \
857           echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
858           echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
859           echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
860           echo "TOOLSDIR = '$(toolsdir)'"; \
861           echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
862           echo "PKGLIBDIR = '$(pkglibdir)'"; \
863           echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
864           echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
865           echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
866           echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
867           echo "MASTERD_USER = '$(MASTERD_USER)'"; \
868           echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
869           echo "RAPI_USER = '$(RAPI_USER)'"; \
870           echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
871           echo "CONFD_USER = '$(CONFD_USER)'"; \
872           echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
873           echo "NODED_USER = '$(NODED_USER)'"; \
874           echo "VCS_VERSION = '$$VCSVER'"; \
875           echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
876           if [ "$(HTOOLS)" ]; then \
877             echo "HTOOLS = True"; \
878           else \
879             echo "HTOOLS = False"; \
880           fi; \
881         } > $@
882
883 $(REPLACE_VARS_SED): Makefile
884         set -e; \
885         { echo 's#@PREFIX@#$(prefix)#g'; \
886           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
887           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
888           echo 's#@BINDIR@#$(bindir)#g'; \
889           echo 's#@SBINDIR@#$(sbindir)#g'; \
890           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
891           echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
892           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
893           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
894           echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
895           echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
896           echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
897           echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
898           echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
899           echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
900           echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
901           echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
902           echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
903           echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
904           echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
905           echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
906           echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
907           echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
908         } > $@
909
910 # Using deferred evaluation
911 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
912 daemons/ganeti-watcher: MODULE = ganeti.watcher
913 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
914 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
915
916 $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
917         test -n "$(MODULE)" || { echo Missing module; exit 1; }
918         set -e; \
919         { echo '#!/usr/bin/python'; \
920           echo '# This file is automatically generated, do not edit!'; \
921           echo "# Edit $(MODULE) instead."; \
922           echo; \
923           echo '"""Bootstrap script for L{$(MODULE)}"""'; \
924           echo; \
925           echo '# pylint: disable-msg=C0103'; \
926           echo '# C0103: Invalid name'; \
927           echo; \
928           echo 'import sys'; \
929           echo 'import $(MODULE) as main'; \
930           echo; \
931           echo '# Temporarily alias commands until bash completion'; \
932           echo '# generator is changed'; \
933           echo 'if hasattr(main, "commands"):'; \
934                 echo '  commands = main.commands # pylint: disable-msg=E1101'; \
935           echo; \
936           echo 'if __name__ == "__main__":'; \
937           echo '  sys.exit(main.Main())'; \
938         } > $@
939         chmod u+x $@
940
941 # We need to create symlinks because "make distcheck" will not install Python
942 # files when building.
943 stamp-srclinks: Makefile | $(all_dirfiles)
944         set -e; \
945         for i in $(srclink_files); do \
946                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
947                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
948                 fi; \
949         done
950         touch $@
951
952 .PHONY: ganeti
953 ganeti:
954         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
955
956 .PHONY: check-dirs
957 check-dirs: $(BUILT_SOURCES)
958         @set -e; \
959         find . -type d \( \( -name . \) -o \( \
960                 -name .git -o \
961                 -name autom4te.cache \
962                 \) -prune -o -print \) | { \
963                 error=; \
964                 while read dir; do \
965                         case "$$dir" in \
966                                 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
967                                 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
968                         esac; \
969                 done; \
970                 for dir in $(DIRS); do \
971                         if ! test -d "$$dir"; then \
972                                 echo "Directory $$dir listed in DIRS does not exist" >&2; \
973                                 error=1; \
974                         fi \
975                 done; \
976                 if test -n "$$error"; then exit 1; else exit 0; fi; \
977         }
978
979 check-local: check-dirs
980         $(CHECK_PYTHON_CODE) $(check_python_code)
981         $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
982         $(CHECK_NEWS) < $(top_srcdir)/NEWS
983
984 .PHONY: lint
985 lint: $(BUILT_SOURCES)
986         @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
987         $(PYLINT) $(LINT_OPTS) $(lint_python_code)
988         cd $(top_srcdir)/qa && \
989           PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
990           --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
991
992 .PHONY: hlint
993 hlint: $(HS_BUILT_SRCS)
994         if tty -s; then C="-c"; else C=""; fi; \
995         hlint --report=doc/hs-lint.html $$C htools
996
997 # a dist hook rule for updating the vcs-version file; this is
998 # hardcoded due to where it needs to build the file...
999 dist-hook:
1000         $(MAKE) regen-vcs-version && \
1001         rm -f $(top_distdir)/vcs-version && \
1002         cp -p $(srcdir)/vcs-version $(top_distdir)
1003
1004 # a distcheck hook rule for catching revision control directories
1005 distcheck-hook:
1006         if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1007                 echo "Found revision control files in final archive." 1>&2; \
1008                 exit 1; \
1009         fi
1010         if find $(top_distdir) -name '*.py[co]' | grep .; then \
1011                 echo "Found Python byte code in final archive." 1>&2; \
1012                 exit 1; \
1013         fi
1014         if find $(top_distdir) -name '*~' | grep .; then \
1015                 echo "Found backup files in final archive." 1>&2; \
1016                 exit 1; \
1017         fi
1018 # Empty files or directories should not be distributed. They can cause
1019 # unnecessary warnings for packagers. Directories used by automake during
1020 # distcheck must be excluded.
1021         if find $(top_distdir) -empty -and -not \( \
1022                         -path $(top_distdir)/_build -or \
1023                         -path $(top_distdir)/_inst \) | grep .; then \
1024                 echo "Found empty files or directories in final archive." 1>&2; \
1025                 exit 1; \
1026         fi
1027         if test -n "$(BUILD_RELEASE)" && \
1028            grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1029                 echo "Found unreleased version in NEWS." >&2; \
1030                 exit 1; \
1031         fi
1032
1033 # When building a release, stricter checks should be used
1034 distcheck-release dist-release: export BUILD_RELEASE = 1
1035 distcheck-release: distcheck
1036
1037 dist-release: dist
1038         set -e; \
1039         for i in $(DIST_ARCHIVES); do \
1040                 echo -n "Checking $$i ... "; \
1041                 autotools/check-tar < $$i; \
1042                 echo OK; \
1043         done
1044
1045 install-exec-local:
1046         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1047           "$(DESTDIR)${localstatedir}/log/ganeti" \
1048           "$(DESTDIR)${localstatedir}/run/ganeti"
1049
1050 # To avoid conflicts between directory names and other targets, a file inside
1051 # the directory is used to ensure its existence.
1052 %.dir:
1053         @mkdir_p@ $* && touch $@
1054
1055 .PHONY: apidoc
1056 if WANT_HTOOLSAPIDOC
1057 apidoc: py-apidoc hs-apidoc
1058 else
1059 apidoc: py-apidoc
1060 endif
1061
1062 .PHONY: py-apidoc
1063 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1064         $(RUN_IN_TEMPDIR) epydoc -v \
1065                 --conf $(CURDIR)/epydoc.conf \
1066                 --output $(CURDIR)/$(APIDOC_PY_DIR)
1067
1068 .PHONY: hs-apidoc
1069 hs-apidoc: $(HS_BUILT_SRCS)
1070         @test -n "$(HSCOLOUR)" || \
1071             { echo 'HsColour' not found during configure; exit 1; }
1072         @test -n "$(HADDOCK)" || \
1073             { echo 'haddock' not found during configure; exit 1; }
1074         rm -rf $(APIDOC_HS_DIR)/*
1075         @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools
1076         $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1077         ln -s ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1078         set -e ; \
1079         cd htools; \
1080         if [ "$(HTOOLS_NOCURL)" ]; \
1081         then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1082         else OPTGHC=""; \
1083         fi; \
1084         RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
1085         for file in $$RELSRCS; do \
1086                 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1087                 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1088         done ; \
1089         $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1090                 -t ganeti-htools -p haddock-prologue \
1091                 --source-module="%{MODULE/.//}.html" \
1092                 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1093                 $$OPTGHC \
1094                 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1095
1096 .PHONY: TAGS
1097 TAGS: $(BUILT_SOURCES)
1098         rm -f TAGS
1099         find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1100           -path './daemons/ganeti-*' -o -path './tools/*' -o \
1101           -path './qa/*.py' | \
1102           etags -l python -
1103
1104 .PHONY: coverage
1105 if WANT_HTOOLS
1106 coverage: py-coverage hs-coverage
1107 else
1108 coverage: py-coverage
1109 endif
1110
1111 .PHONY: py-coverage
1112 py-coverage: $(BUILT_SOURCES) $(python_tests)
1113         set -e; \
1114         COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1115         TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1116         HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1117         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1118         $(python_tests)
1119
1120 .PHONY: hs-coverage
1121 hs-coverage: $(haskell_tests)
1122         cd htools && rm -f *.tix *.mix && ./test
1123         mkdir -p $(COVERAGE_HS_DIR)
1124         hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL)
1125         hpc report htools/test $(HPCEXCL)
1126         ln -sf hpc_index.html $(COVERAGE_HS_DIR)/index.html
1127
1128 # Special "kind-of-QA" target for htools, needs special setup (all
1129 # tools compiled with -fhpc)
1130 .PHONY: live-test
1131 live-test: all
1132         set -e ; \
1133         cd htools; \
1134         rm -f .hpc; ln -s ../.hpc .hpc; \
1135         rm -f *.tix *.mix; \
1136         ./live-test.sh; \
1137         hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1138           --output=live-test.tix ; \
1139         @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1140         hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1141                 --srcdir=.. $(HPCEXCL) ; \
1142         hpc report --srcdir=.. live-test $(HPCEXCL)
1143
1144 commit-check: distcheck lint apidoc
1145
1146 -include ./Makefile.local
1147
1148 # vim: set noet :