Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ e4cc4c11

History | View | Annotate | Download (44.2 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
	htest
64

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
192
nodist_pkgpython_PYTHON = \
193
	$(BUILT_PYTHON_SOURCES)
194

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
359
HS_PROGS = htools/htools
360
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
361

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

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

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

    
431

    
432
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
433
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
434

    
435
$(RUN_IN_TEMPDIR): | stamp-directories
436

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

    
457
doc/html: doc/html/index.html
458

    
459
doc/install-quick.rst: INSTALL
460
doc/news.rst: NEWS
461
doc/upgrade.rst: UPGRADE
462

    
463
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
464
	set -e; \
465
	{ echo '.. This file is automatically updated at build time from $<.'; \
466
	  echo '.. Do not edit.'; \
467
	  echo; \
468
	  cat $<; \
469
	} > $@
470

    
471
docdot = \
472
	doc/arch-2.0.dot \
473
	doc/design-2.1-lock-acquire.dot \
474
	doc/design-2.1-lock-release.dot
475

    
476
docpng = $(patsubst %.dot,%.png,$(docdot))
477

    
478
# Things to build but not to install (add it to EXTRA_DIST if it should be
479
# distributed)
480
noinst_DATA = \
481
	devel/upload \
482
	doc/html \
483
	$(BUILT_EXAMPLES) \
484
	doc/examples/bash_completion \
485
	$(manhtml)
486

    
487
gnt_scripts = \
488
	scripts/gnt-backup \
489
	scripts/gnt-cluster \
490
	scripts/gnt-debug \
491
	scripts/gnt-group \
492
	scripts/gnt-instance \
493
	scripts/gnt-job \
494
	scripts/gnt-node \
495
	scripts/gnt-os
496

    
497
PYTHON_BOOTSTRAP_SBIN = \
498
	daemons/ganeti-masterd \
499
	daemons/ganeti-noded \
500
	daemons/ganeti-watcher \
501
	daemons/ganeti-rapi \
502
	$(gnt_scripts)
503

    
504
if PY_CONFD
505
PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
506
endif
507

    
508
PYTHON_BOOTSTRAP = \
509
	$(PYTHON_BOOTSTRAP_SBIN) \
510
	tools/ensure-dirs
511

    
512
qa_scripts = \
513
	qa/__init__.py \
514
	qa/ganeti-qa.py \
515
	qa/qa_cluster.py \
516
	qa/qa_config.py \
517
	qa/qa_daemon.py \
518
	qa/qa_env.py \
519
	qa/qa_error.py \
520
	qa/qa_group.py \
521
	qa/qa_instance.py \
522
	qa/qa_job.py \
523
	qa/qa_node.py \
524
	qa/qa_os.py \
525
	qa/qa_rapi.py \
526
	qa/qa_tags.py \
527
	qa/qa_utils.py
528

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

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

    
563
# for the htest/test binary, we need to enable profiling/coverage
564
htest/test: HEXTRA_INT=-fhpc -ihtest
565

    
566
# we compile the hpc-htools binary with the program coverage
567
htest/hpc-htools: HEXTRA_INT=-fhpc
568

    
569
# test dependency
570
htest/offline-tests.sh: htest/hpc-htools
571

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

    
583
hs-prof-quick:
584
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"
585

    
586
dist_sbin_SCRIPTS = \
587
	tools/ganeti-listrunner
588

    
589
nodist_sbin_SCRIPTS = \
590
	$(PYTHON_BOOTSTRAP_SBIN) \
591
	daemons/ganeti-cleaner
592

    
593
if HS_CONFD
594
nodist_sbin_SCRIPTS += htools/hconfd
595
endif
596

    
597
python_scripts = \
598
	tools/burnin \
599
	tools/cfgshell \
600
	tools/cfgupgrade \
601
	tools/cfgupgrade12 \
602
	tools/cluster-merge \
603
	tools/confd-client \
604
	tools/fmtjson \
605
	tools/lvmstrap \
606
	tools/move-instance \
607
	tools/ovfconverter \
608
	tools/setup-ssh \
609
	tools/sanitize-config
610

    
611
dist_tools_SCRIPTS = \
612
	$(python_scripts) \
613
	tools/kvm-console-wrapper \
614
	tools/xm-console-wrapper \
615
	tools/master-ip-setup
616

    
617
pkglib_python_scripts = \
618
	daemons/import-export \
619
	tools/check-cert-expired
620

    
621
nodist_pkglib_python_scripts = \
622
	tools/ensure-dirs
623

    
624
myexeclib_SCRIPTS = \
625
	daemons/daemon-util \
626
	tools/kvm-ifup \
627
	$(pkglib_python_scripts)
628

    
629
nodist_myexeclib_SCRIPTS = \
630
	$(nodist_pkglib_python_scripts)
631

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

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

    
712
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
713
manhtml = $(patsubst %.rst,%.html,$(manrst))
714
mangen = $(patsubst %.rst,%.gen,$(manrst))
715
maninput = \
716
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
717
	$(patsubst %.html,%.html.in,$(manhtml)) \
718
	man/footer.man man/footer.html $(mangen)
719

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

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

    
875
haskell_tests = htest/test
876

    
877
dist_TESTS = \
878
	test/check-cert-expired_unittest.bash \
879
	test/daemon-util_unittest.bash \
880
	test/ganeti-cleaner_unittest.bash \
881
	test/import-export_unittest.bash \
882
	test/cli-test.bash \
883
	$(python_tests)
884

    
885
nodist_TESTS =
886
check_SCRIPTS =
887

    
888
if WANT_HTOOLSTESTS
889
nodist_TESTS += $(haskell_tests)
890
dist_TESTS += htest/offline-test.sh
891
check_SCRIPTS += htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
892
endif
893

    
894
TESTS = $(dist_TESTS) $(nodist_TESTS)
895

    
896
# Environment for all tests
897
PLAIN_TESTS_ENVIRONMENT = \
898
	PYTHONPATH=. \
899
	TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
900
	PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
901
	$(RUN_IN_TEMPDIR)
902

    
903
# Environment for tests run by automake
904
TESTS_ENVIRONMENT = \
905
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
906

    
907
all_python_code = \
908
	$(dist_sbin_SCRIPTS) \
909
	$(python_scripts) \
910
	$(pkglib_python_scripts) \
911
	$(nodist_pkglib_python_scripts) \
912
	$(python_tests) \
913
	$(pkgpython_PYTHON) \
914
	$(client_PYTHON) \
915
	$(hypervisor_PYTHON) \
916
	$(rapi_PYTHON) \
917
	$(server_PYTHON) \
918
	$(pytools_PYTHON) \
919
	$(http_PYTHON) \
920
	$(confd_PYTHON) \
921
	$(masterd_PYTHON) \
922
	$(impexpd_PYTHON) \
923
	$(utils_PYTHON) \
924
	$(watcher_PYTHON) \
925
	$(noinst_PYTHON) \
926
	$(qa_scripts)
927

    
928
srclink_files = \
929
	man/footer.rst \
930
	test/check-cert-expired_unittest.bash \
931
	test/daemon-util_unittest.bash \
932
	test/ganeti-cleaner_unittest.bash \
933
	test/import-export_unittest.bash \
934
	test/cli-test.bash \
935
	htest/offline-test.sh \
936
	htest/cli-tests-defs.sh \
937
	$(all_python_code) \
938
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
939

    
940
check_python_code = \
941
	$(BUILD_BASH_COMPLETION) \
942
	$(CHECK_IMPORTS) \
943
	$(CHECK_HEADER) \
944
	$(DOCPP) \
945
	$(all_python_code)
946

    
947
lint_python_code = \
948
	ganeti \
949
	ganeti/http/server.py \
950
	$(dist_sbin_SCRIPTS) \
951
	$(python_scripts) \
952
	$(pkglib_python_scripts) \
953
	$(BUILD_BASH_COMPLETION) \
954
	$(CHECK_IMPORTS) \
955
	$(CHECK_HEADER) \
956
	$(DOCPP) \
957
	$(PYTHON_BOOTSTRAP)
958

    
959
standalone_python_modules = \
960
	lib/rapi/client.py \
961
	tools/ganeti-listrunner
962

    
963
pep8_python_code = \
964
	ganeti \
965
	ganeti/http/server.py \
966
	$(dist_sbin_SCRIPTS) \
967
	$(python_scripts) \
968
	$(pkglib_python_scripts) \
969
	$(BUILD_BASH_COMPLETION) \
970
	$(CHECK_HEADER) \
971
	$(DOCPP) \
972
	$(PYTHON_BOOTSTRAP) \
973
	qa
974

    
975
test/daemon-util_unittest.bash: daemons/daemon-util
976

    
977
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
978

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

    
983
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
984
	sed -f $(REPLACE_VARS_SED) < $< > $@
985
	chmod u+x $@
986

    
987
daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
988
	sed -f $(REPLACE_VARS_SED) < $< > $@
989
	chmod +x $@
990

    
991
doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
992
	sed -f $(REPLACE_VARS_SED) < $< > $@
993

    
994
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
995
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
996
	$(GENERATED_FILES)
997
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
998

    
999
doc/%.png: doc/%.dot
1000
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
1001
	$(DOT) -Tpng -o $@ $<
1002

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

    
1008
man/footer.html: man/footer.rst
1009
	@test -n "$(PANDOC)" || \
1010
	  { echo 'pandoc' not found during configure; exit 1; }
1011
	$(PANDOC) -f rst -t html -o $@ $<
1012

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

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

    
1037

    
1038
man/%.html.in: man/%.gen man/footer.html
1039
	@test -n "$(PANDOC)" || \
1040
	  { echo 'pandoc' not found during configure; exit 1; }
1041
	set -o pipefail ; \
1042
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
1043
	  sed -e 's/\\@/@/g' > $@
1044

    
1045
man/%: man/%.in  $(REPLACE_VARS_SED)
1046
	sed -f $(REPLACE_VARS_SED) < $< > $@
1047

    
1048
epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1049
	sed -f $(REPLACE_VARS_SED) < $< > $@
1050

    
1051
vcs-version:
1052
	if test -d .git; then \
1053
	  git describe > $@; \
1054
	elif test ! -f $@ ; then \
1055
	  echo "Cannot auto-generate $@ file"; exit 1; \
1056
	fi
1057

    
1058
.PHONY: clean-vcs-version
1059
clean-vcs-version:
1060
	rm -f vcs-version
1061

    
1062
.PHONY: regen-vcs-version
1063
regen-vcs-version:
1064
	set -e; \
1065
	cd $(srcdir); \
1066
	if test -d .git; then \
1067
	  $(MAKE) $(AM_MAKEFLAGS) clean-vcs-version; \
1068
	  $(MAKE) $(AM_MAKEFLAGS) vcs-version; \
1069
	fi
1070

    
1071
htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in \
1072
	vcs-version $(built_base_sources)
1073
	set -e; \
1074
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1075
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
1076

    
1077
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
1078
	lib/constants.py lib/_autoconf.py lib/luxi.py \
1079
	$(CONVERT_CONSTANTS) $(built_base_sources) \
1080
	| lib/_vcsversion.py
1081
	set -e; \
1082
	{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
1083

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

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

    
1178
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1179
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1180

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

    
1211
# Using deferred evaluation
1212
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1213
daemons/ganeti-watcher: MODULE = ganeti.watcher
1214
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1215
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1216
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst htest/%,%,$@)
1217

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

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

    
1256
stamp-directories: Makefile
1257
	$(MAKE) $(AM_MAKEFLAGS) ganeti
1258
	@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1259
	touch $@
1260

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

    
1272
.PHONY: ganeti
1273
ganeti:
1274
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1275

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

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

    
1319
.PHONY: hs-check
1320
hs-check: htest/test htest/hpc-htools $(HS_BUILT_TEST_HELPERS)
1321
	@rm -f test.tix
1322
	./htest/test
1323
	HBINARY="./htest/hpc-htools" ./htest/offline-test.sh
1324

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

    
1340
# For excluding pep8 expects filenames only, not whole paths
1341
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1342

    
1343
LINT_TARGETS = pylint pylint-qa
1344
if HAS_PEP8
1345
LINT_TARGETS += pep8
1346
endif
1347
if HAS_HLINT
1348
LINT_TARGETS += hlint
1349
endif
1350

    
1351
.PHONY: lint
1352
lint: $(LINT_TARGETS)
1353

    
1354
.PHONY: pylint
1355
pylint: $(GENERATED_FILES)
1356
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1357
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1358

    
1359
.PHONY: pylint-qa
1360
pylint-qa: $(GENERATED_FILES)
1361
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1362
	cd $(top_srcdir)/qa && \
1363
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1364
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1365

    
1366
.PHONY: pep8
1367
pep8: $(GENERATED_FILES)
1368
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1369
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1370
		--repeat $(pep8_python_code)
1371

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

    
1387
# a dist hook rule for updating the vcs-version file; this is
1388
# hardcoded due to where it needs to build the file...
1389
dist-hook:
1390
	$(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1391
	rm -f $(top_distdir)/vcs-version
1392
	cp -p $(srcdir)/vcs-version $(top_distdir)
1393

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

    
1423
# When building a release, stricter checks should be used
1424
distcheck-release dist-release: export BUILD_RELEASE = 1
1425
distcheck-release: distcheck
1426

    
1427
distrebuildcheck: dist
1428
	set -e; \
1429
	builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1430
	trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1431
	cd $$builddir; \
1432
	tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1433
	cd $(distdir); \
1434
	./configure; \
1435
	$(MAKE) maintainer-clean; \
1436
	cp $(abs_srcdir)/vcs-version .; \
1437
	./configure; \
1438
	$(MAKE) $(AM_MAKEFLAGS)
1439

    
1440
dist-release: dist
1441
	set -e; \
1442
	for i in $(DIST_ARCHIVES); do \
1443
		echo -n "Checking $$i ... "; \
1444
		autotools/check-tar < $$i; \
1445
		echo OK; \
1446
	done
1447

    
1448
install-exec-local:
1449
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1450
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
1451
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1452

    
1453
.PHONY: apidoc
1454
if WANT_HTOOLSAPIDOC
1455
apidoc: py-apidoc hs-apidoc
1456
else
1457
apidoc: py-apidoc
1458
endif
1459

    
1460
.PHONY: py-apidoc
1461
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1462
	$(RUN_IN_TEMPDIR) epydoc -v \
1463
		--conf $(CURDIR)/epydoc.conf \
1464
		--output $(CURDIR)/$(APIDOC_PY_DIR)
1465

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

    
1500
.PHONY: TAGS
1501
TAGS: $(GENERATED_FILES)
1502
	rm -f TAGS
1503
	$(GHC) -e ":etags" -v0 $(HFLAGS) $(HS_LIB_SRCS)
1504
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1505
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
1506
	  -path './qa/*.py' | \
1507
	  etags -l python -a -
1508

    
1509
.PHONY: coverage
1510
if WANT_HTOOLS
1511
coverage: py-coverage hs-coverage
1512
else
1513
coverage: py-coverage
1514
endif
1515

    
1516
.PHONY: py-coverage
1517
py-coverage: $(GENERATED_FILES) $(python_tests)
1518
	set -e; \
1519
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1520
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1521
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1522
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1523
	$(python_tests)
1524

    
1525
.PHONY: hs-coverage
1526
hs-coverage: $(haskell_tests) htest/hpc-htools
1527
	rm -f *.tix
1528
	$(MAKE) $(AM_MAKEFLAGS) hs-check
1529
	@mkdir_p@ $(COVERAGE_HS_DIR)
1530
	hpc combine --union $(HPCEXCL) \
1531
	  test.tix hpc-htools.tix > coverage-htools.tix
1532
	hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
1533
	hpc report coverage-htools.tix
1534
	$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1535

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

    
1552
commit-check: distcheck lint apidoc
1553

    
1554
.PHONY: gitignore-check
1555
gitignore-check:
1556
	@if [ -n "`git status --short`" ]; then \
1557
	  echo "Git status is not clean!" 1>&2 ; \
1558
	  git status --short; \
1559
	  exit 1; \
1560
	fi
1561

    
1562
# we don't need the ancient implicit rules:
1563
%: %,v
1564
%: RCS/%,v
1565
%: RCS/%
1566
%: s.%
1567
%: SCCS/s.%
1568

    
1569
-include ./Makefile.local
1570

    
1571
# vim: set noet :