Migrate lib/config.py from constants to pathutils
[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 # Helper values for calling builtin functions
13 empty :=
14 space := $(empty) $(empty)
15 comma := ,
16
17 # Use bash in order to be able to use pipefail
18 SHELL=/bin/bash
19
20 ACLOCAL_AMFLAGS = -I autotools
21 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
22 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
23 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
24 CHECK_HEADER = $(top_srcdir)/autotools/check-header
25 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
26 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
27 CHECK_VERSION = $(top_srcdir)/autotools/check-version
28 CHECK_NEWS = $(top_srcdir)/autotools/check-news
29 CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
30 DOCPP = $(top_srcdir)/autotools/docpp
31 REPLACE_VARS_SED = autotools/replace_vars.sed
32 CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
33 BUILD_RPC = $(top_srcdir)/autotools/build-rpc
34
35 # Note: these are automake-specific variables, and must be named after
36 # the directory + 'dir' suffix
37 clientdir = $(pkgpythondir)/client
38 hypervisordir = $(pkgpythondir)/hypervisor
39 httpdir = $(pkgpythondir)/http
40 masterddir = $(pkgpythondir)/masterd
41 confddir = $(pkgpythondir)/confd
42 rapidir = $(pkgpythondir)/rapi
43 serverdir = $(pkgpythondir)/server
44 watcherdir = $(pkgpythondir)/watcher
45 impexpddir = $(pkgpythondir)/impexpd
46 utilsdir = $(pkgpythondir)/utils
47 toolsdir = $(pkglibdir)/tools
48 iallocatorsdir = $(pkglibdir)/iallocators
49 pytoolsdir = $(pkgpythondir)/tools
50 docdir = $(datadir)/doc/$(PACKAGE)
51 myexeclibdir = $(pkglibdir)
52
53 # Delete output file if an error occurred while building it
54 .DELETE_ON_ERROR:
55
56 HTOOLS_DIRS = \
57         htools \
58         htools/Ganeti \
59         htools/Ganeti/Confd \
60         htools/Ganeti/HTools \
61         htools/Ganeti/HTools/Program \
62         htools/Ganeti/Query \
63         htest \
64         htest/Test \
65         htest/Test/Ganeti \
66         htest/Test/Ganeti/Confd \
67         htest/Test/Ganeti/HTools \
68         htest/Test/Ganeti/Query
69
70 DIRS = \
71         autotools \
72         daemons \
73         devel \
74         doc \
75         doc/examples \
76         doc/examples/hooks \
77         doc/examples/gnt-debug \
78         $(HTOOLS_DIRS) \
79         lib \
80         lib/client \
81         lib/build \
82         lib/confd \
83         lib/http \
84         lib/hypervisor \
85         lib/impexpd \
86         lib/masterd \
87         lib/rapi \
88         lib/server \
89         lib/tools \
90         lib/utils \
91         lib/watcher \
92         man \
93         qa \
94         test \
95         test/data \
96         test/data/ovfdata \
97         test/data/ovfdata/other \
98         htest/data \
99         htest/data/rapi \
100         htest/shelltests \
101         tools
102
103 BUILDTIME_DIR_AUTOCREATE = \
104         scripts \
105         $(APIDOC_DIR) \
106         $(APIDOC_PY_DIR) \
107         $(APIDOC_HS_DIR) \
108         $(APIDOC_HS_DIR)/Ganeti \
109         $(APIDOC_HS_DIR)/Ganeti/Confd \
110         $(APIDOC_HS_DIR)/Ganeti/HTools \
111         $(APIDOC_HS_DIR)/Ganeti/HTools/Program \
112         $(APIDOC_HS_DIR)/Ganeti/Query \
113         $(COVERAGE_DIR) \
114         $(COVERAGE_PY_DIR) \
115         $(COVERAGE_HS_DIR) \
116         .hpc
117
118 BUILDTIME_DIRS = \
119         $(BUILDTIME_DIR_AUTOCREATE) \
120         doc/html
121
122 DIRCHECK_EXCLUDE = \
123         $(BUILDTIME_DIRS) \
124         ganeti-[0-9]*.[0-9]*.[0-9]* \
125         doc/html/_*
126
127 # some helper vars
128 COVERAGE_DIR = doc/coverage
129 COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
130 COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
131 APIDOC_DIR = doc/api
132 APIDOC_PY_DIR = $(APIDOC_DIR)/py
133 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
134
135 MAINTAINERCLEANFILES = \
136         $(docpng) \
137         $(maninput) \
138         doc/install-quick.rst \
139         doc/news.rst \
140         doc/upgrade.rst \
141         vcs-version
142
143 maintainer-clean-local:
144         rm -rf $(BUILDTIME_DIRS)
145
146 CLEANFILES = \
147         $(addsuffix /*.py[co],$(DIRS)) \
148         $(addsuffix /*.hi,$(HTOOLS_DIRS)) \
149         $(addsuffix /*.o,$(HTOOLS_DIRS)) \
150         $(PYTHON_BOOTSTRAP) \
151         epydoc.conf \
152         $(REPLACE_VARS_SED) \
153         daemons/daemon-util \
154         daemons/ganeti-cleaner \
155         devel/upload \
156         $(BUILT_EXAMPLES) \
157         doc/examples/bash_completion \
158         lib/_generated_rpc.py \
159         $(man_MANS) \
160         $(manhtml) \
161         tools/kvm-ifup \
162         stamp-directories \
163         stamp-srclinks \
164         $(nodist_pkgpython_PYTHON) \
165         $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
166         $(HS_BUILT_TEST_HELPERS) \
167         .hpc/*.mix htools/*.tix htest/*.tix \
168         doc/hs-lint.html
169
170 GENERATED_FILES = \
171         $(built_base_sources) \
172         $(BUILT_PYTHON_SOURCES) \
173         $(PYTHON_BOOTSTRAP)
174
175 built_base_sources = \
176         stamp-directories \
177         stamp-srclinks
178
179 built_python_base_sources = \
180         lib/_autoconf.py \
181         lib/_vcsversion.py
182
183 BUILT_PYTHON_SOURCES = \
184         $(built_python_base_sources) \
185         lib/_generated_rpc.py
186
187 # Generating the RPC wrappers depends on many things, so make sure
188 # it's built at the end of the built sources
189 lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
190
191 # these are all built from the underlying %.in sources
192 BUILT_EXAMPLES = \
193         doc/examples/ganeti-kvm-poweroff.initd \
194         doc/examples/ganeti.cron \
195         doc/examples/ganeti.initd \
196         doc/examples/gnt-config-backup \
197         doc/examples/hooks/ipsec
198
199 nodist_pkgpython_PYTHON = \
200         $(BUILT_PYTHON_SOURCES)
201
202 noinst_PYTHON = \
203         lib/build/__init__.py \
204         lib/build/sphinx_ext.py \
205         lib/build/shell_example_lexer.py
206
207 pkgpython_PYTHON = \
208         lib/__init__.py \
209         lib/asyncnotifier.py \
210         lib/backend.py \
211         lib/bdev.py \
212         lib/bootstrap.py \
213         lib/cli.py \
214         lib/cmdlib.py \
215         lib/compat.py \
216         lib/config.py \
217         lib/constants.py \
218         lib/daemon.py \
219         lib/errors.py \
220         lib/ht.py \
221         lib/jqueue.py \
222         lib/jstore.py \
223         lib/locking.py \
224         lib/luxi.py \
225         lib/mcpu.py \
226         lib/netutils.py \
227         lib/objects.py \
228         lib/objectutils.py \
229         lib/opcodes.py \
230         lib/ovf.py \
231         lib/pathutils.py \
232         lib/qlang.py \
233         lib/query.py \
234         lib/rpc.py \
235         lib/rpc_defs.py \
236         lib/runtime.py \
237         lib/serializer.py \
238         lib/ssconf.py \
239         lib/ssh.py \
240         lib/storage.py \
241         lib/uidpool.py \
242         lib/workerpool.py
243
244 client_PYTHON = \
245         lib/client/__init__.py \
246         lib/client/gnt_backup.py \
247         lib/client/gnt_cluster.py \
248         lib/client/gnt_debug.py \
249         lib/client/gnt_group.py \
250         lib/client/gnt_instance.py \
251         lib/client/gnt_job.py \
252         lib/client/gnt_node.py \
253         lib/client/gnt_os.py
254
255 hypervisor_PYTHON = \
256         lib/hypervisor/__init__.py \
257         lib/hypervisor/hv_base.py \
258         lib/hypervisor/hv_chroot.py \
259         lib/hypervisor/hv_fake.py \
260         lib/hypervisor/hv_kvm.py \
261         lib/hypervisor/hv_lxc.py \
262         lib/hypervisor/hv_xen.py
263
264 rapi_PYTHON = \
265         lib/rapi/__init__.py \
266         lib/rapi/baserlib.py \
267         lib/rapi/client.py \
268         lib/rapi/client_utils.py \
269         lib/rapi/connector.py \
270         lib/rapi/rlib2.py \
271         lib/rapi/testutils.py
272
273 http_PYTHON = \
274         lib/http/__init__.py \
275         lib/http/auth.py \
276         lib/http/client.py \
277         lib/http/server.py
278
279 confd_PYTHON = \
280         lib/confd/__init__.py \
281         lib/confd/client.py \
282         lib/confd/querylib.py \
283         lib/confd/server.py
284
285 masterd_PYTHON = \
286         lib/masterd/__init__.py \
287         lib/masterd/iallocator.py \
288         lib/masterd/instance.py
289
290 impexpd_PYTHON = \
291         lib/impexpd/__init__.py
292
293 watcher_PYTHON = \
294         lib/watcher/__init__.py \
295         lib/watcher/nodemaint.py \
296         lib/watcher/state.py
297
298 server_PYTHON = \
299         lib/server/__init__.py \
300         lib/server/confd.py \
301         lib/server/masterd.py \
302         lib/server/noded.py \
303         lib/server/rapi.py
304
305 pytools_PYTHON = \
306         lib/tools/__init__.py \
307         lib/tools/ensure_dirs.py
308
309 utils_PYTHON = \
310         lib/utils/__init__.py \
311         lib/utils/algo.py \
312         lib/utils/filelock.py \
313         lib/utils/hash.py \
314         lib/utils/io.py \
315         lib/utils/log.py \
316         lib/utils/mlock.py \
317         lib/utils/nodesetup.py \
318         lib/utils/process.py \
319         lib/utils/retry.py \
320         lib/utils/text.py \
321         lib/utils/wrapper.py \
322         lib/utils/x509.py
323
324 docrst = \
325         doc/admin.rst \
326         doc/design-2.0.rst \
327         doc/design-2.1.rst \
328         doc/design-2.2.rst \
329         doc/design-2.3.rst \
330         doc/design-htools-2.3.rst \
331         doc/design-2.4.rst \
332         doc/design-2.5.rst \
333         doc/design-draft.rst \
334         doc/design-oob.rst \
335         doc/design-cpu-pinning.rst \
336         doc/design-query2.rst \
337         doc/design-x509-ca.rst \
338         doc/design-http-server.rst \
339         doc/design-impexp2.rst \
340         doc/design-lu-generated-jobs.rst \
341         doc/design-multi-reloc.rst \
342         doc/design-network.rst \
343         doc/design-chained-jobs.rst \
344         doc/design-ovf-support.rst \
345         doc/design-autorepair.rst \
346         doc/design-resource-model.rst \
347         doc/cluster-merge.rst \
348         doc/design-shared-storage.rst \
349         doc/design-node-state-cache.rst \
350         doc/design-virtual-clusters.rst \
351         doc/design-bulk-create.rst \
352         doc/design-query-splitting.rst \
353         doc/devnotes.rst \
354         doc/glossary.rst \
355         doc/hooks.rst \
356         doc/iallocator.rst \
357         doc/index.rst \
358         doc/install-quick.rst \
359         doc/install.rst \
360         doc/locking.rst \
361         doc/move-instance.rst \
362         doc/news.rst \
363         doc/ovfconverter.rst \
364         doc/rapi.rst \
365         doc/security.rst \
366         doc/upgrade.rst \
367         doc/walkthrough.rst
368
369 HS_PROGS = htools/htools
370 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
371
372 HS_ALL_PROGS = $(HS_PROGS) htest/test htest/hpc-htools htools/hconfd
373 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
374 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=htest/%) htest/hail
375
376 HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
377 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
378 HEXTRA =
379 # internal extra flags (used for htest/test mainly)
380 HEXTRA_INT =
381 # exclude options for coverage reports
382 HPCEXCL = --exclude Main \
383         --exclude Ganeti.Constants \
384         --exclude Ganeti.THH \
385         --exclude Ganeti.HTools.QC \
386         --exclude Ganeti.Version \
387         --exclude Test.Ganeti.TestCommon \
388         --exclude Test.Ganeti.TestHTools \
389         --exclude Test.Ganeti.TestHelper \
390         --exclude Test.Ganeti.TestImports \
391         $(patsubst htools.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
392
393 HS_LIB_SRCS = \
394         htools/Ganeti/HTools/CLI.hs \
395         htools/Ganeti/HTools/Cluster.hs \
396         htools/Ganeti/HTools/Container.hs \
397         htools/Ganeti/HTools/ExtLoader.hs \
398         htools/Ganeti/HTools/Group.hs \
399         htools/Ganeti/HTools/IAlloc.hs \
400         htools/Ganeti/HTools/Instance.hs \
401         htools/Ganeti/HTools/Loader.hs \
402         htools/Ganeti/HTools/Luxi.hs \
403         htools/Ganeti/HTools/Node.hs \
404         htools/Ganeti/HTools/PeerMap.hs \
405         htools/Ganeti/HTools/Rapi.hs \
406         htools/Ganeti/HTools/Simu.hs \
407         htools/Ganeti/HTools/Text.hs \
408         htools/Ganeti/HTools/Types.hs \
409         htools/Ganeti/HTools/Utils.hs \
410         htools/Ganeti/HTools/Program.hs \
411         htools/Ganeti/HTools/Program/Hail.hs \
412         htools/Ganeti/HTools/Program/Hbal.hs \
413         htools/Ganeti/HTools/Program/Hcheck.hs \
414         htools/Ganeti/HTools/Program/Hinfo.hs \
415         htools/Ganeti/HTools/Program/Hscan.hs \
416         htools/Ganeti/HTools/Program/Hspace.hs \
417         htools/Ganeti/BasicTypes.hs \
418         htools/Ganeti/Common.hs \
419         htools/Ganeti/Compat.hs \
420         htools/Ganeti/Confd.hs \
421         htools/Ganeti/Confd/Server.hs \
422         htools/Ganeti/Confd/Utils.hs \
423         htools/Ganeti/Config.hs \
424         htools/Ganeti/Daemon.hs \
425         htools/Ganeti/Hash.hs \
426         htools/Ganeti/Jobs.hs \
427         htools/Ganeti/JSON.hs \
428         htools/Ganeti/Logging.hs \
429         htools/Ganeti/Luxi.hs \
430         htools/Ganeti/Objects.hs \
431         htools/Ganeti/OpCodes.hs \
432         htools/Ganeti/Query/Common.hs \
433         htools/Ganeti/Query/Filter.hs \
434         htools/Ganeti/Query/Language.hs \
435         htools/Ganeti/Query/Node.hs \
436         htools/Ganeti/Query/Query.hs \
437         htools/Ganeti/Query/Server.hs \
438         htools/Ganeti/Query/Types.hs \
439         htools/Ganeti/Rpc.hs \
440         htools/Ganeti/Runtime.hs \
441         htools/Ganeti/Ssconf.hs \
442         htools/Ganeti/THH.hs
443
444 HS_TEST_SRCS = \
445         htest/Test/Ganeti/BasicTypes.hs \
446         htest/Test/Ganeti/Common.hs \
447         htest/Test/Ganeti/Daemon.hs \
448         htest/Test/Ganeti/Confd/Utils.hs \
449         htest/Test/Ganeti/HTools/CLI.hs \
450         htest/Test/Ganeti/HTools/Cluster.hs \
451         htest/Test/Ganeti/HTools/Container.hs \
452         htest/Test/Ganeti/HTools/Instance.hs \
453         htest/Test/Ganeti/HTools/Loader.hs \
454         htest/Test/Ganeti/HTools/Node.hs \
455         htest/Test/Ganeti/HTools/PeerMap.hs \
456         htest/Test/Ganeti/HTools/Simu.hs \
457         htest/Test/Ganeti/HTools/Text.hs \
458         htest/Test/Ganeti/HTools/Types.hs \
459         htest/Test/Ganeti/HTools/Utils.hs \
460         htest/Test/Ganeti/JSON.hs \
461         htest/Test/Ganeti/Jobs.hs \
462         htest/Test/Ganeti/Luxi.hs \
463         htest/Test/Ganeti/Objects.hs \
464         htest/Test/Ganeti/OpCodes.hs \
465         htest/Test/Ganeti/Query/Filter.hs \
466         htest/Test/Ganeti/Query/Language.hs \
467         htest/Test/Ganeti/Query/Query.hs \
468         htest/Test/Ganeti/Rpc.hs \
469         htest/Test/Ganeti/Ssconf.hs \
470         htest/Test/Ganeti/TestCommon.hs \
471         htest/Test/Ganeti/TestHTools.hs \
472         htest/Test/Ganeti/TestHelper.hs
473
474 HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
475
476 HS_BUILT_SRCS = \
477         htest/Test/Ganeti/TestImports.hs \
478         htools/Ganeti/Constants.hs \
479         htools/Ganeti/Version.hs
480 HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
481
482 $(RUN_IN_TEMPDIR): | stamp-directories
483
484 # Note: we use here an order-only prerequisite, as the contents of
485 # _autoconf.py are not actually influencing the html build output: it
486 # has to exist in order for the sphinx module to be loaded
487 # successfully, but we certainly don't want the docs to be rebuilt if
488 # it changes
489 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
490         $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
491         lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
492         | $(BUILT_PYTHON_SOURCES)
493         @test -n "$(SPHINX)" || \
494             { echo 'sphinx-build' not found during configure; exit 1; }
495         @mkdir_p@ $(dir $@)
496         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
497             -d . \
498             -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
499             -D release="$(PACKAGE_VERSION)" \
500             $(abs_top_srcdir)/doc $(CURDIR)/doc/html
501         rm -f doc/html/.buildinfo doc/html/objects.inv
502         touch $@
503
504 doc/html: doc/html/index.html
505
506 doc/install-quick.rst: INSTALL
507 doc/news.rst: NEWS
508 doc/upgrade.rst: UPGRADE
509
510 doc/install-quick.rst doc/news.rst doc/upgrade.rst:
511         set -e; \
512         { echo '.. This file is automatically updated at build time from $<.'; \
513           echo '.. Do not edit.'; \
514           echo; \
515           cat $<; \
516         } > $@
517
518 docdot = \
519         doc/arch-2.0.dot \
520         doc/design-2.1-lock-acquire.dot \
521         doc/design-2.1-lock-release.dot
522
523 docpng = $(patsubst %.dot,%.png,$(docdot))
524
525 # Things to build but not to install (add it to EXTRA_DIST if it should be
526 # distributed)
527 noinst_DATA = \
528         devel/upload \
529         doc/html \
530         $(BUILT_EXAMPLES) \
531         doc/examples/bash_completion \
532         $(manhtml)
533
534 gnt_scripts = \
535         scripts/gnt-backup \
536         scripts/gnt-cluster \
537         scripts/gnt-debug \
538         scripts/gnt-group \
539         scripts/gnt-instance \
540         scripts/gnt-job \
541         scripts/gnt-node \
542         scripts/gnt-os
543
544 PYTHON_BOOTSTRAP_SBIN = \
545         daemons/ganeti-masterd \
546         daemons/ganeti-noded \
547         daemons/ganeti-watcher \
548         daemons/ganeti-rapi \
549         $(gnt_scripts)
550
551 if PY_CONFD
552 PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
553 endif
554
555 PYTHON_BOOTSTRAP = \
556         $(PYTHON_BOOTSTRAP_SBIN) \
557         tools/ensure-dirs
558
559 qa_scripts = \
560         qa/__init__.py \
561         qa/ganeti-qa.py \
562         qa/qa_cluster.py \
563         qa/qa_config.py \
564         qa/qa_daemon.py \
565         qa/qa_env.py \
566         qa/qa_error.py \
567         qa/qa_group.py \
568         qa/qa_instance.py \
569         qa/qa_job.py \
570         qa/qa_node.py \
571         qa/qa_os.py \
572         qa/qa_rapi.py \
573         qa/qa_tags.py \
574         qa/qa_utils.py
575
576 bin_SCRIPTS =
577 if WANT_HTOOLS
578 bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
579 install-exec-hook:
580         @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
581 # FIXME: this is a hardcoded logic, instead of auto-resolving
582         $(LN_S) -f ../../../bin/htools \
583                    $(DESTDIR)$(iallocatorsdir)/hail
584         for role in $(HS_BIN_ROLES); do \
585                 $(LN_S) -f htools \
586                            $(DESTDIR)$(bindir)/$$role ; \
587         done
588 if HS_CONFD
589         mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
590 endif
591 endif
592
593 $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
594         @if [ -z "$(HTOOLS)" ]; then \
595           echo "Error: htools compilation disabled at configure time" 1>&2 ;\
596           exit 1; \
597         fi
598         @if [ "$(notdir $@)" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
599           echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
600           exit 1; \
601         fi
602         @rm -f $(notdir $@).tix
603         $(GHC) --make \
604           $(HFLAGS) \
605           $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
606           -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
607           $(HEXTRA) $(HEXTRA_INT) $@
608         @touch "$@"
609
610 # for the htest/test binary, we need to enable profiling/coverage
611 htest/test: HEXTRA_INT=-fhpc -ihtest
612
613 # we compile the hpc-htools binary with the program coverage
614 htest/hpc-htools: HEXTRA_INT=-fhpc
615
616 # test dependency
617 htest/offline-tests.sh: htest/hpc-htools
618
619 # rules for building profiling-enabled versions of the haskell
620 # programs: hs-prof does the full two-step build, whereas
621 # hs-prof-quick does only the final rebuild (hs-prof must have been
622 # run before)
623 .PHONY: hs-prof hs-prof-quick
624 hs-prof:
625         $(MAKE) $(AM_MAKEFLAGS) clean
626         $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
627         rm -f $(HS_ALL_PROGS)
628         $(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
629
630 hs-prof-quick:
631         $(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
632
633 dist_sbin_SCRIPTS = \
634         tools/ganeti-listrunner
635
636 nodist_sbin_SCRIPTS = \
637         $(PYTHON_BOOTSTRAP_SBIN) \
638         daemons/ganeti-cleaner
639
640 if HS_CONFD
641 nodist_sbin_SCRIPTS += htools/hconfd
642 endif
643
644 python_scripts = \
645         tools/burnin \
646         tools/cfgshell \
647         tools/cfgupgrade \
648         tools/cfgupgrade12 \
649         tools/cluster-merge \
650         tools/confd-client \
651         tools/fmtjson \
652         tools/lvmstrap \
653         tools/move-instance \
654         tools/ovfconverter \
655         tools/setup-ssh \
656         tools/sanitize-config
657
658 dist_tools_SCRIPTS = \
659         $(python_scripts) \
660         tools/kvm-console-wrapper \
661         tools/xm-console-wrapper \
662         tools/master-ip-setup
663
664 pkglib_python_scripts = \
665         daemons/import-export \
666         tools/check-cert-expired
667
668 nodist_pkglib_python_scripts = \
669         tools/ensure-dirs
670
671 myexeclib_SCRIPTS = \
672         daemons/daemon-util \
673         tools/kvm-ifup \
674         $(pkglib_python_scripts)
675
676 nodist_myexeclib_SCRIPTS = \
677         $(nodist_pkglib_python_scripts)
678
679 EXTRA_DIST = \
680         NEWS \
681         UPGRADE \
682         epydoc.conf.in \
683         pylintrc \
684         autotools/build-bash-completion \
685         autotools/build-rpc \
686         autotools/check-header \
687         autotools/check-python-code \
688         autotools/check-imports \
689         autotools/check-man-dashes \
690         autotools/check-man-warnings \
691         autotools/check-news \
692         autotools/check-tar \
693         autotools/check-version \
694         autotools/convert-constants \
695         autotools/docpp \
696         autotools/gen-coverage \
697         autotools/testrunner \
698         autotools/wrong-hardcoded-paths \
699         $(RUN_IN_TEMPDIR) \
700         daemons/daemon-util.in \
701         daemons/ganeti-cleaner.in \
702         $(pkglib_python_scripts) \
703         devel/upload.in \
704         tools/kvm-ifup.in \
705         $(docdot) \
706         $(docpng) \
707         $(docrst) \
708         doc/conf.py \
709         doc/html \
710         $(BUILT_EXAMPLES:%=%.in) \
711         doc/examples/ganeti.default \
712         doc/examples/ganeti.default-debug \
713         doc/examples/hooks/ethers \
714         doc/examples/gnt-debug/README \
715         doc/examples/gnt-debug/delay0.json \
716         doc/examples/gnt-debug/delay50.json \
717         test/lockperf.py \
718         test/testutils.py \
719         test/mocks.py \
720         $(dist_TESTS) \
721         $(TEST_FILES) \
722         man/footer.rst \
723         $(manrst) \
724         $(maninput) \
725         qa/qa-sample.json \
726         $(qa_scripts) \
727         $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
728         $(HS_PROG_SRCS) \
729         htools/lint-hints.hs \
730         htest/cli-tests-defs.sh \
731         htest/offline-test.sh
732
733 man_MANS = \
734         man/ganeti.7 \
735         man/ganeti-cleaner.8 \
736         man/ganeti-confd.8 \
737         man/ganeti-listrunner.8 \
738         man/ganeti-masterd.8 \
739         man/ganeti-noded.8 \
740         man/ganeti-os-interface.7 \
741         man/ganeti-rapi.8 \
742         man/ganeti-watcher.8 \
743         man/gnt-backup.8 \
744         man/gnt-cluster.8 \
745         man/gnt-debug.8 \
746         man/gnt-group.8 \
747         man/gnt-instance.8 \
748         man/gnt-job.8 \
749         man/gnt-node.8 \
750         man/gnt-os.8 \
751         man/hail.1 \
752         man/hbal.1 \
753         man/hcheck.1 \
754         man/hinfo.1 \
755         man/hscan.1 \
756         man/hspace.1 \
757         man/htools.1
758
759 manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
760 manhtml = $(patsubst %.rst,%.html,$(manrst))
761 mangen = $(patsubst %.rst,%.gen,$(manrst))
762 maninput = \
763         $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
764         $(patsubst %.html,%.html.in,$(manhtml)) \
765         man/footer.man man/footer.html $(mangen)
766
767 TEST_FILES = \
768         test/data/bdev-drbd-8.0.txt \
769         test/data/bdev-drbd-8.3.txt \
770         test/data/bdev-drbd-disk.txt \
771         test/data/bdev-drbd-net-ip4.txt \
772         test/data/bdev-drbd-net-ip6.txt \
773         test/data/cert1.pem \
774         test/data/ip-addr-show-dummy0.txt \
775         test/data/ip-addr-show-lo-ipv4.txt \
776         test/data/ip-addr-show-lo-ipv6.txt \
777         test/data/ip-addr-show-lo-oneline-ipv4.txt \
778         test/data/ip-addr-show-lo-oneline-ipv6.txt \
779         test/data/ip-addr-show-lo-oneline.txt \
780         test/data/ip-addr-show-lo.txt \
781         test/data/proc_drbd8.txt \
782         test/data/proc_drbd80-emptyline.txt \
783         test/data/proc_drbd83.txt \
784         test/data/proc_drbd83_sync.txt \
785         test/data/proc_drbd83_sync_krnl2.6.39.txt \
786         test/data/kvm_1.0_help.txt \
787         test/data/kvm_0.15.90_help.txt \
788         test/data/kvm_0.12.5_help.txt \
789         test/data/kvm_0.9.1_help.txt \
790         test/data/sys_drbd_usermode_helper.txt \
791         test/data/ovfdata/compr_disk.vmdk.gz \
792         test/data/ovfdata/config.ini \
793         test/data/ovfdata/corrupted_resources.ovf \
794         test/data/ovfdata/empty.ini \
795         test/data/ovfdata/empty.ovf \
796         test/data/ovfdata/ganeti.mf \
797         test/data/ovfdata/ganeti.ovf \
798         test/data/ovfdata/gzip_disk.ovf \
799         test/data/ovfdata/new_disk.vmdk \
800         test/data/ovfdata/no_disk.ini \
801         test/data/ovfdata/no_disk_in_ref.ovf \
802         test/data/ovfdata/no_os.ini \
803         test/data/ovfdata/no_ovf.ova \
804         test/data/ovfdata/ova.ova \
805         test/data/ovfdata/second_disk.vmdk \
806         test/data/ovfdata/rawdisk.raw \
807         test/data/ovfdata/unsafe_path.ini \
808         test/data/ovfdata/virtualbox.ovf \
809         test/data/ovfdata/wrong_extension.ovd \
810         test/data/ovfdata/wrong_config.ini \
811         test/data/ovfdata/wrong_manifest.mf \
812         test/data/ovfdata/wrong_manifest.ovf \
813         test/data/ovfdata/wrong_ova.ova \
814         test/data/ovfdata/wrong_xml.ovf \
815         test/data/ovfdata/other/rawdisk.raw \
816         test/data/vgreduce-removemissing-2.02.02.txt \
817         test/data/vgreduce-removemissing-2.02.66-fail.txt \
818         test/data/vgreduce-removemissing-2.02.66-ok.txt \
819         test/data/vgs-missing-pvs-2.02.02.txt \
820         test/data/vgs-missing-pvs-2.02.66.txt \
821         test/import-export_unittest-helper \
822         test/gnt-cli.test \
823         test/ganeti-cli.test \
824         htest/shelltests/htools-balancing.test \
825         htest/shelltests/htools-basic.test \
826         htest/shelltests/htools-dynutil.test \
827         htest/shelltests/htools-excl.test \
828         htest/shelltests/htools-hail.test \
829         htest/shelltests/htools-hspace.test \
830         htest/shelltests/htools-invalid.test \
831         htest/shelltests/htools-multi-group.test \
832         htest/shelltests/htools-no-backend.test \
833         htest/shelltests/htools-rapi.test \
834         htest/shelltests/htools-single-group.test \
835         htest/shelltests/htools-text-backend.test \
836         htest/data/hail-alloc-drbd.json \
837         htest/data/hail-change-group.json \
838         htest/data/hail-invalid-reloc.json \
839         htest/data/hail-node-evac.json \
840         htest/data/hail-reloc-drbd.json \
841         htest/data/hbal-split-insts.data \
842         htest/data/common-suffix.data \
843         htest/data/invalid-node.data \
844         htest/data/missing-resources.data \
845         htest/data/rapi/groups.json \
846         htest/data/rapi/info.json \
847         htest/data/rapi/instances.json \
848         htest/data/rapi/nodes.json
849
850 python_tests = \
851         doc/examples/rapi_testutils.py \
852         test/ganeti.asyncnotifier_unittest.py \
853         test/ganeti.backend_unittest.py \
854         test/ganeti.bdev_unittest.py \
855         test/ganeti.cli_unittest.py \
856         test/ganeti.client.gnt_cluster_unittest.py \
857         test/ganeti.client.gnt_instance_unittest.py \
858         test/ganeti.daemon_unittest.py \
859         test/ganeti.cmdlib_unittest.py \
860         test/ganeti.compat_unittest.py \
861         test/ganeti.confd.client_unittest.py \
862         test/ganeti.config_unittest.py \
863         test/ganeti.constants_unittest.py \
864         test/ganeti.errors_unittest.py \
865         test/ganeti.hooks_unittest.py \
866         test/ganeti.ht_unittest.py \
867         test/ganeti.http_unittest.py \
868         test/ganeti.hypervisor_unittest.py \
869         test/ganeti.hypervisor.hv_chroot_unittest.py \
870         test/ganeti.hypervisor.hv_fake_unittest.py \
871         test/ganeti.hypervisor.hv_kvm_unittest.py \
872         test/ganeti.hypervisor.hv_lxc_unittest.py \
873         test/ganeti.hypervisor.hv_xen_unittest.py \
874         test/ganeti.impexpd_unittest.py \
875         test/ganeti.jqueue_unittest.py \
876         test/ganeti.jstore_unittest.py \
877         test/ganeti.locking_unittest.py \
878         test/ganeti.luxi_unittest.py \
879         test/ganeti.masterd.instance_unittest.py \
880         test/ganeti.mcpu_unittest.py \
881         test/ganeti.netutils_unittest.py \
882         test/ganeti.objects_unittest.py \
883         test/ganeti.objectutils_unittest.py \
884         test/ganeti.opcodes_unittest.py \
885         test/ganeti.ovf_unittest.py \
886         test/ganeti.qlang_unittest.py \
887         test/ganeti.query_unittest.py \
888         test/ganeti.rapi.baserlib_unittest.py \
889         test/ganeti.rapi.client_unittest.py \
890         test/ganeti.rapi.resources_unittest.py \
891         test/ganeti.rapi.rlib2_unittest.py \
892         test/ganeti.rapi.testutils_unittest.py \
893         test/ganeti.rpc_unittest.py \
894         test/ganeti.runtime_unittest.py \
895         test/ganeti.serializer_unittest.py \
896         test/ganeti.ssh_unittest.py \
897         test/ganeti.storage_unittest.py \
898         test/ganeti.tools.ensure_dirs_unittest.py \
899         test/ganeti.uidpool_unittest.py \
900         test/ganeti.utils.algo_unittest.py \
901         test/ganeti.utils.filelock_unittest.py \
902         test/ganeti.utils.hash_unittest.py \
903         test/ganeti.utils.io_unittest.py \
904         test/ganeti.utils.log_unittest.py \
905         test/ganeti.utils.mlock_unittest.py \
906         test/ganeti.utils.nodesetup_unittest.py \
907         test/ganeti.utils.process_unittest.py \
908         test/ganeti.utils.retry_unittest.py \
909         test/ganeti.utils.text_unittest.py \
910         test/ganeti.utils.wrapper_unittest.py \
911         test/ganeti.utils.x509_unittest.py \
912         test/ganeti.utils_unittest.py \
913         test/ganeti.workerpool_unittest.py \
914         test/qa.qa_config_unittest.py \
915         test/cfgupgrade_unittest.py \
916         test/docs_unittest.py \
917         test/pycurl_reset_unittest.py \
918         test/tempfile_fork_unittest.py
919 if HAS_FAKEROOT
920 python_tests += test/ganeti.utils.io_unittest-runasroot.py
921 endif
922
923 haskell_tests = htest/test
924
925 dist_TESTS = \
926         test/check-cert-expired_unittest.bash \
927         test/daemon-util_unittest.bash \
928         test/ganeti-cleaner_unittest.bash \
929         test/import-export_unittest.bash \
930         test/cli-test.bash \
931         $(python_tests)
932
933 nodist_TESTS =
934 check_SCRIPTS =
935
936 if WANT_HTOOLSTESTS
937 nodist_TESTS += $(haskell_tests)
938 dist_TESTS += htest/offline-test.sh
939 check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
940 endif
941
942 TESTS = $(dist_TESTS) $(nodist_TESTS)
943
944 # Environment for all tests
945 PLAIN_TESTS_ENVIRONMENT = \
946         PYTHONPATH=. \
947         TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
948         PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
949         $(RUN_IN_TEMPDIR)
950
951 # Environment for tests run by automake
952 TESTS_ENVIRONMENT = \
953         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
954
955 all_python_code = \
956         $(dist_sbin_SCRIPTS) \
957         $(python_scripts) \
958         $(pkglib_python_scripts) \
959         $(nodist_pkglib_python_scripts) \
960         $(python_tests) \
961         $(pkgpython_PYTHON) \
962         $(client_PYTHON) \
963         $(hypervisor_PYTHON) \
964         $(rapi_PYTHON) \
965         $(server_PYTHON) \
966         $(pytools_PYTHON) \
967         $(http_PYTHON) \
968         $(confd_PYTHON) \
969         $(masterd_PYTHON) \
970         $(impexpd_PYTHON) \
971         $(utils_PYTHON) \
972         $(watcher_PYTHON) \
973         $(noinst_PYTHON) \
974         $(qa_scripts)
975
976 srclink_files = \
977         man/footer.rst \
978         test/check-cert-expired_unittest.bash \
979         test/daemon-util_unittest.bash \
980         test/ganeti-cleaner_unittest.bash \
981         test/import-export_unittest.bash \
982         test/cli-test.bash \
983         htest/offline-test.sh \
984         htest/cli-tests-defs.sh \
985         $(all_python_code) \
986         $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
987
988 check_python_code = \
989         $(BUILD_BASH_COMPLETION) \
990         $(CHECK_IMPORTS) \
991         $(CHECK_HEADER) \
992         $(DOCPP) \
993         $(all_python_code)
994
995 lint_python_code = \
996         ganeti \
997         ganeti/http/server.py \
998         $(dist_sbin_SCRIPTS) \
999         $(python_scripts) \
1000         $(pkglib_python_scripts) \
1001         $(BUILD_BASH_COMPLETION) \
1002         $(CHECK_IMPORTS) \
1003         $(CHECK_HEADER) \
1004         $(DOCPP) \
1005         $(PYTHON_BOOTSTRAP)
1006
1007 standalone_python_modules = \
1008         lib/rapi/client.py \
1009         tools/ganeti-listrunner
1010
1011 pep8_python_code = \
1012         ganeti \
1013         ganeti/http/server.py \
1014         $(dist_sbin_SCRIPTS) \
1015         $(python_scripts) \
1016         $(pkglib_python_scripts) \
1017         $(BUILD_BASH_COMPLETION) \
1018         $(CHECK_HEADER) \
1019         $(DOCPP) \
1020         $(PYTHON_BOOTSTRAP) \
1021         qa
1022
1023 test/daemon-util_unittest.bash: daemons/daemon-util
1024
1025 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1026
1027 tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1028         sed -f $(REPLACE_VARS_SED) < $< > $@
1029         chmod +x $@
1030
1031 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
1032         sed -f $(REPLACE_VARS_SED) < $< > $@
1033         chmod u+x $@
1034
1035 daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1036         sed -f $(REPLACE_VARS_SED) < $< > $@
1037         chmod +x $@
1038
1039 doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1040         sed -f $(REPLACE_VARS_SED) < $< > $@
1041
1042 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1043         lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1044         $(GENERATED_FILES)
1045         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
1046
1047 doc/%.png: doc/%.dot
1048         @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1049         $(DOT) -Tpng -o $@ $<
1050
1051 man/footer.man: man/footer.rst
1052         @test -n "$(PANDOC)" || \
1053           { echo 'pandoc' not found during configure; exit 1; }
1054         $(PANDOC) -f rst -t man -o $@ $<
1055
1056 man/footer.html: man/footer.rst
1057         @test -n "$(PANDOC)" || \
1058           { echo 'pandoc' not found during configure; exit 1; }
1059         $(PANDOC) -f rst -t html -o $@ $<
1060
1061 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1062         lib/build/shell_example_lexer.py \
1063         | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1064         @echo "Checking $< for hardcoded paths..."
1065         @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1066           echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1067           exit 1; \
1068         fi
1069         set -e ; \
1070         trap 'echo auto-removing $@; rm $@' EXIT; \
1071         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1072         trap - EXIT
1073
1074 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1075         @test -n "$(PANDOC)" || \
1076           { echo 'pandoc' not found during configure; exit 1; }
1077         set -o pipefail ; \
1078         trap 'echo auto-removing $@; rm $@' EXIT; \
1079         $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1080           sed -e 's/\\@/@/g' > $@; \
1081         if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1082         $(CHECK_MAN_DASHES) $@; \
1083         trap - EXIT
1084
1085
1086 man/%.html.in: man/%.gen man/footer.html
1087         @test -n "$(PANDOC)" || \
1088           { echo 'pandoc' not found during configure; exit 1; }
1089         set -o pipefail ; \
1090         $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1091           sed -e 's/\\@/@/g' > $@
1092
1093 man/%: man/%.in  $(REPLACE_VARS_SED)
1094         sed -f $(REPLACE_VARS_SED) < $< > $@
1095
1096 epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1097         sed -f $(REPLACE_VARS_SED) < $< > $@
1098
1099 vcs-version:
1100         if test -d .git; then \
1101           git describe > $@; \
1102         elif test ! -f $@ ; then \
1103           echo "Cannot auto-generate $@ file"; exit 1; \
1104         fi
1105
1106 .PHONY: clean-vcs-version
1107 clean-vcs-version:
1108         rm -f vcs-version
1109
1110 .PHONY: regen-vcs-version
1111 regen-vcs-version:
1112         set -e; \
1113         cd $(srcdir); \
1114         if test -d .git; then \
1115           $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1116           $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1117         fi
1118
1119 htools/Ganeti/Version.hs: htools/Ganeti/Version.hs.in \
1120         vcs-version $(built_base_sources)
1121         set -e; \
1122         VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1123         sed -e "s/%ver%/$$VCSVER/" < $< > $@
1124
1125 htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1126         lib/constants.py lib/_autoconf.py lib/luxi.py \
1127         $(CONVERT_CONSTANTS) $(built_base_sources) \
1128         | lib/_vcsversion.py
1129         set -e; \
1130         { cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1131
1132 htest/Test/Ganeti/TestImports.hs: htest/Test/Ganeti/TestImports.hs.in \
1133         $(built_base_sources)
1134         set -e; \
1135         { cat $< ; \
1136           echo ; \
1137           for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst htools/%,%,$(HS_LIB_SRCS))))) ; do \
1138             echo "import $$name ()" ; \
1139           done ; \
1140         } > $@
1141
1142 lib/_autoconf.py: Makefile | stamp-directories
1143         set -e; \
1144         { echo '# This file is automatically generated, do not edit!'; \
1145           echo '#'; \
1146           echo ''; \
1147           echo '"""Build-time configuration for Ganeti.'; \
1148           echo '';\
1149           echo 'This file is autogenerated by the build process.'; \
1150           echo 'For any changes you need to re-run ./configure (and'; \
1151           echo 'not edit by hand).'; \
1152           echo ''; \
1153           echo '"""'; \
1154           echo ''; \
1155           echo '# pylint: disable=C0301,C0324'; \
1156           echo '# because this is autogenerated, we do not want'; \
1157           echo '# style warnings' ; \
1158           echo ''; \
1159           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1160           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1161           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1162           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1163           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1164           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1165           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1166           echo "SYSCONFDIR = '$(sysconfdir)'"; \
1167           echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1168           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1169           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1170           echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1171           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1172           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1173           echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1174           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1175           echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1176           echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1177           echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1178           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1179           echo "KVM_PATH = '$(KVM_PATH)'"; \
1180           echo "IP_PATH = '$(IP_PATH)'"; \
1181           echo "SOCAT_PATH = '$(SOCAT)'"; \
1182           echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1183           echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1184           echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1185           echo "TOOLSDIR = '$(toolsdir)'"; \
1186           echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1187           echo "PKGLIBDIR = '$(pkglibdir)'"; \
1188           echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1189           echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1190           echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1191           echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1192           echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1193           echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1194           echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1195           echo "RAPI_USER = '$(RAPI_USER)'"; \
1196           echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1197           echo "CONFD_USER = '$(CONFD_USER)'"; \
1198           echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1199           echo "NODED_USER = '$(NODED_USER)'"; \
1200           echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1201           echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1202           echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1203           if [ "$(HTOOLS)" ]; then \
1204             echo "HTOOLS = True"; \
1205           else \
1206             echo "HTOOLS = False"; \
1207           fi; \
1208           echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1209           echo "PY_CONFD = $(PY_CONFD)"; \
1210           echo "HS_CONFD = $(HS_CONFD)"; \
1211           echo "XEN_CMD = '$(XEN_CMD)'"; \
1212           echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1213         } > $@
1214
1215 lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1216         set -e; \
1217         VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1218         { echo '# This file is automatically generated, do not edit!'; \
1219           echo '#'; \
1220           echo ''; \
1221           echo '"""Build-time VCS version number for Ganeti.'; \
1222           echo '';\
1223           echo 'This file is autogenerated by the build process.'; \
1224           echo 'For any changes you need to re-run ./configure (and'; \
1225           echo 'not edit by hand).'; \
1226           echo ''; \
1227           echo '"""'; \
1228           echo ''; \
1229           echo '# pylint: disable=C0301,C0324'; \
1230           echo '# because this is autogenerated, we do not want'; \
1231           echo '# style warnings' ; \
1232           echo ''; \
1233           echo "VCS_VERSION = '$$VCSVER'"; \
1234         } > $@
1235
1236 lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1237         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1238
1239 $(REPLACE_VARS_SED): Makefile stamp-directories
1240         set -e; \
1241         { echo 's#@PREFIX@#$(prefix)#g'; \
1242           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1243           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1244           echo 's#@BINDIR@#$(bindir)#g'; \
1245           echo 's#@SBINDIR@#$(sbindir)#g'; \
1246           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1247           echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1248           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1249           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1250           echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1251           echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1252           echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1253           echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1254           echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1255           echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1256           echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1257           echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1258           echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1259           echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1260           echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1261           echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1262           echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1263           echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1264           echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1265           echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1266           echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1267         } > $@
1268
1269 # Using deferred evaluation
1270 daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1271 daemons/ganeti-watcher: MODULE = ganeti.watcher
1272 scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1273 tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1274 $(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1275
1276 $(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1277         test -n "$(MODULE)" || { echo Missing module; exit 1; }
1278         set -e; \
1279         { echo '#!/usr/bin/python'; \
1280           echo '# This file is automatically generated, do not edit!'; \
1281           echo "# Edit $(MODULE) instead."; \
1282           echo; \
1283           echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1284           echo; \
1285           echo '# pylint: disable=C0103'; \
1286           echo '# C0103: Invalid name'; \
1287           echo; \
1288           echo 'import sys'; \
1289           echo 'import $(MODULE) as main'; \
1290           echo; \
1291           echo '# Temporarily alias commands until bash completion'; \
1292           echo '# generator is changed'; \
1293           echo 'if hasattr(main, "commands"):'; \
1294           echo '  commands = main.commands # pylint: disable=E1101'; \
1295           echo 'if hasattr(main, "aliases"):'; \
1296           echo '  aliases = main.aliases # pylint: disable=E1101'; \
1297           echo; \
1298           echo 'if __name__ == "__main__":'; \
1299           echo '  sys.exit(main.Main())'; \
1300         } > $@
1301         chmod u+x $@
1302
1303 $(HS_BUILT_TEST_HELPERS): Makefile
1304         @test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1305         set -e; \
1306         { echo '#!/bin/sh'; \
1307           echo '# This file is automatically generated, do not edit!'; \
1308           echo "# Edit Makefile.am instead."; \
1309           echo; \
1310           echo "HTOOLS=$(TESTROLE) exec ./htest/hpc-htools \"\$$@\""; \
1311         } > $@
1312         chmod u+x $@
1313
1314 stamp-directories: Makefile
1315         $(MAKE) $(AM_MAKEFLAGS) ganeti
1316         @mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1317         touch $@
1318
1319 # We need to create symlinks because "make distcheck" will not install Python
1320 # files when building.
1321 stamp-srclinks: Makefile | stamp-directories
1322         set -e; \
1323         for i in $(srclink_files); do \
1324                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1325                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1326                 fi; \
1327         done
1328         touch $@
1329
1330 .PHONY: ganeti
1331 ganeti:
1332         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1333
1334 .PHONY: check-dirs
1335 check-dirs: $(GENERATED_FILES)
1336         @set -e; \
1337         find . -type d \( \( -name . \) -o \( \
1338                 -name .git -o \
1339                 -name autom4te.cache \
1340                 \) -prune -o -print \) | { \
1341                 error=; \
1342                 while read dir; do \
1343                         case "$$dir" in \
1344                                 $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1345                                 *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1346                         esac; \
1347                 done; \
1348                 for dir in $(DIRS); do \
1349                         if ! test -d "$$dir"; then \
1350                                 echo "Directory $$dir listed in DIRS does not exist" >&2; \
1351                                 error=1; \
1352                         fi \
1353                 done; \
1354                 if test -n "$$error"; then exit 1; else exit 0; fi; \
1355         }
1356
1357 .PHONY: check-local
1358 check-local: check-dirs $(GENERATED_FILES)
1359         $(CHECK_PYTHON_CODE) $(check_python_code)
1360         PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1361         $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1362         $(CHECK_NEWS) < $(top_srcdir)/NEWS
1363         PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1364         expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1365         if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1366                 echo "Incorrect version in README, expected $$expver"; \
1367                 exit 1; \
1368         fi; \
1369         for file in doc/iallocator.rst doc/hooks.rst; do \
1370                 if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1371                         "Documents Ganeti version $$expver"; then \
1372                         echo "Incorrect version in $$file, expected $$expver"; \
1373                         exit 1; \
1374                 fi; \
1375         done
1376
1377 .PHONY: hs-check
1378 hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1379         @rm -f test.tix
1380         ./htest/test
1381         HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1382
1383 # E111: indentation is not a multiple of four
1384 # E121: continuation line indentation is not a multiple of four
1385 #       (since our indent level is not 4)
1386 # E125: continuation line does not distinguish itself from next logical line
1387 #       (since our indent level is not 4)
1388 # E127: continuation line over-indented for visual indent
1389 #       (since our indent level is not 4)
1390 # note: do NOT add E128 here; it's a valid style error in most cases!
1391 # I've seen real errors, but also some cases were we indent wrongly
1392 # due to line length; try to rework the cases where it is triggered,
1393 # instead of silencing it
1394 # E261: at least two spaces before inline comment
1395 # E501: line too long (80 characters)
1396 PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1397
1398 # For excluding pep8 expects filenames only, not whole paths
1399 PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1400
1401 LINT_TARGETS = pylint pylint-qa
1402 if HAS_PEP8
1403 LINT_TARGETS += pep8
1404 endif
1405 if HAS_HLINT
1406 LINT_TARGETS += hlint
1407 endif
1408
1409 .PHONY: lint
1410 lint: $(LINT_TARGETS)
1411
1412 .PHONY: pylint
1413 pylint: $(GENERATED_FILES)
1414         @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1415         $(PYLINT) $(LINT_OPTS) $(lint_python_code)
1416
1417 .PHONY: pylint-qa
1418 pylint-qa: $(GENERATED_FILES)
1419         @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1420         cd $(top_srcdir)/qa && \
1421           PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1422           --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1423
1424 .PHONY: pep8
1425 pep8: $(GENERATED_FILES)
1426         @test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1427         $(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1428                 --repeat $(pep8_python_code)
1429
1430 # FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1431 .PHONY: hlint
1432 hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1433         @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1434         if tty -s; then C="-c"; else C=""; fi; \
1435         $(HLINT) --report=doc/hs-lint.html --cross $$C \
1436           --ignore "Use first" \
1437           --ignore "Use comparing" \
1438           --ignore "Use on" \
1439           --ignore "Reduce duplication" \
1440           --ignore "Use &&&" \
1441           --ignore "Use void" \
1442           --hint htools/lint-hints \
1443           $(filter-out htools/Ganeti/THH.hs,$(HS_LIBTEST_SRCS))
1444
1445 # a dist hook rule for updating the vcs-version file; this is
1446 # hardcoded due to where it needs to build the file...
1447 dist-hook:
1448         $(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1449         rm -f $(top_distdir)/vcs-version
1450         cp -p $(srcdir)/vcs-version $(top_distdir)
1451
1452 # a distcheck hook rule for catching revision control directories
1453 distcheck-hook:
1454         if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1455                 echo "Found revision control files in final archive." 1>&2; \
1456                 exit 1; \
1457         fi
1458         if find $(top_distdir) -name '*.py[co]' | grep .; then \
1459                 echo "Found Python byte code in final archive." 1>&2; \
1460                 exit 1; \
1461         fi
1462         if find $(top_distdir) -name '*~' | grep .; then \
1463                 echo "Found backup files in final archive." 1>&2; \
1464                 exit 1; \
1465         fi
1466 # Empty files or directories should not be distributed. They can cause
1467 # unnecessary warnings for packagers. Directories used by automake during
1468 # distcheck must be excluded.
1469         if find $(top_distdir) -empty -and -not \( \
1470                         -path $(top_distdir)/_build -or \
1471                         -path $(top_distdir)/_inst \) | grep .; then \
1472                 echo "Found empty files or directories in final archive." 1>&2; \
1473                 exit 1; \
1474         fi
1475         if test -n "$(BUILD_RELEASE)" && \
1476            grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1477                 echo "Found unreleased version in NEWS." >&2; \
1478                 exit 1; \
1479         fi
1480
1481 # When building a release, stricter checks should be used
1482 distcheck-release dist-release: export BUILD_RELEASE = 1
1483 distcheck-release: distcheck
1484
1485 distrebuildcheck: dist
1486         set -e; \
1487         builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1488         trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1489         cd $$builddir; \
1490         tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1491         cd $(distdir); \
1492         ./configure; \
1493         $(MAKE) maintainer-clean; \
1494         cp $(abs_srcdir)/vcs-version .; \
1495         ./configure; \
1496         $(MAKE) $(AM_MAKEFLAGS)
1497
1498 dist-release: dist
1499         set -e; \
1500         for i in $(DIST_ARCHIVES); do \
1501                 echo -n "Checking $$i ... "; \
1502                 autotools/check-tar < $$i; \
1503                 echo OK; \
1504         done
1505
1506 install-exec-local:
1507         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1508           "$(DESTDIR)${localstatedir}/log/ganeti" \
1509           "$(DESTDIR)${localstatedir}/run/ganeti"
1510
1511 .PHONY: apidoc
1512 if WANT_HTOOLSAPIDOC
1513 apidoc: py-apidoc hs-apidoc
1514 else
1515 apidoc: py-apidoc
1516 endif
1517
1518 .PHONY: py-apidoc
1519 py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1520         $(RUN_IN_TEMPDIR) epydoc -v \
1521                 --conf $(CURDIR)/epydoc.conf \
1522                 --output $(CURDIR)/$(APIDOC_PY_DIR)
1523
1524 .PHONY: hs-apidoc
1525 hs-apidoc: $(HS_BUILT_SRCS)
1526         @test -n "$(HSCOLOUR)" || \
1527             { echo 'HsColour' not found during configure; exit 1; }
1528         @test -n "$(HADDOCK)" || \
1529             { echo 'haddock' not found during configure; exit 1; }
1530         rm -rf $(APIDOC_HS_DIR)/*
1531         @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1532         @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1533         @mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1534         $(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1535         $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1536         $(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1537         set -e ; \
1538         cd htools; \
1539         if [ "$(HTOOLS_NOCURL)" ]; \
1540         then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1541         else OPTGHC=""; \
1542         fi; \
1543         if [ "$(HTOOLS_PARALLEL3)" ]; \
1544         then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1545         fi; \
1546         RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
1547         for file in $$RELSRCS; do \
1548                 hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1549                 $(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1550         done ; \
1551         $(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1552                 -t ganeti-htools -p haddock-prologue \
1553                 --source-module="%{MODULE/.//}.html" \
1554                 --source-entity="%{MODULE/.//}.html#%{NAME}" \
1555                 $$OPTGHC \
1556                 $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1557
1558 .PHONY: TAGS
1559 TAGS: $(GENERATED_FILES)
1560         rm -f TAGS
1561         $(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIBTEST_SRCS)
1562         find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1563           -path './daemons/ganeti-*' -o -path './tools/*' -o \
1564           -path './qa/*.py' | \
1565           etags -l python -a -
1566
1567 .PHONY: coverage
1568 if WANT_HTOOLS
1569 coverage: py-coverage hs-coverage
1570 else
1571 coverage: py-coverage
1572 endif
1573
1574 .PHONY: py-coverage
1575 py-coverage: $(GENERATED_FILES) $(python_tests)
1576         set -e; \
1577         COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1578         TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1579         HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1580         $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1581         $(python_tests)
1582
1583 .PHONY: hs-coverage
1584 hs-coverage: $(haskell_tests) htest/hpc-htools
1585         rm -f *.tix
1586         $(MAKE) $(AM_MAKEFLAGS) hs-check
1587         @mkdir_p@ $(COVERAGE_HS_DIR)
1588         hpc combine --union $(HPCEXCL) \
1589           test.tix hpc-htools.tix > coverage-htools.tix
1590         hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1591         hpc report coverage-htools.tix
1592         $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1593
1594 # Special "kind-of-QA" target for htools, needs special setup (all
1595 # tools compiled with -fhpc)
1596 .PHONY: live-test
1597 live-test: all
1598         set -e ; \
1599         cd htools; \
1600         rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1601         rm -f *.tix *.mix; \
1602         ./live-test.sh; \
1603         hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1604           --output=live-test.tix ; \
1605         @mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1606         hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1607                 --srcdir=.. $(HPCEXCL) ; \
1608         hpc report --srcdir=.. live-test $(HPCEXCL)
1609
1610 commit-check: distcheck lint apidoc
1611
1612 .PHONY: gitignore-check
1613 gitignore-check:
1614         @if [ -n "`git status --short`" ]; then \
1615           echo "Git status is not clean!" 1>&2 ; \
1616           git status --short; \
1617           exit 1; \
1618         fi
1619
1620 # we don't need the ancient implicit rules:
1621 %: %,v
1622 %: RCS/%,v
1623 %: RCS/%
1624 %: s.%
1625 %: SCCS/s.%
1626
1627 -include ./Makefile.local
1628
1629 # vim: set noet :