Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 62377cf5

History | View | Annotate | Download (43.9 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
190
nodist_pkgpython_PYTHON = \
191
	$(BUILT_PYTHON_SOURCES)
192

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
426
$(RUN_IN_TEMPDIR): | stamp-directories
427

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

    
448
doc/html: doc/html/index.html
449

    
450
doc/install-quick.rst: INSTALL
451
doc/news.rst: NEWS
452
doc/upgrade.rst: UPGRADE
453

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

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

    
467
docpng = $(patsubst %.dot,%.png,$(docdot))
468

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

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

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

    
495
if PY_CONFD
496
PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
497
endif
498

    
499
PYTHON_BOOTSTRAP = \
500
	$(PYTHON_BOOTSTRAP_SBIN) \
501
	tools/ensure-dirs
502

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

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

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

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

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

    
561
# test dependency
562
htools/offline-tests.sh: htools/hpc-htools
563

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

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

    
578
dist_sbin_SCRIPTS = \
579
	tools/ganeti-listrunner
580

    
581
nodist_sbin_SCRIPTS = \
582
	$(PYTHON_BOOTSTRAP_SBIN) \
583
	daemons/ganeti-cleaner
584

    
585
if HS_CONFD
586
nodist_sbin_SCRIPTS += htools/hconfd
587
endif
588

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

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

    
609
pkglib_python_scripts = \
610
	daemons/import-export \
611
	tools/check-cert-expired
612

    
613
nodist_pkglib_python_scripts = \
614
	tools/ensure-dirs
615

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

    
621
nodist_myexeclib_SCRIPTS = \
622
	$(nodist_pkglib_python_scripts)
623

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

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

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

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

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

    
867
haskell_tests = htools/test
868

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

    
877
nodist_TESTS =
878
check_SCRIPTS =
879

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

    
886
TESTS = $(dist_TESTS) $(nodist_TESTS)
887

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

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

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

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

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

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

    
951
standalone_python_modules = \
952
	lib/rapi/client.py \
953
	tools/ganeti-listrunner
954

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

    
967
test/daemon-util_unittest.bash: daemons/daemon-util
968

    
969
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
970

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

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

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

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

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

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

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

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

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

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

    
1029

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

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

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

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

    
1050
.PHONY: clean-vcs-version
1051
clean-vcs-version:
1052
	rm -f vcs-version
1053

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1343
.PHONY: lint
1344
lint: $(LINT_TARGETS)
1345

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1500
.PHONY: coverage
1501
if WANT_HTOOLS
1502
coverage: py-coverage hs-coverage
1503
else
1504
coverage: py-coverage
1505
endif
1506

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

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

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

    
1543
commit-check: distcheck lint apidoc
1544

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

    
1553
# we don't need the ancient implicit rules:
1554
%: %,v
1555
%: RCS/%,v
1556
%: RCS/%
1557
%: s.%
1558
%: SCCS/s.%
1559

    
1560
-include ./Makefile.local
1561

    
1562
# vim: set noet :