Makefile.am 30.7 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
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

15
ACLOCAL_AMFLAGS = -I autotools
16
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
17
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
18
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
19
CHECK_MAN = $(top_srcdir)/autotools/check-man
20
CHECK_VERSION = $(top_srcdir)/autotools/check-version
21
CHECK_NEWS = $(top_srcdir)/autotools/check-news
22
DOCPP = $(top_srcdir)/autotools/docpp
23 24
REPLACE_VARS_SED = autotools/replace_vars.sed

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

42 43 44
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

45 46 47 48 49
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
	htools/Ganeti/HTools

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

78
BUILDTIME_DIR_AUTOCREATE = \
79
	scripts \
80 81 82 83 84 85 86
	$(APIDOC_DIR) \
	$(APIDOC_PY_DIR) \
	$(APIDOC_HS_DIR) \
	$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
	$(COVERAGE_DIR) \
	$(COVERAGE_PY_DIR) \
	$(COVERAGE_HS_DIR) \
87
	.hpc
88 89 90

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
91 92 93 94 95 96 97
	doc/html

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

98
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
99

100 101 102 103 104 105 106 107
# 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
108
MAINTAINERCLEANFILES = \
109
	$(docpng) \
110
	$(maninput) \
111
	doc/install-quick.rst \
112
	doc/news.rst \
113
	doc/upgrade.rst \
114
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
115

116
maintainer-clean-local:
117
	rm -rf $(BUILDTIME_DIRS)
118

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

145 146
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
# it'll cause the target to rebuild every time.
147 148
BUILT_SOURCES = \
	ganeti \
149
	stamp-srclinks \
150
	lib/_autoconf.py \
151
	$(all_dirfiles) \
152 153
	$(PYTHON_BOOTSTRAP)

154 155 156
nodist_pkgpython_PYTHON = \
	lib/_autoconf.py

157
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
158 159
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
160

161 162
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
163
	lib/asyncnotifier.py \
164 165 166 167 168
	lib/backend.py \
	lib/bdev.py \
	lib/bootstrap.py \
	lib/cli.py \
	lib/cmdlib.py \
169
	lib/compat.py \
170 171
	lib/config.py \
	lib/constants.py \
172
	lib/daemon.py \
173
	lib/errors.py \
174
	lib/ht.py \
175
	lib/jqueue.py \
176
	lib/jstore.py \
177 178 179
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
180
	lib/netutils.py \
181 182
	lib/objects.py \
	lib/opcodes.py \
183
	lib/qlang.py \
184
	lib/query.py \
185
	lib/rpc.py \
186
	lib/runtime.py \
187 188 189
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
190
	lib/storage.py \
191
	lib/uidpool.py \
192
	lib/workerpool.py
193

194
client_PYTHON = \
195
	lib/client/__init__.py \
196
	lib/client/gnt_backup.py \
197
	lib/client/gnt_cluster.py \
198
	lib/client/gnt_debug.py \
199
	lib/client/gnt_group.py \
200
	lib/client/gnt_instance.py \
201
	lib/client/gnt_job.py \
202
	lib/client/gnt_node.py \
203
	lib/client/gnt_os.py
204

205 206 207
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
208
	lib/hypervisor/hv_chroot.py \
209
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
210
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
211
	lib/hypervisor/hv_lxc.py \
212 213
	lib/hypervisor/hv_xen.py

214 215
rapi_PYTHON = \
	lib/rapi/__init__.py \
216
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
217
	lib/rapi/client.py \
218
	lib/rapi/client_utils.py \
219 220
	lib/rapi/connector.py \
	lib/rapi/rlib2.py
221

222
http_PYTHON = \
223
	lib/http/__init__.py \
224
	lib/http/auth.py \
225 226
	lib/http/client.py \
	lib/http/server.py
227

Guido Trotter's avatar
Guido Trotter committed
228
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
229
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
230
	lib/confd/client.py \
231 232
	lib/confd/querylib.py \
	lib/confd/server.py
233

Michael Hanselmann's avatar
Michael Hanselmann committed
234
masterd_PYTHON = \
235 236
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
237

238 239 240
impexpd_PYTHON = \
	lib/impexpd/__init__.py

241 242 243
watcher_PYTHON = \
	lib/watcher/__init__.py

244
server_PYTHON = \
245
	lib/server/__init__.py \
246
	lib/server/confd.py \
247
	lib/server/masterd.py \
248 249
	lib/server/noded.py \
	lib/server/rapi.py
250

251 252 253 254
pytools_PYTHON = \
	lib/tools/__init__.py \
	lib/tools/ensure_dirs.py

255
utils_PYTHON = \
256
	lib/utils/__init__.py \
257
	lib/utils/algo.py \
258
	lib/utils/filelock.py \
259
	lib/utils/hash.py \
260
	lib/utils/io.py \
261
	lib/utils/log.py \
262
	lib/utils/mlock.py \
263
	lib/utils/nodesetup.py \
264
	lib/utils/process.py \
265
	lib/utils/retry.py \
266
	lib/utils/text.py \
267 268
	lib/utils/wrapper.py \
	lib/utils/x509.py
269

Michael Hanselmann's avatar
Michael Hanselmann committed
270
docrst = \
271
	doc/admin.rst \
272
	doc/design-2.0.rst \
273
	doc/design-2.1.rst \
274
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
275
	doc/design-2.3.rst \
276
	doc/design-htools-2.3.rst \
277
	doc/design-2.4.rst \
278
	doc/design-draft.rst \
279
	doc/design-oob.rst \
280
	doc/design-query2.rst \
281
	doc/design-x509-ca.rst \
282
	doc/design-http-server.rst \
283
	doc/design-impexp2.rst \
284
	doc/design-lu-generated-jobs.rst \
285
	doc/cluster-merge.rst \
286
	doc/design-shared-storage.rst \
287
	doc/devnotes.rst \
288
	doc/glossary.rst \
289
	doc/hooks.rst \
290
	doc/iallocator.rst \
291
	doc/index.rst \
292
	doc/install-quick.rst \
293
	doc/install.rst \
294
	doc/locking.rst \
295
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
296
	doc/news.rst \
297
	doc/rapi.rst \
298
	doc/security.rst \
299
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
300
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
301

302
HS_PROGS = \
303 304 305 306 307
	htools/hbal \
	htools/hscan \
	htools/hail \
	htools/hspace

308 309
HS_ALL_PROGS = $(HS_PROGS) htools/test
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
310
# we don't add -Werror by default
311
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
312
# extra flags that can be overriden on the command line
313
HEXTRA =
314 315
# exclude options for coverage reports
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
316

317
HS_LIB_SRCS = \
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
	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 \
	htools/Ganeti/Jobs.hs \
	htools/Ganeti/Luxi.hs \
	htools/Ganeti/OpCodes.hs

339 340
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
341

342 343
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
344 345 346 347 348
# 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
349
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
Iustin Pop's avatar
Iustin Pop committed
350 351
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
	| lib/_autoconf.py
352 353
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
354
	@mkdir_p@ $(dir $@)
355
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
356
	    -d . \
357 358
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
359 360 361 362
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

363
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
364

365
doc/install-quick.rst: INSTALL
366
doc/news.rst: NEWS
367
doc/upgrade.rst: UPGRADE
368

369
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
370 371 372 373 374 375 376
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

377
docdot = \
378 379 380
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
381

382
docpng = $(patsubst %.dot,%.png,$(docdot))
383

384 385 386 387 388 389 390 391
# 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 \
392
	doc/examples/ganeti-kvm-poweroff.initd \
393
	doc/examples/gnt-config-backup \
394 395
	doc/examples/hooks/ipsec \
	$(manhtml)
396

397
gnt_scripts = \
398 399 400
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
401
	scripts/gnt-group \
402 403 404 405 406
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

407
PYTHON_BOOTSTRAP_SBIN = \
408
	daemons/ganeti-confd \
409
	daemons/ganeti-masterd \
410
	daemons/ganeti-noded \
411
	daemons/ganeti-watcher \
412
	daemons/ganeti-rapi \
413
	scripts/gnt-backup \
414
	scripts/gnt-cluster \
415
	scripts/gnt-debug \
416
	scripts/gnt-group \
417
	scripts/gnt-instance \
418
	scripts/gnt-job \
419
	scripts/gnt-node \
420
	scripts/gnt-os
421

422 423 424 425
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

426 427 428 429 430 431 432 433 434 435 436 437 438 439
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 \
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

440
bin_SCRIPTS =
441
iallocators_SCRIPTS =
442
if WANT_HTOOLS
443 444
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
445 446
endif

447
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
448 449 450 451 452
	BINARY=$(@:htools/%=%); \
	$(GHC) --make \
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
	  $@
453

454 455 456 457 458
# 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

459 460
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
461

462
nodist_sbin_SCRIPTS = \
463
	$(PYTHON_BOOTSTRAP_SBIN) \
464 465
	daemons/ganeti-cleaner

466 467 468 469
dist_tools_SCRIPTS = \
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
470
	tools/cfgupgrade12 \
471
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
472
	tools/lvmstrap \
473
	tools/move-instance \
474
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
475
	tools/sanitize-config
476

477
pkglib_python_scripts = \
478 479
	daemons/import-export \
	tools/check-cert-expired
480

481 482 483
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

484
pkglib_SCRIPTS = \
485
	daemons/daemon-util \
486
	tools/kvm-ifup \
487
	$(pkglib_python_scripts)
488

489 490 491
nodist_pkglib_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

492 493
EXTRA_DIST = \
	NEWS \
494
	UPGRADE \
495
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
496
	pylintrc \
497
	autotools/build-bash-completion \
498
	autotools/check-python-code \
499
	autotools/check-man \
500
	autotools/check-news \
501
	autotools/check-tar \
502
	autotools/check-version \
503
	autotools/docpp \
504
	autotools/gen-coverage \
505
	autotools/testrunner \
506
	$(RUN_IN_TEMPDIR) \
507
	daemons/daemon-util.in \
508
	daemons/ganeti-cleaner.in \
509
	$(pkglib_python_scripts) \
510
	devel/upload.in \
511
	tools/kvm-ifup.in \
512
	$(docdot) \
513
	$(docpng) \
514 515 516
	$(docrst) \
	doc/conf.py \
	doc/html \
517
	doc/examples/ganeti.initd.in \
518
	doc/examples/ganeti-kvm-poweroff.initd.in \
519
	doc/examples/ganeti.cron.in \
520
	doc/examples/gnt-config-backup.in \
521 522
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
523
	doc/examples/hooks/ethers \
Luca Bigliardi's avatar
Luca Bigliardi committed
524
	doc/examples/hooks/ipsec.in \
525 526 527
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
528 529 530 531
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
532 533
	man/footer.rst \
	$(manrst) \
534
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
535
	qa/qa-sample.json \
536
	$(qa_scripts) \
537 538
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
	$(HS_PROG_SRCS)
539 540 541

man_MANS = \
	man/ganeti.7 \
542
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
543
	man/ganeti-confd.8 \
544
	man/ganeti-listrunner.8 \
545
	man/ganeti-masterd.8 \
546 547
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
548
	man/ganeti-rapi.8 \
549 550 551
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
552
	man/gnt-debug.8 \
553
	man/gnt-group.8 \
554
	man/gnt-instance.8 \
555
	man/gnt-job.8 \
556
	man/gnt-node.8 \
557 558 559 560 561
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
	man/hspace.1
562

563
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
564
manhtml = $(patsubst %.rst,%.html,$(manrst))
565
mangen = $(patsubst %.rst,%.gen,$(manrst))
566
maninput = \
567
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
568
	$(patsubst %.html,%.html.in,$(manhtml)) \
569
	man/footer.man man/footer.html $(mangen)
570 571

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
572 573 574 575 576
	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 \
577
	test/data/cert1.pem \
578
	test/data/proc_drbd8.txt \
579
	test/data/proc_drbd80-emptyline.txt \
580
	test/data/proc_drbd83.txt \
581
	test/data/sys_drbd_usermode_helper.txt \
582
	test/import-export_unittest-helper
583

584
python_tests = \
Guido Trotter's avatar
Guido Trotter committed
585
	test/ganeti.asyncnotifier_unittest.py \
586
	test/ganeti.backend_unittest.py \
587 588
	test/ganeti.bdev_unittest.py \
	test/ganeti.cli_unittest.py \
René Nussbaumer's avatar
René Nussbaumer committed
589
	test/ganeti.client.gnt_cluster_unittest.py \
590
	test/ganeti.client.gnt_instance_unittest.py \
Guido Trotter's avatar
Guido Trotter committed
591
	test/ganeti.daemon_unittest.py \
592
	test/ganeti.cmdlib_unittest.py \
593
	test/ganeti.compat_unittest.py \
594
	test/ganeti.confd.client_unittest.py \
595
	test/ganeti.config_unittest.py \
596
	test/ganeti.constants_unittest.py \
597
	test/ganeti.errors_unittest.py \
598
	test/ganeti.hooks_unittest.py \
599
	test/ganeti.ht_unittest.py \
600
	test/ganeti.http_unittest.py \
601
	test/ganeti.hypervisor_unittest.py \
602 603
	test/ganeti.hypervisor.hv_chroot_unittest.py \
	test/ganeti.hypervisor.hv_fake_unittest.py \
604
	test/ganeti.hypervisor.hv_kvm_unittest.py \
605 606
	test/ganeti.hypervisor.hv_lxc_unittest.py \
	test/ganeti.hypervisor.hv_xen_unittest.py \
607
	test/ganeti.impexpd_unittest.py \
608
	test/ganeti.jqueue_unittest.py \
609
	test/ganeti.locking_unittest.py \
610
	test/ganeti.luxi_unittest.py \
611
	test/ganeti.masterd.instance_unittest.py \
612
	test/ganeti.mcpu_unittest.py \
613
	test/ganeti.netutils_unittest.py \
614
	test/ganeti.objects_unittest.py \
615
	test/ganeti.opcodes_unittest.py \
616
	test/ganeti.qlang_unittest.py \
617
	test/ganeti.query_unittest.py \
618
	test/ganeti.rapi.baserlib_unittest.py \
David Knowles's avatar
David Knowles committed
619
	test/ganeti.rapi.client_unittest.py \
620
	test/ganeti.rapi.resources_unittest.py \
621
	test/ganeti.rapi.rlib2_unittest.py \
622
	test/ganeti.rpc_unittest.py \
623
	test/ganeti.runtime_unittest.py \
624 625
	test/ganeti.serializer_unittest.py \
	test/ganeti.ssh_unittest.py \
626
	test/ganeti.tools.ensure_dirs_unittest.py \
Balazs Lecz's avatar
Balazs Lecz committed
627
	test/ganeti.uidpool_unittest.py \
628
	test/ganeti.utils.algo_unittest.py \
629
	test/ganeti.utils.filelock_unittest.py \
630
	test/ganeti.utils.hash_unittest.py \
631
	test/ganeti.utils.io_unittest.py \
632
	test/ganeti.utils.log_unittest.py \
633
	test/ganeti.utils.mlock_unittest.py \
634
	test/ganeti.utils.nodesetup_unittest.py \
635
	test/ganeti.utils.process_unittest.py \
636
	test/ganeti.utils.retry_unittest.py \
637
	test/ganeti.utils.text_unittest.py \
638
	test/ganeti.utils.wrapper_unittest.py \
639
	test/ganeti.utils.x509_unittest.py \
640
	test/ganeti.utils_unittest.py \
641
	test/ganeti.workerpool_unittest.py \
642
	test/cfgupgrade_unittest.py \
643 644
	test/docs_unittest.py \
	test/tempfile_fork_unittest.py
645

646 647
haskell_tests = htools/test

648
dist_TESTS = \
649
	test/check-cert-expired_unittest.bash \
650
	test/daemon-util_unittest.bash \
651
	test/ganeti-cleaner_unittest.bash \
652
	test/import-export_unittest.bash \
653 654
	$(python_tests)

655
nodist_TESTS =
656 657 658
if WANT_HTOOLS
nodist_TESTS += $(haskell_tests)
endif
659 660 661

TESTS = $(dist_TESTS) $(nodist_TESTS)

662 663 664 665 666
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
667
TESTS_ENVIRONMENT = \
668
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
669

670
all_python_code = \
671 672
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
673
	$(pkglib_python_scripts) \
674
	$(nodist_pkglib_python_scripts) \
675
	$(python_tests) \
676
	$(pkgpython_PYTHON) \
677
	$(client_PYTHON) \
678 679
	$(hypervisor_PYTHON) \
	$(rapi_PYTHON) \
680
	$(server_PYTHON) \
681
	$(pytools_PYTHON) \
682 683
	$(http_PYTHON) \
	$(confd_PYTHON) \
Michael Hanselmann's avatar
Michael Hanselmann committed
684
	$(masterd_PYTHON) \
685
	$(impexpd_PYTHON) \
686
	$(utils_PYTHON) \
687
	$(watcher_PYTHON) \
688 689
	$(noinst_PYTHON) \
	$(qa_scripts)
690

691
srclink_files = \
Iustin Pop's avatar
Iustin Pop committed
692
	man/footer.rst \
693
	test/check-cert-expired_unittest.bash \
694
	test/daemon-util_unittest.bash \
695
	test/ganeti-cleaner_unittest.bash \
696
	test/import-export_unittest.bash \
697
	$(all_python_code) \
698
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
699 700

check_python_code = \
701
	$(BUILD_BASH_COMPLETION) \
702
	$(DOCPP) \
703 704
	$(all_python_code)

705
lint_python_code = \
706
	ganeti \
707
	ganeti/http/server.py \
708 709
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
710
	$(pkglib_python_scripts) \
711
	$(BUILD_BASH_COMPLETION) \
712
	$(DOCPP) \
713
	$(PYTHON_BOOTSTRAP)
714

715 716
test/daemon-util_unittest.bash: daemons/daemon-util

717 718
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner

719 720 721 722
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod +x $@

723
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
724 725 726
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod u+x $@

727
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
728
	sed -f $(REPLACE_VARS_SED) < $< > $@
729
	chmod +x $@
730

731
doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
732 733
	sed -f $(REPLACE_VARS_SED) < $< > $@

734
doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED)
Luca Bigliardi's avatar
Luca Bigliardi committed
735 736
	sed -f $(REPLACE_VARS_SED) < $< > $@

737
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
738
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
739
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
740

741
doc/%.png: doc/%.dot
Iustin Pop's avatar
Iustin Pop committed
742
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
743 744
	$(DOT) -Tpng -o $@ $<