Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 4cbe9bda

History | View | Annotate | Download (44 kB)

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

    
64
DIRS = \
65
	autotools \
66
	daemons \
67
	devel \
68
	doc \
69
	doc/examples \
70
	doc/examples/hooks \
71
	doc/examples/gnt-debug \
72
	$(HTOOLS_DIRS) \
73
	lib \
74
	lib/client \
75
	lib/build \
76
	lib/confd \
77
	lib/http \
78
	lib/hypervisor \
79
	lib/impexpd \
80
	lib/masterd \
81
	lib/rapi \
82
	lib/server \
83
	lib/tools \
84
	lib/utils \
85
	lib/watcher \
86
	man \
87
	qa \
88
	test \
89
	test/data \
90
	test/data/htools \
91
	test/data/htools/rapi \
92
	test/data/ovfdata \
93
	test/data/ovfdata/other \
94
	tools
95

    
96
BUILDTIME_DIR_AUTOCREATE = \
97
	scripts \
98
	$(APIDOC_DIR) \
99
	$(APIDOC_PY_DIR) \
100
	$(APIDOC_HS_DIR) \
101
	$(APIDOC_HS_DIR)/Ganeti \
102
	$(APIDOC_HS_DIR)/Ganeti/Confd \
103
	$(APIDOC_HS_DIR)/Ganeti/HTools \
104
	$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
105
	$(COVERAGE_DIR) \
106
	$(COVERAGE_PY_DIR) \
107
	$(COVERAGE_HS_DIR) \
108
	.hpc
109

    
110
BUILDTIME_DIRS = \
111
	$(BUILDTIME_DIR_AUTOCREATE) \
112
	doc/html
113

    
114
DIRCHECK_EXCLUDE = \
115
	$(BUILDTIME_DIRS) \
116
	ganeti-[0-9]*.[0-9]*.[0-9]* \
117
	doc/html/_*
118

    
119
# some helper vars
120
COVERAGE_DIR = doc/coverage
121
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
122
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
123
APIDOC_DIR = doc/api
124
APIDOC_PY_DIR = $(APIDOC_DIR)/py
125
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
126

    
127
MAINTAINERCLEANFILES = \
128
	$(docpng) \
129
	$(maninput) \
130
	doc/install-quick.rst \
131
	doc/news.rst \
132
	doc/upgrade.rst \
133
	vcs-version
134

    
135
maintainer-clean-local:
136
	rm -rf $(BUILDTIME_DIRS)
137

    
138
CLEANFILES = \
139
	$(addsuffix /*.py[co],$(DIRS)) \
140
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
141
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
142
	$(PYTHON_BOOTSTRAP) \
143
	epydoc.conf \
144
	$(REPLACE_VARS_SED) \
145
	daemons/daemon-util \
146
	daemons/ganeti-cleaner \
147
	devel/upload \
148
	$(BUILT_EXAMPLES) \
149
	doc/examples/bash_completion \
150
	lib/_generated_rpc.py \
151
	$(man_MANS) \
152
	$(manhtml) \
153
	tools/kvm-ifup \
154
	stamp-directories \
155
	stamp-srclinks \
156
	$(nodist_pkgpython_PYTHON) \
157
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
158
	$(HS_BUILT_TEST_HELPERS) \
159
	.hpc/*.mix htools/*.tix \
160
	doc/hs-lint.html
161

    
162
GENERATED_FILES = \
163
	$(built_base_sources) \
164
	$(BUILT_PYTHON_SOURCES) \
165
	$(PYTHON_BOOTSTRAP)
166

    
167
built_base_sources = \
168
	stamp-directories \
169
	stamp-srclinks
170

    
171
built_python_base_sources = \
172
	lib/_autoconf.py \
173
	lib/_vcsversion.py
174

    
175
BUILT_PYTHON_SOURCES = \
176
	$(built_python_base_sources) \
177
	lib/_generated_rpc.py
178

    
179
# Generating the RPC wrappers depends on many things, so make sure
180
# it's built at the end of the built sources
181
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
182

    
183
# these are all built from the underlying %.in sources
184
BUILT_EXAMPLES = \
185
	doc/examples/ganeti-kvm-poweroff.initd \
186
	doc/examples/ganeti.cron \
187
	doc/examples/ganeti.initd \
188
	doc/examples/gnt-config-backup \
189
	doc/examples/hooks/ipsec
190

    
191
nodist_pkgpython_PYTHON = \
192
	$(BUILT_PYTHON_SOURCES)
193

    
194
noinst_PYTHON = \
195
	lib/build/__init__.py \
196
	lib/build/sphinx_ext.py \
197
	lib/build/shell_example_lexer.py
198

    
199
pkgpython_PYTHON = \
200
	lib/__init__.py \
201
	lib/asyncnotifier.py \
202
	lib/backend.py \
203
	lib/bdev.py \
204
	lib/bootstrap.py \
205
	lib/cli.py \
206
	lib/cmdlib.py \
207
	lib/compat.py \
208
	lib/config.py \
209
	lib/constants.py \
210
	lib/daemon.py \
211
	lib/errors.py \
212
	lib/ht.py \
213
	lib/jqueue.py \
214
	lib/jstore.py \
215
	lib/locking.py \
216
	lib/luxi.py \
217
	lib/mcpu.py \
218
	lib/netutils.py \
219
	lib/objects.py \
220
	lib/opcodes.py \
221
	lib/ovf.py \
222
	lib/qlang.py \
223
	lib/query.py \
224
	lib/rpc.py \
225
	lib/rpc_defs.py \
226
	lib/runtime.py \
227
	lib/serializer.py \
228
	lib/ssconf.py \
229
	lib/ssh.py \
230
	lib/storage.py \
231
	lib/uidpool.py \
232
	lib/workerpool.py
233

    
234
client_PYTHON = \
235
	lib/client/__init__.py \
236
	lib/client/gnt_backup.py \
237
	lib/client/gnt_cluster.py \
238
	lib/client/gnt_debug.py \
239
	lib/client/gnt_group.py \
240
	lib/client/gnt_instance.py \
241
	lib/client/gnt_job.py \
242
	lib/client/gnt_node.py \
243
	lib/client/gnt_os.py
244

    
245
hypervisor_PYTHON = \
246
	lib/hypervisor/__init__.py \
247
	lib/hypervisor/hv_base.py \
248
	lib/hypervisor/hv_chroot.py \
249
	lib/hypervisor/hv_fake.py \
250
	lib/hypervisor/hv_kvm.py \
251
	lib/hypervisor/hv_lxc.py \
252
	lib/hypervisor/hv_xen.py
253

    
254
rapi_PYTHON = \
255
	lib/rapi/__init__.py \
256
	lib/rapi/baserlib.py \
257
	lib/rapi/client.py \
258
	lib/rapi/client_utils.py \
259
	lib/rapi/connector.py \
260
	lib/rapi/rlib2.py \
261
	lib/rapi/testutils.py
262

    
263
http_PYTHON = \
264
	lib/http/__init__.py \
265
	lib/http/auth.py \
266
	lib/http/client.py \
267
	lib/http/server.py
268

    
269
confd_PYTHON = \
270
	lib/confd/__init__.py \
271
	lib/confd/client.py \
272
	lib/confd/querylib.py \
273
	lib/confd/server.py
274

    
275
masterd_PYTHON = \
276
	lib/masterd/__init__.py \
277
	lib/masterd/instance.py
278

    
279
impexpd_PYTHON = \
280
	lib/impexpd/__init__.py
281

    
282
watcher_PYTHON = \
283
	lib/watcher/__init__.py \
284
	lib/watcher/nodemaint.py \
285
	lib/watcher/state.py
286

    
287
server_PYTHON = \
288
	lib/server/__init__.py \
289
	lib/server/confd.py \
290
	lib/server/masterd.py \
291
	lib/server/noded.py \
292
	lib/server/rapi.py
293

    
294
pytools_PYTHON = \
295
	lib/tools/__init__.py \
296
	lib/tools/ensure_dirs.py
297

    
298
utils_PYTHON = \
299
	lib/utils/__init__.py \
300
	lib/utils/algo.py \
301
	lib/utils/filelock.py \
302
	lib/utils/hash.py \
303
	lib/utils/io.py \
304
	lib/utils/log.py \
305
	lib/utils/mlock.py \
306
	lib/utils/nodesetup.py \
307
	lib/utils/process.py \
308
	lib/utils/retry.py \
309
	lib/utils/text.py \
310
	lib/utils/wrapper.py \
311
	lib/utils/x509.py
312

    
313
docrst = \
314
	doc/admin.rst \
315
	doc/design-2.0.rst \
316
	doc/design-2.1.rst \
317
	doc/design-2.2.rst \
318
	doc/design-2.3.rst \
319
	doc/design-htools-2.3.rst \
320
	doc/design-2.4.rst \
321
	doc/design-2.5.rst \
322
	doc/design-draft.rst \
323
	doc/design-oob.rst \
324
	doc/design-cpu-pinning.rst \
325
	doc/design-query2.rst \
326
	doc/design-x509-ca.rst \
327
	doc/design-http-server.rst \
328
	doc/design-impexp2.rst \
329
	doc/design-lu-generated-jobs.rst \
330
	doc/design-multi-reloc.rst \
331
	doc/design-network.rst \
332
	doc/design-chained-jobs.rst \
333
	doc/design-ovf-support.rst \
334
	doc/design-resource-model.rst \
335
	doc/cluster-merge.rst \
336
	doc/design-shared-storage.rst \
337
	doc/design-node-state-cache.rst \
338
	doc/design-virtual-clusters.rst \
339
	doc/design-bulk-create.rst \
340
	doc/design-query-splitting.rst \
341
	doc/devnotes.rst \
342
	doc/glossary.rst \
343
	doc/hooks.rst \
344
	doc/iallocator.rst \
345
	doc/index.rst \
346
	doc/install-quick.rst \
347
	doc/install.rst \
348
	doc/locking.rst \
349
	doc/move-instance.rst \
350
	doc/news.rst \
351
	doc/ovfconverter.rst \
352
	doc/rapi.rst \
353
	doc/security.rst \
354
	doc/upgrade.rst \
355
	doc/walkthrough.rst
356

    
357
HS_PROGS = htools/htools
358
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
359

    
360
HS_ALL_PROGS = $(HS_PROGS) htools/test htools/hpc-htools htools/hconfd
361
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
362
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail
363

    
364
HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
365
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
366
HEXTRA =
367
# internal extra flags (used for htools/test mainly)
368
HEXTRA_INT =
369
# exclude options for coverage reports
370
HPCEXCL = --exclude Main \
371
	--exclude Ganeti.Constants \
372
	--exclude Ganeti.THH \
373
	--exclude Ganeti.HTools.QC \
374
	--exclude Ganeti.HTools.QCHelper \
375
	--exclude Ganeti.HTools.Version
376

    
377
HS_LIB_SRCS = \
378
	htools/Ganeti/HTools/CLI.hs \
379
	htools/Ganeti/HTools/Cluster.hs \
380
	htools/Ganeti/HTools/Compat.hs \
381
	htools/Ganeti/HTools/Container.hs \
382
	htools/Ganeti/HTools/ExtLoader.hs \
383
	htools/Ganeti/HTools/Group.hs \
384
	htools/Ganeti/HTools/IAlloc.hs \
385
	htools/Ganeti/HTools/Instance.hs \
386
	htools/Ganeti/HTools/JSON.hs \
387
	htools/Ganeti/HTools/Loader.hs \
388
	htools/Ganeti/HTools/Luxi.hs \
389
	htools/Ganeti/HTools/Node.hs \
390
	htools/Ganeti/HTools/PeerMap.hs \
391
	htools/Ganeti/HTools/QC.hs \
392
	htools/Ganeti/HTools/QCHelper.hs \
393
	htools/Ganeti/HTools/Rapi.hs \
394
	htools/Ganeti/HTools/Simu.hs \
395
	htools/Ganeti/HTools/Text.hs \
396
	htools/Ganeti/HTools/Types.hs \
397
	htools/Ganeti/HTools/Utils.hs \
398
	htools/Ganeti/HTools/Program.hs \
399
	htools/Ganeti/HTools/Program/Hail.hs \
400
	htools/Ganeti/HTools/Program/Hbal.hs \
401
	htools/Ganeti/HTools/Program/Hcheck.hs \
402
	htools/Ganeti/HTools/Program/Hinfo.hs \
403
	htools/Ganeti/HTools/Program/Hscan.hs \
404
	htools/Ganeti/HTools/Program/Hspace.hs \
405
	htools/Ganeti/BasicTypes.hs \
406
	htools/Ganeti/Confd.hs \
407
	htools/Ganeti/Confd/Server.hs \
408
	htools/Ganeti/Confd/Utils.hs \
409
	htools/Ganeti/Config.hs \
410
	htools/Ganeti/Daemon.hs \
411
	htools/Ganeti/Hash.hs \
412
	htools/Ganeti/Jobs.hs \
413
	htools/Ganeti/Logging.hs \
414
	htools/Ganeti/Luxi.hs \
415
	htools/Ganeti/Objects.hs \
416
	htools/Ganeti/OpCodes.hs \
417
	htools/Ganeti/Rpc.hs \
418
	htools/Ganeti/Qlang.hs \
419
	htools/Ganeti/Query/Query.hs \
420
	htools/Ganeti/Queryd.hs \
421
	htools/Ganeti/Runtime.hs \
422
	htools/Ganeti/Ssconf.hs \
423
	htools/Ganeti/THH.hs
424

    
425
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
426
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
427

    
428
$(RUN_IN_TEMPDIR): | stamp-directories
429

    
430
# Note: we use here an order-only prerequisite, as the contents of
431
# _autoconf.py are not actually influencing the html build output: it
432
# has to exist in order for the sphinx module to be loaded
433
# successfully, but we certainly don't want the docs to be rebuilt if
434
# it changes
435
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
436
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
437
	lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
438
	| $(BUILT_PYTHON_SOURCES)
439
	@test -n "$(SPHINX)" || \
440
	    { echo 'sphinx-build' not found during configure; exit 1; }
441
	@mkdir_p@ $(dir $@)
442
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
443
	    -d . \
444
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
445
	    -D release="$(PACKAGE_VERSION)" \
446
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
447
	rm -f doc/html/.buildinfo doc/html/objects.inv
448
	touch $@
449

    
450
doc/html: doc/html/index.html
451

    
452
doc/install-quick.rst: INSTALL
453
doc/news.rst: NEWS
454
doc/upgrade.rst: UPGRADE
455

    
456
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
457
	set -e; \
458
	{ echo '.. This file is automatically updated at build time from $<.'; \
459
	  echo '.. Do not edit.'; \
460
	  echo; \
461
	  cat $<; \
462
	} > $@
463

    
464
docdot = \
465
	doc/arch-2.0.dot \
466
	doc/design-2.1-lock-acquire.dot \
467
	doc/design-2.1-lock-release.dot
468

    
469
docpng = $(patsubst %.dot,%.png,$(docdot))
470

    
471
# Things to build but not to install (add it to EXTRA_DIST if it should be
472
# distributed)
473
noinst_DATA = \
474
	devel/upload \
475
	doc/html \
476
	$(BUILT_EXAMPLES) \
477
	doc/examples/bash_completion \
478
	$(manhtml)
479

    
480
gnt_scripts = \
481
	scripts/gnt-backup \
482
	scripts/gnt-cluster \
483
	scripts/gnt-debug \
484
	scripts/gnt-group \
485
	scripts/gnt-instance \
486
	scripts/gnt-job \
487
	scripts/gnt-node \
488
	scripts/gnt-os
489

    
490
PYTHON_BOOTSTRAP_SBIN = \
491
	daemons/ganeti-masterd \
492
	daemons/ganeti-noded \
493
	daemons/ganeti-watcher \
494
	daemons/ganeti-rapi \
495
	$(gnt_scripts)
496

    
497
if PY_CONFD
498
PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
499
endif
500

    
501
PYTHON_BOOTSTRAP = \
502
	$(PYTHON_BOOTSTRAP_SBIN) \
503
	tools/ensure-dirs
504

    
505
qa_scripts = \
506
	qa/__init__.py \
507
	qa/ganeti-qa.py \
508
	qa/qa_cluster.py \
509
	qa/qa_config.py \
510
	qa/qa_daemon.py \
511
	qa/qa_env.py \
512
	qa/qa_error.py \
513
	qa/qa_group.py \
514
	qa/qa_instance.py \
515
	qa/qa_job.py \
516
	qa/qa_node.py \
517
	qa/qa_os.py \
518
	qa/qa_rapi.py \
519
	qa/qa_tags.py \
520
	qa/qa_utils.py
521

    
522
bin_SCRIPTS =
523
if WANT_HTOOLS
524
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
525
install-exec-hook:
526
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
527
# FIXME: this is a hardcoded logic, instead of auto-resolving
528
	$(LN_S) -f ../../../bin/htools \
529
		   $(DESTDIR)$(iallocatorsdir)/hail
530
	for role in $(HS_BIN_ROLES); do \
531
		$(LN_S) -f htools \
532
			   $(DESTDIR)$(bindir)/$$role ; \
533
	done
534
if HS_CONFD
535
	mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
536
endif
537
endif
538

    
539
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
540
	@if [ -z "$(HTOOLS)" ]; then \
541
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
542
	  exit 1; \
543
	fi
544
	@BINARY=$(@:htools/%=%); \
545
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
546
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
547
	  exit 1; \
548
	fi
549
	rm -f $(@:htools/%=%).tix
550
	BINARY=$(@:htools/%=%); $(GHC) --make \
551
	  $(HFLAGS) \
552
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
553
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
554
	  $(HEXTRA) $(HEXTRA_INT) $@
555
	@touch "$@"
556

    
557
# for the htools/test binary, we need to enable profiling/coverage
558
htools/test: HEXTRA_INT=-fhpc
559

    
560
# we compile the hpc-htools binary with the program coverage
561
htools/hpc-htools: HEXTRA_INT=-fhpc
562

    
563
# test dependency
564
htools/offline-tests.sh: htools/hpc-htools
565

    
566
# rules for building profiling-enabled versions of the haskell
567
# programs: hs-prof does the full two-step build, whereas
568
# hs-prof-quick does only the final rebuild (hs-prof must have been
569
# run before)
570
.PHONY: hs-prof hs-prof-quick
571
hs-prof:
572
	$(MAKE) $(AM_MAKEFLAGS) clean
573
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
574
	rm -f $(HS_ALL_PROGS)
575
	$(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
576

    
577
hs-prof-quick:
578
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
579

    
580
dist_sbin_SCRIPTS = \
581
	tools/ganeti-listrunner
582

    
583
nodist_sbin_SCRIPTS = \
584
	$(PYTHON_BOOTSTRAP_SBIN) \
585
	daemons/ganeti-cleaner
586

    
587
if HS_CONFD
588
nodist_sbin_SCRIPTS += htools/hconfd
589
endif
590

    
591
python_scripts = \
592
	tools/burnin \
593
	tools/cfgshell \
594
	tools/cfgupgrade \
595
	tools/cfgupgrade12 \
596
	tools/cluster-merge \
597
	tools/confd-client \
598
	tools/fmtjson \
599
	tools/lvmstrap \
600
	tools/move-instance \
601
	tools/ovfconverter \
602
	tools/setup-ssh \
603
	tools/sanitize-config
604

    
605
dist_tools_SCRIPTS = \
606
	$(python_scripts) \
607
	tools/kvm-console-wrapper \
608
	tools/xm-console-wrapper \
609
	tools/master-ip-setup
610

    
611
pkglib_python_scripts = \
612
	daemons/import-export \
613
	tools/check-cert-expired
614

    
615
nodist_pkglib_python_scripts = \
616
	tools/ensure-dirs
617

    
618
myexeclib_SCRIPTS = \
619
	daemons/daemon-util \
620
	tools/kvm-ifup \
621
	$(pkglib_python_scripts)
622

    
623
nodist_myexeclib_SCRIPTS = \
624
	$(nodist_pkglib_python_scripts)
625

    
626
EXTRA_DIST = \
627
	NEWS \
628
	UPGRADE \
629
	epydoc.conf.in \
630
	pylintrc \
631
	autotools/build-bash-completion \
632
	autotools/build-rpc \
633
	autotools/check-header \
634
	autotools/check-python-code \
635
	autotools/check-imports \
636
	autotools/check-man-dashes \
637
	autotools/check-man-warnings \
638
	autotools/check-news \
639
	autotools/check-tar \
640
	autotools/check-version \
641
	autotools/convert-constants \
642
	autotools/docpp \
643
	autotools/gen-coverage \
644
	autotools/testrunner \
645
	autotools/wrong-hardcoded-paths \
646
	$(RUN_IN_TEMPDIR) \
647
	daemons/daemon-util.in \
648
	daemons/ganeti-cleaner.in \
649
	$(pkglib_python_scripts) \
650
	devel/upload.in \
651
	tools/kvm-ifup.in \
652
	$(docdot) \
653
	$(docpng) \
654
	$(docrst) \
655
	doc/conf.py \
656
	doc/html \
657
	$(BUILT_EXAMPLES:%=%.in) \
658
	doc/examples/ganeti.default \
659
	doc/examples/ganeti.default-debug \
660
	doc/examples/hooks/ethers \
661
	doc/examples/gnt-debug/README \
662
	doc/examples/gnt-debug/delay0.json \
663
	doc/examples/gnt-debug/delay50.json \
664
	test/lockperf.py \
665
	test/testutils.py \
666
	test/mocks.py \
667
	$(dist_TESTS) \
668
	$(TEST_FILES) \
669
	man/footer.rst \
670
	$(manrst) \
671
	$(maninput) \
672
	qa/qa-sample.json \
673
	$(qa_scripts) \
674
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
675
	$(HS_PROG_SRCS) \
676
	htools/lint-hints.hs \
677
	htools/cli-tests-defs.sh \
678
	htools/offline-test.sh
679

    
680
man_MANS = \
681
	man/ganeti.7 \
682
	man/ganeti-cleaner.8 \
683
	man/ganeti-confd.8 \
684
	man/ganeti-listrunner.8 \
685
	man/ganeti-masterd.8 \
686
	man/ganeti-noded.8 \
687
	man/ganeti-os-interface.7 \
688
	man/ganeti-rapi.8 \
689
	man/ganeti-watcher.8 \
690
	man/gnt-backup.8 \
691
	man/gnt-cluster.8 \
692
	man/gnt-debug.8 \
693
	man/gnt-group.8 \
694
	man/gnt-instance.8 \
695
	man/gnt-job.8 \
696
	man/gnt-node.8 \
697
	man/gnt-os.8 \
698
	man/hail.1 \
699
	man/hbal.1 \
700
	man/hcheck.1 \
701
	man/hinfo.1 \
702
	man/hscan.1 \
703
	man/hspace.1 \
704
	man/htools.1
705

    
706
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
707
manhtml = $(patsubst %.rst,%.html,$(manrst))
708
mangen = $(patsubst %.rst,%.gen,$(manrst))
709
maninput = \
710
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
711
	$(patsubst %.html,%.html.in,$(manhtml)) \
712
	man/footer.man man/footer.html $(mangen)
713

    
714
TEST_FILES = \
715
	test/data/bdev-drbd-8.0.txt \
716
	test/data/bdev-drbd-8.3.txt \
717
	test/data/bdev-drbd-disk.txt \
718
	test/data/bdev-drbd-net-ip4.txt \
719
	test/data/bdev-drbd-net-ip6.txt \
720
	test/data/cert1.pem \
721
	test/data/ip-addr-show-dummy0.txt \
722
	test/data/ip-addr-show-lo-ipv4.txt \
723
	test/data/ip-addr-show-lo-ipv6.txt \
724
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
725
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
726
	test/data/ip-addr-show-lo-oneline.txt \
727
	test/data/ip-addr-show-lo.txt \
728
	test/data/proc_drbd8.txt \
729
	test/data/proc_drbd80-emptyline.txt \
730
	test/data/proc_drbd83.txt \
731
	test/data/proc_drbd83_sync.txt \
732
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
733
	test/data/kvm_1.0_help.txt \
734
	test/data/kvm_0.15.90_help.txt \
735
	test/data/kvm_0.12.5_help.txt \
736
	test/data/kvm_0.9.1_help.txt \
737
	test/data/sys_drbd_usermode_helper.txt \
738
	test/data/htools/hail-alloc-drbd.json \
739
	test/data/htools/hail-change-group.json \
740
	test/data/htools/hail-invalid-reloc.json \
741
	test/data/htools/hail-node-evac.json \
742
	test/data/htools/hail-reloc-drbd.json \
743
	test/data/htools/hbal-split-insts.data \
744
	test/data/htools/common-suffix.data \
745
	test/data/htools/invalid-node.data \
746
	test/data/htools/missing-resources.data \
747
	test/data/htools/rapi/groups.json \
748
	test/data/htools/rapi/info.json \
749
	test/data/htools/rapi/instances.json \
750
	test/data/htools/rapi/nodes.json \
751
	test/data/ovfdata/compr_disk.vmdk.gz \
752
	test/data/ovfdata/config.ini \
753
	test/data/ovfdata/corrupted_resources.ovf \
754
	test/data/ovfdata/empty.ini \
755
	test/data/ovfdata/empty.ovf \
756
	test/data/ovfdata/ganeti.mf \
757
	test/data/ovfdata/ganeti.ovf \
758
	test/data/ovfdata/gzip_disk.ovf \
759
	test/data/ovfdata/new_disk.vmdk \
760
	test/data/ovfdata/no_disk.ini \
761
	test/data/ovfdata/no_disk_in_ref.ovf \
762
	test/data/ovfdata/no_os.ini \
763
	test/data/ovfdata/no_ovf.ova \
764
	test/data/ovfdata/ova.ova \
765
	test/data/ovfdata/second_disk.vmdk \
766
	test/data/ovfdata/rawdisk.raw \
767
	test/data/ovfdata/unsafe_path.ini \
768
	test/data/ovfdata/virtualbox.ovf \
769
	test/data/ovfdata/wrong_extension.ovd \
770
	test/data/ovfdata/wrong_config.ini \
771
	test/data/ovfdata/wrong_manifest.mf \
772
	test/data/ovfdata/wrong_manifest.ovf \
773
	test/data/ovfdata/wrong_ova.ova \
774
	test/data/ovfdata/wrong_xml.ovf \
775
	test/data/ovfdata/other/rawdisk.raw \
776
	test/data/vgreduce-removemissing-2.02.02.txt \
777
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
778
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
779
	test/data/vgs-missing-pvs-2.02.02.txt \
780
	test/data/vgs-missing-pvs-2.02.66.txt \
781
	test/import-export_unittest-helper \
782
	test/gnt-cli.test \
783
	test/ganeti-cli.test \
784
	test/htools-balancing.test \
785
	test/htools-basic.test \
786
	test/htools-dynutil.test \
787
	test/htools-excl.test \
788
	test/htools-hail.test \
789
	test/htools-hspace.test \
790
	test/htools-invalid.test \
791
	test/htools-multi-group.test \
792
	test/htools-no-backend.test \
793
	test/htools-rapi.test \
794
	test/htools-single-group.test \
795
	test/htools-text-backend.test
796

    
797
python_tests = \
798
	doc/examples/rapi_testutils.py \
799
	test/ganeti.asyncnotifier_unittest.py \
800
	test/ganeti.backend_unittest.py \
801
	test/ganeti.bdev_unittest.py \
802
	test/ganeti.cli_unittest.py \
803
	test/ganeti.client.gnt_cluster_unittest.py \
804
	test/ganeti.client.gnt_instance_unittest.py \
805
	test/ganeti.daemon_unittest.py \
806
	test/ganeti.cmdlib_unittest.py \
807
	test/ganeti.compat_unittest.py \
808
	test/ganeti.confd.client_unittest.py \
809
	test/ganeti.config_unittest.py \
810
	test/ganeti.constants_unittest.py \
811
	test/ganeti.errors_unittest.py \
812
	test/ganeti.hooks_unittest.py \
813
	test/ganeti.ht_unittest.py \
814
	test/ganeti.http_unittest.py \
815
	test/ganeti.hypervisor_unittest.py \
816
	test/ganeti.hypervisor.hv_chroot_unittest.py \
817
	test/ganeti.hypervisor.hv_fake_unittest.py \
818
	test/ganeti.hypervisor.hv_kvm_unittest.py \
819
	test/ganeti.hypervisor.hv_lxc_unittest.py \
820
	test/ganeti.hypervisor.hv_xen_unittest.py \
821
	test/ganeti.impexpd_unittest.py \
822
	test/ganeti.jqueue_unittest.py \
823
	test/ganeti.jstore_unittest.py \
824
	test/ganeti.locking_unittest.py \
825
	test/ganeti.luxi_unittest.py \
826
	test/ganeti.masterd.instance_unittest.py \
827
	test/ganeti.mcpu_unittest.py \
828
	test/ganeti.netutils_unittest.py \
829
	test/ganeti.objects_unittest.py \
830
	test/ganeti.opcodes_unittest.py \
831
	test/ganeti.ovf_unittest.py \
832
	test/ganeti.qlang_unittest.py \
833
	test/ganeti.query_unittest.py \
834
	test/ganeti.rapi.baserlib_unittest.py \
835
	test/ganeti.rapi.client_unittest.py \
836
	test/ganeti.rapi.resources_unittest.py \
837
	test/ganeti.rapi.rlib2_unittest.py \
838
	test/ganeti.rapi.testutils_unittest.py \
839
	test/ganeti.rpc_unittest.py \
840
	test/ganeti.runtime_unittest.py \
841
	test/ganeti.serializer_unittest.py \
842
	test/ganeti.ssh_unittest.py \
843
	test/ganeti.storage_unittest.py \
844
	test/ganeti.tools.ensure_dirs_unittest.py \
845
	test/ganeti.uidpool_unittest.py \
846
	test/ganeti.utils.algo_unittest.py \
847
	test/ganeti.utils.filelock_unittest.py \
848
	test/ganeti.utils.hash_unittest.py \
849
	test/ganeti.utils.io_unittest.py \
850
	test/ganeti.utils.log_unittest.py \
851
	test/ganeti.utils.mlock_unittest.py \
852
	test/ganeti.utils.nodesetup_unittest.py \
853
	test/ganeti.utils.process_unittest.py \
854
	test/ganeti.utils.retry_unittest.py \
855
	test/ganeti.utils.text_unittest.py \
856
	test/ganeti.utils.wrapper_unittest.py \
857
	test/ganeti.utils.x509_unittest.py \
858
	test/ganeti.utils_unittest.py \
859
	test/ganeti.workerpool_unittest.py \
860
	test/qa.qa_config_unittest.py \
861
	test/cfgupgrade_unittest.py \
862
	test/docs_unittest.py \
863
	test/pycurl_reset_unittest.py \
864
	test/tempfile_fork_unittest.py
865
if HAS_FAKEROOT
866
python_tests += test/ganeti.utils.io_unittest-runasroot.py
867
endif
868

    
869
haskell_tests = htools/test
870

    
871
dist_TESTS = \
872
	test/check-cert-expired_unittest.bash \
873
	test/daemon-util_unittest.bash \
874
	test/ganeti-cleaner_unittest.bash \
875
	test/import-export_unittest.bash \
876
	test/cli-test.bash \
877
	$(python_tests)
878

    
879
nodist_TESTS =
880
check_SCRIPTS =
881

    
882
if WANT_HTOOLSTESTS
883
nodist_TESTS += $(haskell_tests)
884
dist_TESTS += htools/offline-test.sh
885
check_SCRIPTS += htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
886
endif
887

    
888
TESTS = $(dist_TESTS) $(nodist_TESTS)
889

    
890
# Environment for all tests
891
PLAIN_TESTS_ENVIRONMENT = \
892
	PYTHONPATH=. \
893
	TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
894
	PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
895
	$(RUN_IN_TEMPDIR)
896

    
897
# Environment for tests run by automake
898
TESTS_ENVIRONMENT = \
899
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
900

    
901
all_python_code = \
902
	$(dist_sbin_SCRIPTS) \
903
	$(python_scripts) \
904
	$(pkglib_python_scripts) \
905
	$(nodist_pkglib_python_scripts) \
906
	$(python_tests) \
907
	$(pkgpython_PYTHON) \
908
	$(client_PYTHON) \
909
	$(hypervisor_PYTHON) \
910
	$(rapi_PYTHON) \
911
	$(server_PYTHON) \
912
	$(pytools_PYTHON) \
913
	$(http_PYTHON) \
914
	$(confd_PYTHON) \
915
	$(masterd_PYTHON) \
916
	$(impexpd_PYTHON) \
917
	$(utils_PYTHON) \
918
	$(watcher_PYTHON) \
919
	$(noinst_PYTHON) \
920
	$(qa_scripts)
921

    
922
srclink_files = \
923
	man/footer.rst \
924
	test/check-cert-expired_unittest.bash \
925
	test/daemon-util_unittest.bash \
926
	test/ganeti-cleaner_unittest.bash \
927
	test/import-export_unittest.bash \
928
	test/cli-test.bash \
929
	htools/offline-test.sh \
930
	htools/cli-tests-defs.sh \
931
	$(all_python_code) \
932
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
933

    
934
check_python_code = \
935
	$(BUILD_BASH_COMPLETION) \
936
	$(CHECK_IMPORTS) \
937
	$(CHECK_HEADER) \
938
	$(DOCPP) \
939
	$(all_python_code)
940

    
941
lint_python_code = \
942
	ganeti \
943
	ganeti/http/server.py \
944
	$(dist_sbin_SCRIPTS) \
945
	$(python_scripts) \
946
	$(pkglib_python_scripts) \
947
	$(BUILD_BASH_COMPLETION) \
948
	$(CHECK_IMPORTS) \
949
	$(CHECK_HEADER) \
950
	$(DOCPP) \
951
	$(PYTHON_BOOTSTRAP)
952

    
953
standalone_python_modules = \
954
	lib/rapi/client.py \
955
	tools/ganeti-listrunner
956

    
957
pep8_python_code = \
958
	ganeti \
959
	ganeti/http/server.py \
960
	$(dist_sbin_SCRIPTS) \
961
	$(python_scripts) \
962
	$(pkglib_python_scripts) \
963
	$(BUILD_BASH_COMPLETION) \
964
	$(CHECK_HEADER) \
965
	$(DOCPP) \
966
	$(PYTHON_BOOTSTRAP) \
967
	qa
968

    
969
test/daemon-util_unittest.bash: daemons/daemon-util
970

    
971
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
972

    
973
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
974
	sed -f $(REPLACE_VARS_SED) < $< > $@
975
	chmod +x $@
976

    
977
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
978
	sed -f $(REPLACE_VARS_SED) < $< > $@
979
	chmod u+x $@
980

    
981
daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
982
	sed -f $(REPLACE_VARS_SED) < $< > $@
983
	chmod +x $@
984

    
985
doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
986
	sed -f $(REPLACE_VARS_SED) < $< > $@
987

    
988
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
989
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
990
	$(GENERATED_FILES)
991
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
992

    
993
doc/%.png: doc/%.dot
994
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
995
	$(DOT) -Tpng -o $@ $<
996

    
997
man/footer.man: man/footer.rst
998
	@test -n "$(PANDOC)" || \
999
	  { echo 'pandoc' not found during configure; exit 1; }
1000
	$(PANDOC) -f rst -t man -o $@ $<
1001

    
1002
man/footer.html: man/footer.rst
1003
	@test -n "$(PANDOC)" || \
1004
	  { echo 'pandoc' not found during configure; exit 1; }
1005
	$(PANDOC) -f rst -t html -o $@ $<
1006

    
1007
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1008
	lib/build/shell_example_lexer.py \
1009
	| $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1010
	@echo "Checking $< for hardcoded paths..."
1011
	@if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1012
	  echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
1013
	  exit 1; \
1014
	fi
1015
	set -e ; \
1016
	trap 'echo auto-removing $@; rm $@' EXIT; \
1017
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1018
	trap - EXIT
1019

    
1020
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
1021
	@test -n "$(PANDOC)" || \
1022
	  { echo 'pandoc' not found during configure; exit 1; }
1023
	set -o pipefail ; \
1024
	trap 'echo auto-removing $@; rm $@' EXIT; \
1025
	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
1026
	  sed -e 's/\\@/@/g' > $@; \
1027
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1028
	$(CHECK_MAN_DASHES) $@; \
1029
	trap - EXIT
1030

    
1031

    
1032
man/%.html.in: man/%.gen man/footer.html
1033
	@test -n "$(PANDOC)" || \
1034
	  { echo 'pandoc' not found during configure; exit 1; }
1035
	set -o pipefail ; \
1036
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1037
	  sed -e 's/\\@/@/g' > $@
1038

    
1039
man/%: man/%.in  $(REPLACE_VARS_SED)
1040
	sed -f $(REPLACE_VARS_SED) < $< > $@
1041

    
1042
epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1043
	sed -f $(REPLACE_VARS_SED) < $< > $@
1044

    
1045
vcs-version:
1046
	if test -d .git; then \
1047
	  git describe > $@; \
1048
	elif test ! -f $@ ; then \
1049
	  echo "Cannot auto-generate $@ file"; exit 1; \
1050
	fi
1051

    
1052
.PHONY: clean-vcs-version
1053
clean-vcs-version:
1054
	rm -f vcs-version
1055

    
1056
.PHONY: regen-vcs-version
1057
regen-vcs-version:
1058
	set -e; \
1059
	cd $(srcdir); \
1060
	if test -d .git; then \
1061
	  $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1062
	  $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1063
	fi
1064

    
1065
htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in \
1066
	vcs-version $(built_base_sources)
1067
	set -e; \
1068
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1069
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
1070

    
1071
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1072
	lib/constants.py lib/_autoconf.py lib/luxi.py \
1073
	$(CONVERT_CONSTANTS) $(built_base_sources) \
1074
	| lib/_vcsversion.py
1075
	set -e; \
1076
	{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1077

    
1078
lib/_autoconf.py: Makefile | stamp-directories
1079
	set -e; \
1080
	{ echo '# This file is automatically generated, do not edit!'; \
1081
	  echo '#'; \
1082
	  echo ''; \
1083
	  echo '"""Build-time configuration for Ganeti.'; \
1084
	  echo '';\
1085
	  echo 'This file is autogenerated by the build process.'; \
1086
	  echo 'For any changes you need to re-run ./configure (and'; \
1087
	  echo 'not edit by hand).'; \
1088
	  echo ''; \
1089
	  echo '"""'; \
1090
	  echo ''; \
1091
	  echo '# pylint: disable=C0301,C0324'; \
1092
	  echo '# because this is autogenerated, we do not want'; \
1093
	  echo '# style warnings' ; \
1094
	  echo ''; \
1095
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1096
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1097
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1098
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1099
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1100
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1101
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1102
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
1103
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1104
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1105
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1106
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1107
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1108
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1109
	  echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1110
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1111
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1112
	  echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1113
	  echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1114
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1115
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
1116
	  echo "IP_PATH = '$(IP_PATH)'"; \
1117
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
1118
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1119
	  echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1120
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1121
	  echo "TOOLSDIR = '$(toolsdir)'"; \
1122
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1123
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
1124
	  echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1125
	  echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1126
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1127
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1128
	  echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1129
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1130
	  echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1131
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
1132
	  echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1133
	  echo "CONFD_USER = '$(CONFD_USER)'"; \
1134
	  echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1135
	  echo "NODED_USER = '$(NODED_USER)'"; \
1136
	  echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1137
	  echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1138
	  echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1139
	  if [ "$(HTOOLS)" ]; then \
1140
	    echo "HTOOLS = True"; \
1141
	  else \
1142
	    echo "HTOOLS = False"; \
1143
	  fi; \
1144
	  echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1145
	  echo "PY_CONFD = $(PY_CONFD)"; \
1146
	  echo "HS_CONFD = $(HS_CONFD)"; \
1147
	  echo "XEN_CMD = '$(XEN_CMD)'"; \
1148
	  echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1149
	} > $@
1150

    
1151
lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1152
	set -e; \
1153
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1154
	{ echo '# This file is automatically generated, do not edit!'; \
1155
	  echo '#'; \
1156
	  echo ''; \
1157
	  echo '"""Build-time VCS version number for Ganeti.'; \
1158
	  echo '';\
1159
	  echo 'This file is autogenerated by the build process.'; \
1160
	  echo 'For any changes you need to re-run ./configure (and'; \
1161
	  echo 'not edit by hand).'; \
1162
	  echo ''; \
1163
	  echo '"""'; \
1164
	  echo ''; \
1165
	  echo '# pylint: disable=C0301,C0324'; \
1166
	  echo '# because this is autogenerated, we do not want'; \
1167
	  echo '# style warnings' ; \
1168
	  echo ''; \
1169
	  echo "VCS_VERSION = '$$VCSVER'"; \
1170
	} > $@
1171

    
1172
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1173
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1174

    
1175
$(REPLACE_VARS_SED): Makefile stamp-directories
1176
	set -e; \
1177
	{ echo 's#@PREFIX@#$(prefix)#g'; \
1178
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
1179
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
1180
	  echo 's#@BINDIR@#$(bindir)#g'; \
1181
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
1182
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1183
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1184
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1185
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1186
	  echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1187
	  echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1188
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1189
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1190
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
1191
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1192
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
1193
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
1194
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
1195
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1196
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1197
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1198
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1199
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1200
	  echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1201
	  echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1202
	  echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1203
	} > $@
1204

    
1205
# Using deferred evaluation
1206
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1207
daemons/ganeti-watcher: MODULE = ganeti.watcher
1208
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1209
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1210
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/%,%,$@)
1211

    
1212
$(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1213
	test -n "$(MODULE)" || { echo Missing module; exit 1; }
1214
	set -e; \
1215
	{ echo '#!/usr/bin/python'; \
1216
	  echo '# This file is automatically generated, do not edit!'; \
1217
	  echo "# Edit $(MODULE) instead."; \
1218
	  echo; \
1219
	  echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1220
	  echo; \
1221
	  echo '# pylint: disable=C0103'; \
1222
	  echo '# C0103: Invalid name'; \
1223
	  echo; \
1224
	  echo 'import sys'; \
1225
	  echo 'import $(MODULE) as main'; \
1226
	  echo; \
1227
	  echo '# Temporarily alias commands until bash completion'; \
1228
	  echo '# generator is changed'; \
1229
	  echo 'if hasattr(main, "commands"):'; \
1230
	  echo '  commands = main.commands # pylint: disable=E1101'; \
1231
	  echo 'if hasattr(main, "aliases"):'; \
1232
	  echo '  aliases = main.aliases # pylint: disable=E1101'; \
1233
	  echo; \
1234
	  echo 'if __name__ == "__main__":'; \
1235
	  echo '  sys.exit(main.Main())'; \
1236
	} > $@
1237
	chmod u+x $@
1238

    
1239
$(HS_BUILT_TEST_HELPERS): Makefile
1240
	@test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1241
	set -e; \
1242
	{ echo '#!/bin/sh'; \
1243
	  echo '# This file is automatically generated, do not edit!'; \
1244
	  echo "# Edit Makefile.am instead."; \
1245
	  echo; \
1246
	  echo "HTOOLS=$(TESTROLE) exec ./htools/hpc-htools \"\$$@\""; \
1247
	} > $@
1248
	chmod u+x $@
1249

    
1250
stamp-directories: Makefile
1251
	$(MAKE) $(AM_MAKEFLAGS) ganeti
1252
	@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1253
	touch $@
1254

    
1255
# We need to create symlinks because "make distcheck" will not install Python
1256
# files when building.
1257
stamp-srclinks: Makefile | stamp-directories
1258
	set -e; \
1259
	for i in $(srclink_files); do \
1260
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1261
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
1262
		fi; \
1263
	done
1264
	touch $@
1265

    
1266
.PHONY: ganeti
1267
ganeti:
1268
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1269

    
1270
.PHONY: check-dirs
1271
check-dirs: $(GENERATED_FILES)
1272
	@set -e; \
1273
	find . -type d \( \( -name . \) -o \( \
1274
		-name .git -o \
1275
		-name autom4te.cache \
1276
		\) -prune -o -print \) | { \
1277
		error=; \
1278
		while read dir; do \
1279
			case "$$dir" in \
1280
				$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1281
				*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1282
			esac; \
1283
		done; \
1284
		for dir in $(DIRS); do \
1285
			if ! test -d "$$dir"; then \
1286
				echo "Directory $$dir listed in DIRS does not exist" >&2; \
1287
				error=1; \
1288
			fi \
1289
		done; \
1290
		if test -n "$$error"; then exit 1; else exit 0; fi; \
1291
	}
1292

    
1293
.PHONY: check-local
1294
check-local: check-dirs $(GENERATED_FILES)
1295
	$(CHECK_PYTHON_CODE) $(check_python_code)
1296
	PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1297
	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1298
	$(CHECK_NEWS) < $(top_srcdir)/NEWS
1299
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1300
	expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1301
	if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1302
		echo "Incorrect version in README, expected $$expver"; \
1303
		exit 1; \
1304
	fi; \
1305
	for file in doc/iallocator.rst doc/hooks.rst; do \
1306
		if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1307
			"Documents Ganeti version $$expver"; then \
1308
			echo "Incorrect version in $$file, expected $$expver"; \
1309
			exit 1; \
1310
		fi; \
1311
	done
1312

    
1313
.PHONY: hs-check
1314
hs-check: htools/test htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
1315
	@rm -f test.tix
1316
	./htools/test
1317
	HBINARY="./htools/hpc-htools" ./htools/offline-test.sh
1318

    
1319
# E111: indentation is not a multiple of four
1320
# E121: continuation line indentation is not a multiple of four
1321
#       (since our indent level is not 4)
1322
# E125: continuation line does not distinguish itself from next logical line
1323
#       (since our indent level is not 4)
1324
# E127: continuation line over-indented for visual indent
1325
#       (since our indent level is not 4)
1326
# note: do NOT add E128 here; it's a valid style error in most cases!
1327
# I've seen real errors, but also some cases were we indent wrongly
1328
# due to line length; try to rework the cases where it is triggered,
1329
# instead of silencing it
1330
# E261: at least two spaces before inline comment
1331
# E501: line too long (80 characters)
1332
PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1333

    
1334
# For excluding pep8 expects filenames only, not whole paths
1335
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1336

    
1337
LINT_TARGETS = pylint pylint-qa
1338
if HAS_PEP8
1339
LINT_TARGETS += pep8
1340
endif
1341
if HAS_HLINT
1342
LINT_TARGETS += hlint
1343
endif
1344

    
1345
.PHONY: lint
1346
lint: $(LINT_TARGETS)
1347

    
1348
.PHONY: pylint
1349
pylint: $(GENERATED_FILES)
1350
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1351
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1352

    
1353
.PHONY: pylint-qa
1354
pylint-qa: $(GENERATED_FILES)
1355
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1356
	cd $(top_srcdir)/qa && \
1357
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1358
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1359

    
1360
.PHONY: pep8
1361
pep8: $(GENERATED_FILES)
1362
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1363
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1364
		--repeat $(pep8_python_code)
1365

    
1366
# FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1367
.PHONY: hlint
1368
hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1369
	@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1370
	if tty -s; then C="-c"; else C=""; fi; \
1371
	$(HLINT) --report=doc/hs-lint.html --cross $$C \
1372
	  --ignore "Use first" \
1373
	  --ignore "Use comparing" \
1374
	  --ignore "Use on" \
1375
	  --ignore "Reduce duplication" \
1376
	  --ignore "Use &&&" \
1377
	  --ignore "Use void" \
1378
	  --hint htools/lint-hints \
1379
	  $(filter-out htools/Ganeti/THH.hs,$(HS_LIB_SRCS))
1380

    
1381
# a dist hook rule for updating the vcs-version file; this is
1382
# hardcoded due to where it needs to build the file...
1383
dist-hook:
1384
	$(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1385
	rm -f $(top_distdir)/vcs-version
1386
	cp -p $(srcdir)/vcs-version $(top_distdir)
1387

    
1388
# a distcheck hook rule for catching revision control directories
1389
distcheck-hook:
1390
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1391
		echo "Found revision control files in final archive." 1>&2; \
1392
		exit 1; \
1393
	fi
1394
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
1395
		echo "Found Python byte code in final archive." 1>&2; \
1396
		exit 1; \
1397
	fi
1398
	if find $(top_distdir) -name '*~' | grep .; then \
1399
		echo "Found backup files in final archive." 1>&2; \
1400
		exit 1; \
1401
	fi
1402
# Empty files or directories should not be distributed. They can cause
1403
# unnecessary warnings for packagers. Directories used by automake during
1404
# distcheck must be excluded.
1405
	if find $(top_distdir) -empty -and -not \( \
1406
			-path $(top_distdir)/_build -or \
1407
			-path $(top_distdir)/_inst \) | grep .; then \
1408
		echo "Found empty files or directories in final archive." 1>&2; \
1409
		exit 1; \
1410
	fi
1411
	if test -n "$(BUILD_RELEASE)" && \
1412
	   grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \
1413
		echo "Found unreleased version in NEWS." >&2; \
1414
		exit 1; \
1415
	fi
1416

    
1417
# When building a release, stricter checks should be used
1418
distcheck-release dist-release: export BUILD_RELEASE = 1
1419
distcheck-release: distcheck
1420

    
1421
distrebuildcheck: dist
1422
	set -e; \
1423
	builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1424
	trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1425
	cd $$builddir; \
1426
	tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1427
	cd $(distdir); \
1428
	./configure; \
1429
	$(MAKE) maintainer-clean; \
1430
	cp $(abs_srcdir)/vcs-version .; \
1431
	./configure; \
1432
	$(MAKE) $(AM_MAKEFLAGS)
1433

    
1434
dist-release: dist
1435
	set -e; \
1436
	for i in $(DIST_ARCHIVES); do \
1437
		echo -n "Checking $$i ... "; \
1438
		autotools/check-tar < $$i; \
1439
		echo OK; \
1440
	done
1441

    
1442
install-exec-local:
1443
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1444
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
1445
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1446

    
1447
.PHONY: apidoc
1448
if WANT_HTOOLSAPIDOC
1449
apidoc: py-apidoc hs-apidoc
1450
else
1451
apidoc: py-apidoc
1452
endif
1453

    
1454
.PHONY: py-apidoc
1455
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1456
	$(RUN_IN_TEMPDIR) epydoc -v \
1457
		--conf $(CURDIR)/epydoc.conf \
1458
		--output $(CURDIR)/$(APIDOC_PY_DIR)
1459

    
1460
.PHONY: hs-apidoc
1461
hs-apidoc: $(HS_BUILT_SRCS)
1462
	@test -n "$(HSCOLOUR)" || \
1463
	    { echo 'HsColour' not found during configure; exit 1; }
1464
	@test -n "$(HADDOCK)" || \
1465
	    { echo 'haddock' not found during configure; exit 1; }
1466
	rm -rf $(APIDOC_HS_DIR)/*
1467
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program
1468
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Confd
1469
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/Query
1470
	$(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1471
	$(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1472
	$(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1473
	set -e ; \
1474
	cd htools; \
1475
	if [ "$(HTOOLS_NOCURL)" ]; \
1476
	then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1477
	else OPTGHC=""; \
1478
	fi; \
1479
	if [ "$(HTOOLS_PARALLEL3)" ]; \
1480
	then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1481
	fi; \
1482
	RELSRCS="$(HS_LIB_SRCS:htools/%=%)  $(HS_BUILT_SRCS:htools/%=%)"; \
1483
	for file in $$RELSRCS; do \
1484
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1485
		$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1486
	done ; \
1487
	$(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1488
		-t ganeti-htools -p haddock-prologue \
1489
		--source-module="%{MODULE/.//}.html" \
1490
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
1491
		$$OPTGHC \
1492
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1493

    
1494
.PHONY: TAGS
1495
TAGS: $(GENERATED_FILES)
1496
	rm -f TAGS
1497
	$(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIB_SRCS)
1498
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1499
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
1500
	  -path './qa/*.py' | \
1501
	  etags -l python -a -
1502

    
1503
.PHONY: coverage
1504
if WANT_HTOOLS
1505
coverage: py-coverage hs-coverage
1506
else
1507
coverage: py-coverage
1508
endif
1509

    
1510
.PHONY: py-coverage
1511
py-coverage: $(GENERATED_FILES) $(python_tests)
1512
	set -e; \
1513
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1514
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1515
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1516
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1517
	$(python_tests)
1518

    
1519
.PHONY: hs-coverage
1520
hs-coverage: $(haskell_tests) htools/hpc-htools
1521
	rm -f *.tix
1522
	$(MAKE) $(AM_MAKEFLAGS) hs-check
1523
	@mkdir_p@ $(COVERAGE_HS_DIR)
1524
	hpc combine --union $(HPCEXCL) \
1525
	  test.tix hpc-htools.tix > coverage-htools.tix
1526
	hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1527
	hpc report coverage-htools.tix
1528
	$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1529

    
1530
# Special "kind-of-QA" target for htools, needs special setup (all
1531
# tools compiled with -fhpc)
1532
.PHONY: live-test
1533
live-test: all
1534
	set -e ; \
1535
	cd htools; \
1536
	rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1537
	rm -f *.tix *.mix; \
1538
	./live-test.sh; \
1539
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1540
	  --output=live-test.tix ; \
1541
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1542
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1543
		--srcdir=.. $(HPCEXCL) ; \
1544
	hpc report --srcdir=.. live-test $(HPCEXCL)
1545

    
1546
commit-check: distcheck lint apidoc
1547

    
1548
.PHONY: gitignore-check
1549
gitignore-check:
1550
	@if [ -n "`git status --short`" ]; then \
1551
	  echo "Git status is not clean!" 1>&2 ; \
1552
	  git status --short; \
1553
	  exit 1; \
1554
	fi
1555

    
1556
# we don't need the ancient implicit rules:
1557
%: %,v
1558
%: RCS/%,v
1559
%: RCS/%
1560
%: s.%
1561
%: SCCS/s.%
1562

    
1563
-include ./Makefile.local
1564

    
1565
# vim: set noet :