Makefile.am 35 KB
Newer Older
1 2 3 4 5
# Ganeti makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable (see hypervisor).
# - All directories must be listed DIRS.
Michael Hanselmann's avatar
Michael Hanselmann committed
6
# - Use autogen.sh to generate Makefile.in and configure script.
7 8 9 10 11

# Automake doesn't export these variables before version 1.10.
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@

12 13 14 15 16
# Helper values for calling builtin functions
empty :=
space := $(empty) $(empty)
comma := ,

17 18 19
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

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_MAN = $(top_srcdir)/autotools/check-man
25
CHECK_VERSION = $(top_srcdir)/autotools/check-version
26
CHECK_NEWS = $(top_srcdir)/autotools/check-news
27
DOCPP = $(top_srcdir)/autotools/docpp
28
REPLACE_VARS_SED = autotools/replace_vars.sed
29
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
30

31 32
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
33
clientdir = $(pkgpythondir)/client
34
hypervisordir = $(pkgpythondir)/hypervisor
35
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
36
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
37
confddir = $(pkgpythondir)/confd
38
rapidir = $(pkgpythondir)/rapi
39
serverdir = $(pkgpythondir)/server
40
watcherdir = $(pkgpythondir)/watcher
41
impexpddir = $(pkgpythondir)/impexpd
42
utilsdir = $(pkgpythondir)/utils
43
toolsdir = $(pkglibdir)/tools
44
iallocatorsdir = $(pkglibdir)/iallocators
45
pytoolsdir = $(pkgpythondir)/tools
46 47
docdir = $(datadir)/doc/$(PACKAGE)

48 49 50
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

51 52 53
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
54 55
	htools/Ganeti/HTools \
	htools/Ganeti/HTools/Program
56

57 58 59 60 61 62
DIRS = \
	autotools \
	daemons \
	devel \
	doc \
	doc/examples \
Guido Trotter's avatar
Guido Trotter committed
63
	doc/examples/hooks \
64
	doc/examples/gnt-debug \
65
	$(HTOOLS_DIRS) \
66
	lib \
67
	lib/client \
68
	lib/build \
69
	lib/confd \
70
	lib/http \
71
	lib/hypervisor \
72
	lib/impexpd \
Michael Hanselmann's avatar
Michael Hanselmann committed
73
	lib/masterd \
74
	lib/rapi \
75
	lib/server \
76
	lib/tools \
77
	lib/utils \
78
	lib/watcher \
79 80 81 82 83 84
	man \
	qa \
	test \
	test/data \
	tools

85
BUILDTIME_DIR_AUTOCREATE = \
86
	scripts \
87 88 89 90
	$(APIDOC_DIR) \
	$(APIDOC_PY_DIR) \
	$(APIDOC_HS_DIR) \
	$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
91
	$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
92 93 94
	$(COVERAGE_DIR) \
	$(COVERAGE_PY_DIR) \
	$(COVERAGE_HS_DIR) \
95
	.hpc
96 97 98

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
99 100 101 102 103 104 105
	doc/html

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
	doc/html/_*

106
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
107

108 109 110 111 112 113 114 115
# some helper vars
COVERAGE_DIR = doc/coverage
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
APIDOC_DIR = doc/api
APIDOC_PY_DIR = $(APIDOC_DIR)/py
APIDOC_HS_DIR = $(APIDOC_DIR)/hs

Iustin Pop's avatar
Iustin Pop committed
116
MAINTAINERCLEANFILES = \
117
	$(docpng) \
118
	$(maninput) \
119
	doc/install-quick.rst \
120
	doc/news.rst \
121
	doc/upgrade.rst \
122
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
123

124
maintainer-clean-local:
125
	rm -rf $(BUILDTIME_DIRS)
126

127
CLEANFILES = \
128
	$(addsuffix /*.py[co],$(DIRS)) \
129 130
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
131
	$(all_dirfiles) \
132
	$(PYTHON_BOOTSTRAP) \
133
	epydoc.conf \
134
	autotools/replace_vars.sed \
135
	daemons/daemon-util \
136
	daemons/ganeti-cleaner \
137
	devel/upload \
138
	doc/examples/bash_completion \
139
	doc/examples/ganeti.initd \
140
	doc/examples/ganeti-kvm-poweroff.initd \
141
	doc/examples/ganeti.cron \
142
	doc/examples/gnt-config-backup \
Luca Bigliardi's avatar
Luca Bigliardi committed
143
	doc/examples/hooks/ipsec \
Iustin Pop's avatar
Iustin Pop committed
144 145
	$(man_MANS) \
	$(manhtml) \
146
	tools/kvm-ifup \
147
	stamp-srclinks \
148
	$(nodist_pkgpython_PYTHON) \
149
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
150 151
	.hpc/*.mix htools/*.tix \
	doc/hs-lint.html
152

153 154
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
# it'll cause the target to rebuild every time.
155 156
BUILT_SOURCES = \
	ganeti \
157
	stamp-srclinks \
158
	$(all_dirfiles) \
159 160
	$(PYTHON_BOOTSTRAP) \
	$(BUILT_PYTHON_SOURCES)
161

162
BUILT_PYTHON_SOURCES = \
163 164
	lib/_autoconf.py \
	lib/_vcsversion.py
165

166 167 168
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

169
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
170 171
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
172

173 174
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
175
	lib/asyncnotifier.py \
176 177 178 179 180
	lib/backend.py \
	lib/bdev.py \
	lib/bootstrap.py \
	lib/cli.py \
	lib/cmdlib.py \
181
	lib/compat.py \
182 183
	lib/config.py \
	lib/constants.py \
184
	lib/daemon.py \
185
	lib/errors.py \
186
	lib/ht.py \
187
	lib/jqueue.py \
188
	lib/jstore.py \
189 190 191
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
192
	lib/netutils.py \
193 194
	lib/objects.py \
	lib/opcodes.py \
195
	lib/qlang.py \
196
	lib/query.py \
197
	lib/rpc.py \
198
	lib/runtime.py \
199 200 201
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
202
	lib/storage.py \
203
	lib/uidpool.py \
204
	lib/workerpool.py
205

206
client_PYTHON = \
207
	lib/client/__init__.py \
208
	lib/client/gnt_backup.py \
209
	lib/client/gnt_cluster.py \
210
	lib/client/gnt_debug.py \
211
	lib/client/gnt_group.py \
212
	lib/client/gnt_instance.py \
213
	lib/client/gnt_job.py \
214
	lib/client/gnt_node.py \
215
	lib/client/gnt_os.py
216

217 218 219
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
220
	lib/hypervisor/hv_chroot.py \
221
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
222
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
223
	lib/hypervisor/hv_lxc.py \
224 225
	lib/hypervisor/hv_xen.py

226 227
rapi_PYTHON = \
	lib/rapi/__init__.py \
228
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
229
	lib/rapi/client.py \
230
	lib/rapi/client_utils.py \
231 232
	lib/rapi/connector.py \
	lib/rapi/rlib2.py
233

234
http_PYTHON = \
235
	lib/http/__init__.py \
236
	lib/http/auth.py \
237 238
	lib/http/client.py \
	lib/http/server.py
239

Guido Trotter's avatar
Guido Trotter committed
240
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
241
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
242
	lib/confd/client.py \
243 244
	lib/confd/querylib.py \
	lib/confd/server.py
245

Michael Hanselmann's avatar
Michael Hanselmann committed
246
masterd_PYTHON = \
247 248
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
249

250 251 252
impexpd_PYTHON = \
	lib/impexpd/__init__.py

253
watcher_PYTHON = \
254
	lib/watcher/__init__.py \
255 256
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
257

258
server_PYTHON = \
259
	lib/server/__init__.py \
260
	lib/server/confd.py \
261
	lib/server/masterd.py \
262 263
	lib/server/noded.py \
	lib/server/rapi.py
264

265 266 267 268
pytools_PYTHON = \
	lib/tools/__init__.py \
	lib/tools/ensure_dirs.py

269
utils_PYTHON = \
270
	lib/utils/__init__.py \
271
	lib/utils/algo.py \
272
	lib/utils/filelock.py \
273
	lib/utils/hash.py \
274
	lib/utils/io.py \
275
	lib/utils/log.py \
276
	lib/utils/mlock.py \
277
	lib/utils/nodesetup.py \
278
	lib/utils/process.py \
279
	lib/utils/retry.py \
280
	lib/utils/text.py \
281 282
	lib/utils/wrapper.py \
	lib/utils/x509.py
283

Michael Hanselmann's avatar
Michael Hanselmann committed
284
docrst = \
285
	doc/admin.rst \
286
	doc/design-2.0.rst \
287
	doc/design-2.1.rst \
288
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
289
	doc/design-2.3.rst \
290
	doc/design-htools-2.3.rst \
291
	doc/design-2.4.rst \
292
	doc/design-2.5.rst \
293
	doc/design-draft.rst \
294
	doc/design-oob.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
295
	doc/design-cpu-pinning.rst \
296
	doc/design-query2.rst \
297
	doc/design-x509-ca.rst \
298
	doc/design-http-server.rst \
299
	doc/design-impexp2.rst \
300
	doc/design-lu-generated-jobs.rst \
301
	doc/design-multi-reloc.rst \
302
	doc/design-network.rst \
Michael Hanselmann's avatar
Michael Hanselmann committed
303
	doc/design-chained-jobs.rst \
304
	doc/design-ovf-support.rst \
305
	doc/cluster-merge.rst \
306
	doc/design-shared-storage.rst \
307
	doc/devnotes.rst \
308
	doc/glossary.rst \
309
	doc/hooks.rst \
310
	doc/iallocator.rst \
311
	doc/index.rst \
312
	doc/install-quick.rst \
313
	doc/install.rst \
314
	doc/locking.rst \
315
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
316
	doc/news.rst \
317
	doc/rapi.rst \
318
	doc/security.rst \
319
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
320
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
321

322 323
HS_PROGS = htools/htools
HS_BIN_ROLES = hbal hscan hspace
324

325 326
HS_ALL_PROGS = $(HS_PROGS) htools/test
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
327
# we don't add -Werror by default
328
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
329
# extra flags that can be overriden on the command line
330
HEXTRA =
331
# exclude options for coverage reports
332 333 334
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC \
	--exclude Ganeti.Constants \
	--exclude Ganeti.HTools.Version
335

336
HS_LIB_SRCS = \
337 338
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
339
	htools/Ganeti/HTools/Compat.hs \
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
	htools/Ganeti/HTools/Container.hs \
	htools/Ganeti/HTools/ExtLoader.hs \
	htools/Ganeti/HTools/Group.hs \
	htools/Ganeti/HTools/IAlloc.hs \
	htools/Ganeti/HTools/Instance.hs \
	htools/Ganeti/HTools/Loader.hs \
	htools/Ganeti/HTools/Luxi.hs \
	htools/Ganeti/HTools/Node.hs \
	htools/Ganeti/HTools/PeerMap.hs \
	htools/Ganeti/HTools/QC.hs \
	htools/Ganeti/HTools/Rapi.hs \
	htools/Ganeti/HTools/Simu.hs \
	htools/Ganeti/HTools/Text.hs \
	htools/Ganeti/HTools/Types.hs \
	htools/Ganeti/HTools/Utils.hs \
355
	htools/Ganeti/HTools/Program/Hail.hs \
356
	htools/Ganeti/HTools/Program/Hbal.hs \
357
	htools/Ganeti/HTools/Program/Hscan.hs \
358
	htools/Ganeti/HTools/Program/Hspace.hs \
359 360 361 362
	htools/Ganeti/Jobs.hs \
	htools/Ganeti/Luxi.hs \
	htools/Ganeti/OpCodes.hs

363
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
364
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
365

366 367
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
368 369 370 371 372
# Note: we use here an order-only prerequisite, as the contents of
# _autoconf.py are not actually influencing the html build output: it
# has to exist in order for the sphinx module to be loaded
# successfully, but we certainly don't want the docs to be rebuilt if
# it changes
373
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
Iustin Pop's avatar
Iustin Pop committed
374
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
375
	| $(BUILT_PYTHON_SOURCES)
376 377
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
378
	@mkdir_p@ $(dir $@)
379
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
380
	    -d . \
381 382
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
383 384 385 386
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

387
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
388

389
doc/install-quick.rst: INSTALL
390
doc/news.rst: NEWS
391
doc/upgrade.rst: UPGRADE
392

393
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
394 395 396 397 398 399 400
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

401
docdot = \
402 403 404
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
405

406
docpng = $(patsubst %.dot,%.png,$(docdot))
407

408 409 410 411 412 413 414 415
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
	devel/upload \
	doc/html \
	doc/examples/bash_completion \
	doc/examples/ganeti.cron \
	doc/examples/ganeti.initd \
416
	doc/examples/ganeti-kvm-poweroff.initd \
417
	doc/examples/gnt-config-backup \
418 419
	doc/examples/hooks/ipsec \
	$(manhtml)
420

421
gnt_scripts = \
422 423 424
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
425
	scripts/gnt-group \
426 427 428 429 430
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

431
PYTHON_BOOTSTRAP_SBIN = \
432
	daemons/ganeti-confd \
433
	daemons/ganeti-masterd \
434
	daemons/ganeti-noded \
435
	daemons/ganeti-watcher \
436
	daemons/ganeti-rapi \
437
	scripts/gnt-backup \
438
	scripts/gnt-cluster \
439
	scripts/gnt-debug \
440
	scripts/gnt-group \
441
	scripts/gnt-instance \
442
	scripts/gnt-job \
443
	scripts/gnt-node \
444
	scripts/gnt-os
445

446 447 448 449
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

450 451 452 453 454 455 456
qa_scripts = \
	qa/ganeti-qa.py \
	qa/qa_cluster.py \
	qa/qa_config.py \
	qa/qa_daemon.py \
	qa/qa_env.py \
	qa/qa_error.py \
Andrea Spadaccini's avatar
Andrea Spadaccini committed
457
	qa/qa_group.py \
458 459 460 461 462 463 464
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

465 466
bin_SCRIPTS =
if WANT_HTOOLS
467
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
468 469
install-exec-hook:
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
470 471
# FIXME: this is a hardcoded logic, instead of auto-resolving
	$(LN_S) -f ../../../bin/htools \
472
		   $(DESTDIR)$(iallocatorsdir)/hail
473
	for role in $(HS_BIN_ROLES); do \
474
		$(LN_S) -f htools \
475 476
			   $(DESTDIR)$(bindir)/$$role ; \
	done
477 478
endif

479
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
480 481 482 483
	@if [ -z "$(HTOOLS)" ]; then \
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
	  exit 1; \
	fi
484 485
	@BINARY=$(@:htools/%=%); \
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
486 487
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
	  exit 1; \
488 489
	fi
	BINARY=$(@:htools/%=%); $(GHC) --make \
490 491
	  $(HFLAGS) $(HEXTRA) \
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
492
	  -osuf $$BINARY.o -hisuf $$BINARY.hi $@
493

494 495 496 497 498
# for the htools/test binary, we need to enable profiling/coverage
htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
	-fno-warn-monomorphism-restriction -fno-warn-orphans \
	-fno-warn-missing-methods -fno-warn-unused-imports

499 500
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
501

502
nodist_sbin_SCRIPTS = \
503
	$(PYTHON_BOOTSTRAP_SBIN) \
504 505
	daemons/ganeti-cleaner

506
python_scripts = \
507 508 509
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
510
	tools/cfgupgrade12 \
511
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
512
	tools/lvmstrap \
513
	tools/move-instance \
514
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
515
	tools/sanitize-config
516

517
dist_tools_SCRIPTS = \
518
	$(python_scripts) \
519
	tools/kvm-console-wrapper \
520 521
	tools/xm-console-wrapper

522
pkglib_python_scripts = \
523 524
	daemons/import-export \
	tools/check-cert-expired
525

526 527 528
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

529
pkglib_SCRIPTS = \
530
	daemons/daemon-util \
531
	tools/kvm-ifup \
532
	$(pkglib_python_scripts)
533

534 535 536
nodist_pkglib_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

537 538
EXTRA_DIST = \
	NEWS \
539
	UPGRADE \
540
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
541
	pylintrc \
542
	autotools/build-bash-completion \
543
	autotools/check-python-code \
544
	autotools/check-man \
545
	autotools/check-news \
546
	autotools/check-tar \
547
	autotools/check-version \
548
	autotools/convert-constants \
549
	autotools/docpp \
550
	autotools/gen-coverage \
551
	autotools/testrunner \
552
	$(RUN_IN_TEMPDIR) \
553
	daemons/daemon-util.in \
554
	daemons/ganeti-cleaner.in \
555
	$(pkglib_python_scripts) \
556
	devel/upload.in \
557
	tools/kvm-ifup.in \
558
	$(docdot) \
559
	$(docpng) \
560 561 562
	$(docrst) \
	doc/conf.py \
	doc/html \
563
	doc/examples/ganeti.initd.in \
564
	doc/examples/ganeti-kvm-poweroff.initd.in \
565
	doc/examples/ganeti.cron.in \
566
	doc/examples/gnt-config-backup.in \
567 568
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
569
	doc/examples/hooks/ethers \
Luca Bigliardi's avatar
Luca Bigliardi committed
570
	doc/examples/hooks/ipsec.in \
571 572 573
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
574 575 576 577
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
578 579
	man/footer.rst \
	$(manrst) \
580
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
581
	qa/qa-sample.json \
582
	$(qa_scripts) \
583 584
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
	$(HS_PROG_SRCS)
585 586 587

man_MANS = \
	man/ganeti.7 \
588
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
589
	man/ganeti-confd.8 \
590
	man/ganeti-listrunner.8 \
591
	man/ganeti-masterd.8 \
592 593
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
594
	man/ganeti-rapi.8 \
595 596 597
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
598
	man/gnt-debug.8 \
599
	man/gnt-group.8 \
600
	man/gnt-instance.8 \
601
	man/gnt-job.8 \
602
	man/gnt-node.8 \
603 604 605 606
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
Iustin Pop's avatar
Iustin Pop committed
607 608
	man/hspace.1 \
	man/htools.1
609

610
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
611
manhtml = $(patsubst %.rst,%.html,$(manrst))
612
mangen = $(patsubst %.rst,%.gen,$(manrst))
613
maninput = \
614
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
615
	$(patsubst %.html,%.html.in,$(manhtml)) \
616
	man/footer.man man/footer.html $(mangen)
617 618

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
619 620 621 622 623
	test/data/bdev-drbd-8.0.txt \
	test/data/bdev-drbd-8.3.txt \
	test/data/bdev-drbd-disk.txt \
	test/data/bdev-drbd-net-ip4.txt \
	test/data/bdev-drbd-net-ip6.txt \
624
	test/data/cert1.pem \
625 626 627 628 629 630 631
	test/data/ip-addr-show-dummy0.txt \
	test/data/ip-addr-show-lo-ipv4.txt \
	test/data/ip-addr-show-lo-ipv6.txt \
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
	test/data/ip-addr-show-lo-oneline.txt \
	test/data/ip-addr-show-lo.txt \
632
	test/data/proc_drbd8.txt \
633
	test/data/proc_drbd80-emptyline.txt \
634
	test/data/proc_drbd83.txt \
635 636
	test/data/proc_drbd83_sync.txt \
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
637 638 639 640
	test/data/kvm_1.0_help.txt \
	test/data/kvm_0.15.90_help.txt \
	test/data/kvm_0.12.5_help.txt \
	test/data/kvm_0.9.1_help.txt \
641
	test/data/sys_drbd_usermode_helper.txt \
642
	test/import-export_unittest-helper
643

644
python_tests = \
Guido Trotter's avatar
Guido Trotter committed
645
	test/ganeti.asyncnotifier_unittest.py \
646
	test/ganeti.backend_unittest.py \
647 648
	test/ganeti.bdev_unittest.py \
	test/ganeti.cli_unittest.py \
René Nussbaumer's avatar
René Nussbaumer committed
649
	test/ganeti.client.gnt_cluster_unittest.py \
650
	test/ganeti.client.gnt_instance_unittest.py \
Guido Trotter's avatar
Guido Trotter committed
651
	test/ganeti.daemon_unittest.py \
652
	test/ganeti.cmdlib_unittest.py \
653
	test/ganeti.compat_unittest.py \
654
	test/ganeti.confd.client_unittest.py \
655
	test/ganeti.config_unittest.py \
656
	test/ganeti.constants_unittest.py \
657
	test/ganeti.errors_unittest.py \
658
	test/ganeti.hooks_unittest.py \
659
	test/ganeti.ht_unittest.py \
660
	test/ganeti.http_unittest.py \
661
	test/ganeti.hypervisor_unittest.py \
662 663
	test/ganeti.hypervisor.hv_chroot_unittest.py \
	test/ganeti.hypervisor.hv_fake_unittest.py \
664
	test/ganeti.hypervisor.hv_kvm_unittest.py \
665 666
	test/ganeti.hypervisor.hv_lxc_unittest.py \
	test/ganeti.hypervisor.hv_xen_unittest.py \
667
	test/ganeti.impexpd_unittest.py \
668
	test/ganeti.jqueue_unittest.py \
669
	test/ganeti.locking_unittest.py \
670
	test/ganeti.luxi_unittest.py \
671
	test/ganeti.masterd.instance_unittest.py \
672
	test/ganeti.mcpu_unittest.py \
673
	test/ganeti.netutils_unittest.py \
674
	test/ganeti.objects_unittest.py \
675
	test/ganeti.opcodes_unittest.py \
676
	test/ganeti.qlang_unittest.py \
677
	test/ganeti.query_unittest.py \
678
	test/ganeti.rapi.baserlib_unittest.py \
David Knowles's avatar
David Knowles committed
679
	test/ganeti.rapi.client_unittest.py \
680
	test/ganeti.rapi.resources_unittest.py \
681
	test/ganeti.rapi.rlib2_unittest.py \
682
	test/ganeti.rpc_unittest.py \
683
	test/ganeti.runtime_unittest.py \
684 685
	test/ganeti.serializer_unittest.py \
	test/ganeti.ssh_unittest.py \
686
	test/ganeti.tools.ensure_dirs_unittest.py \
Balazs Lecz's avatar
Balazs Lecz committed
687
	test/ganeti.uidpool_unittest.py \
688
	test/ganeti.utils.algo_unittest.py \
689
	test/ganeti.utils.filelock_unittest.py \
690
	test/ganeti.utils.hash_unittest.py \
691
	test/ganeti.utils.io_unittest.py \
692
	test/ganeti.utils.log_unittest.py \
693
	test/ganeti.utils.mlock_unittest.py \
694
	test/ganeti.utils.nodesetup_unittest.py \
695
	test/ganeti.utils.process_unittest.py \
696
	test/ganeti.utils.retry_unittest.py \
697
	test/ganeti.utils.text_unittest.py \
698
	test/ganeti.utils.wrapper_unittest.py \
699
	test/ganeti.utils.x509_unittest.py \
700
	test/ganeti.utils_unittest.py \
701
	test/ganeti.workerpool_unittest.py \
702
	test/cfgupgrade_unittest.py \
703 704
	test/docs_unittest.py \
	test/tempfile_fork_unittest.py
705

706 707
haskell_tests = htools/test

708
dist_TESTS = \
709
	test/check-cert-expired_unittest.bash \
710
	test/daemon-util_unittest.bash \
711
	test/ganeti-cleaner_unittest.bash \
712
	test/import-export_unittest.bash \
713 714
	$(python_tests)

715
nodist_TESTS =
716
if WANT_HTOOLSTESTS
717 718
nodist_TESTS += $(haskell_tests)
endif
719 720 721

TESTS = $(dist_TESTS) $(nodist_TESTS)

722 723 724 725 726
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
727
TESTS_ENVIRONMENT = \
728
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
729

730
all_python_code = \
731
	$(dist_sbin_SCRIPTS) \
732
	$(python_scripts) \
733
	$(pkglib_python_scripts) \
734
	$(nodist_pkglib_python_scripts) \
735
	$(python_tests) \
736
	$(pkgpython_PYTHON) \
737
	$(client_PYTHON) \
738 739