Makefile.am 29.6 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
# Note: the variable must be named after the directory + 'dir' suffix
26
clientdir = $(pkgpythondir)/client
27
hypervisordir = $(pkgpythondir)/hypervisor
28
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
29
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
30
confddir = $(pkgpythondir)/confd
31
rapidir = $(pkgpythondir)/rapi
32
serverdir = $(pkgpythondir)/server
33
watcherdir = $(pkgpythondir)/watcher
34
impexpddir = $(pkgpythondir)/impexpd
35
utilsdir = $(pkgpythondir)/utils
36
toolsdir = $(pkglibdir)/tools
37
iallocatorsdir = $(pkglibdir)/iallocators
38 39
docdir = $(datadir)/doc/$(PACKAGE)

40 41 42
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

43 44 45 46 47
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
	htools/Ganeti/HTools

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

75
BUILDTIME_DIR_AUTOCREATE = \
76
	scripts \
77 78
	doc/py-apidoc \
	$(HS_APIDOC) $(HS_APIDOC)/Ganeti $(HS_APIDOC)/Ganeti/HTools \
79 80 81
	doc/py-coverage \
	doc/hs-coverage \
	.hpc
82 83 84

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
85 86 87 88 89 90 91
	doc/html

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

92
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
93

Iustin Pop's avatar
Iustin Pop committed
94
MAINTAINERCLEANFILES = \
95
	$(docpng) \
96
	$(maninput) \
97
	doc/install-quick.rst \
98
	doc/news.rst \
99
	doc/upgrade.rst \
100
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
101

102
maintainer-clean-local:
103
	rm -rf $(BUILDTIME_DIRS)
104

105
CLEANFILES = \
106
	$(addsuffix /*.py[co],$(DIRS)) \
107 108
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
109
	$(all_dirfiles) \
110
	$(PYTHON_BOOTSTRAP) \
111
	epydoc.conf \
112
	autotools/replace_vars.sed \
113
	daemons/daemon-util \
114
	daemons/ensure-dirs \
115
	daemons/ganeti-cleaner \
116
	devel/upload \
117
	doc/examples/bash_completion \
118
	doc/examples/ganeti.initd \
119
	doc/examples/ganeti-kvm-poweroff.initd \
120
	doc/examples/ganeti.cron \
121
	doc/examples/gnt-config-backup \
Luca Bigliardi's avatar
Luca Bigliardi committed
122
	doc/examples/hooks/ipsec \
Iustin Pop's avatar
Iustin Pop committed
123 124
	$(man_MANS) \
	$(manhtml) \
125
	tools/kvm-ifup \
126
	stamp-srclinks \
127
	$(nodist_pkgpython_PYTHON) \
128
	$(HALLPROGS) $(HSRCS2) \
129 130
	.hpc/*.mix htools/*.tix \
	doc/hs-lint.html
131

132 133
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
# it'll cause the target to rebuild every time.
134 135
BUILT_SOURCES = \
	ganeti \
136
	stamp-srclinks \
137
	lib/_autoconf.py \
138
	$(all_dirfiles) \
139 140
	$(PYTHON_BOOTSTRAP)

141 142 143
nodist_pkgpython_PYTHON = \
	lib/_autoconf.py

144
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
145 146
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
147

148 149
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
150
	lib/asyncnotifier.py \
151 152 153 154 155
	lib/backend.py \
	lib/bdev.py \
	lib/bootstrap.py \
	lib/cli.py \
	lib/cmdlib.py \
156
	lib/compat.py \
157 158
	lib/config.py \
	lib/constants.py \
159
	lib/daemon.py \
160
	lib/errors.py \
161
	lib/ht.py \
162
	lib/jqueue.py \
163
	lib/jstore.py \
164 165 166
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
167
	lib/netutils.py \
168 169
	lib/objects.py \
	lib/opcodes.py \
170
	lib/qlang.py \
171
	lib/query.py \
172
	lib/rpc.py \
173
	lib/runtime.py \
174 175 176
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
177
	lib/storage.py \
178
	lib/uidpool.py \
179
	lib/workerpool.py
180

181
client_PYTHON = \
182
	lib/client/__init__.py \
183
	lib/client/gnt_backup.py \
184
	lib/client/gnt_cluster.py \
185
	lib/client/gnt_debug.py \
186
	lib/client/gnt_group.py \
187
	lib/client/gnt_instance.py \
188
	lib/client/gnt_job.py \
189
	lib/client/gnt_node.py \
190
	lib/client/gnt_os.py
191

192 193 194
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
195
	lib/hypervisor/hv_chroot.py \
196
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
197
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
198
	lib/hypervisor/hv_lxc.py \
199 200
	lib/hypervisor/hv_xen.py

201 202
rapi_PYTHON = \
	lib/rapi/__init__.py \
203
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
204
	lib/rapi/client.py \
205
	lib/rapi/client_utils.py \
206 207
	lib/rapi/connector.py \
	lib/rapi/rlib2.py
208

209
http_PYTHON = \
210
	lib/http/__init__.py \
211
	lib/http/auth.py \
212 213
	lib/http/client.py \
	lib/http/server.py
214

Guido Trotter's avatar
Guido Trotter committed
215
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
216
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
217
	lib/confd/client.py \
218 219
	lib/confd/querylib.py \
	lib/confd/server.py
220

Michael Hanselmann's avatar
Michael Hanselmann committed
221
masterd_PYTHON = \
222 223
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
224

225 226 227
impexpd_PYTHON = \
	lib/impexpd/__init__.py

228 229 230
watcher_PYTHON = \
	lib/watcher/__init__.py

231
server_PYTHON = \
232
	lib/server/__init__.py \
233
	lib/server/confd.py \
234
	lib/server/masterd.py \
235 236
	lib/server/noded.py \
	lib/server/rapi.py
237

238
utils_PYTHON = \
239
	lib/utils/__init__.py \
240
	lib/utils/algo.py \
241
	lib/utils/filelock.py \
242
	lib/utils/hash.py \
243
	lib/utils/io.py \
244
	lib/utils/log.py \
245
	lib/utils/mlock.py \
246
	lib/utils/nodesetup.py \
247
	lib/utils/process.py \
248
	lib/utils/retry.py \
249
	lib/utils/text.py \
250 251
	lib/utils/wrapper.py \
	lib/utils/x509.py
252

Michael Hanselmann's avatar
Michael Hanselmann committed
253
docrst = \
254
	doc/admin.rst \
255
	doc/design-2.0.rst \
256
	doc/design-2.1.rst \
257
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
258
	doc/design-2.3.rst \
259
	doc/design-htools-2.3.rst \
260
	doc/design-2.4.rst \
261
	doc/design-draft.rst \
262
	doc/design-oob.rst \
263
	doc/design-query2.rst \
264
	doc/cluster-merge.rst \
265
	doc/design-shared-storage.rst \
266
	doc/devnotes.rst \
267
	doc/glossary.rst \
268
	doc/hooks.rst \
269
	doc/iallocator.rst \
270
	doc/index.rst \
271
	doc/install-quick.rst \
272
	doc/install.rst \
273
	doc/locking.rst \
274
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
275
	doc/news.rst \
276
	doc/rapi.rst \
277
	doc/security.rst \
278
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
279
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
280

281 282 283 284 285 286 287 288 289
HPROGS = \
	htools/hbal \
	htools/hscan \
	htools/hail \
	htools/hspace

HALLPROGS = $(HPROGS) htools/test
HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS))
# we don't add -Werror by default
290
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
291
# extra flags that can be overriden on the command line
292
HEXTRA =
293 294
# exclude options for coverage reports
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
295 296
# directory for apidoc
HS_APIDOC = doc/hs-apidoc
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322

HSRCS = \
	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

HSRCS2 = htools/Ganeti/HTools/Version.hs
HSRCS2IN = $(patsubst %,%.in,$(HSRCS2))

323 324
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
325 326 327 328 329
# 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
330
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
Iustin Pop's avatar
Iustin Pop committed
331 332
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
	| lib/_autoconf.py
333 334
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
335
	@mkdir_p@ $(dir $@)
336
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
337
	    -d . \
338 339
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
340 341 342 343
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

344
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
345

346
doc/install-quick.rst: INSTALL
347
doc/news.rst: NEWS
348
doc/upgrade.rst: UPGRADE
349

350
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
351 352 353 354 355 356 357
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

358
docdot = \
359 360 361
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
362

363
docpng = $(patsubst %.dot,%.png,$(docdot))
364

365 366 367 368 369 370 371 372
# 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 \
373
	doc/examples/ganeti-kvm-poweroff.initd \
374
	doc/examples/gnt-config-backup \
375 376
	doc/examples/hooks/ipsec \
	$(manhtml)
377

378
gnt_scripts = \
379 380 381
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
382
	scripts/gnt-group \
383 384 385 386 387
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

388
PYTHON_BOOTSTRAP = \
389
	daemons/ganeti-confd \
390
	daemons/ganeti-masterd \
391
	daemons/ganeti-noded \
392
	daemons/ganeti-watcher \
393
	daemons/ganeti-rapi \
394
	scripts/gnt-backup \
395
	scripts/gnt-cluster \
396
	scripts/gnt-debug \
397
	scripts/gnt-group \
398
	scripts/gnt-instance \
399
	scripts/gnt-job \
400
	scripts/gnt-node \
401
	scripts/gnt-os
402

403 404 405 406 407 408 409 410 411 412 413 414 415 416
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

417
bin_SCRIPTS =
418
iallocators_SCRIPTS =
419
if WANT_HTOOLS
420 421
bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS))
iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS))
422 423
endif

424
$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile
425 426 427 428 429
	BINARY=$(@:htools/%=%); \
	$(GHC) --make \
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
	  $@
430

431 432 433 434 435
# 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

436 437
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
438

439
nodist_sbin_SCRIPTS = \
440
	$(PYTHON_BOOTSTRAP) \
441 442
	daemons/ganeti-cleaner

443 444 445 446
dist_tools_SCRIPTS = \
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
447
	tools/cfgupgrade12 \
448
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
449
	tools/lvmstrap \
450
	tools/move-instance \
451
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
452
	tools/sanitize-config
453

454
pkglib_python_scripts = \
455 456
	daemons/import-export \
	tools/check-cert-expired
457

458
pkglib_SCRIPTS = \
459
	daemons/daemon-util \
460
	daemons/ensure-dirs \
461
	tools/kvm-ifup \
462
	$(pkglib_python_scripts)
463

464 465
EXTRA_DIST = \
	NEWS \
466
	UPGRADE \
467
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
468
	pylintrc \
469
	autotools/build-bash-completion \
470
	autotools/check-python-code \
471
	autotools/check-man \
472
	autotools/check-news \
473
	autotools/check-tar \
474
	autotools/check-version \
475
	autotools/docpp \
476
	autotools/gen-coverage \
477
	autotools/testrunner \
478
	$(RUN_IN_TEMPDIR) \
479
	daemons/daemon-util.in \
480
	daemons/ensure-dirs.in \
481
	daemons/ganeti-cleaner.in \
482
	$(pkglib_python_scripts) \
483
	devel/upload.in \
484
	tools/kvm-ifup.in \
485
	$(docdot) \
486
	$(docpng) \
487 488 489
	$(docrst) \
	doc/conf.py \
	doc/html \
490
	doc/examples/ganeti.initd.in \
491
	doc/examples/ganeti-kvm-poweroff.initd.in \
492
	doc/examples/ganeti.cron.in \
493
	doc/examples/gnt-config-backup.in \
494 495
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
496
	doc/examples/hooks/ethers \
Luca Bigliardi's avatar
Luca Bigliardi committed
497
	doc/examples/hooks/ipsec.in \
498 499 500
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
501 502 503 504
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
505 506
	man/footer.rst \
	$(manrst) \
507
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
508
	qa/qa-sample.json \
509 510 511
	$(qa_scripts) \
	$(HSRCS) $(HSRCS2IN) \
	$(HSRCPROGS)
512 513 514

man_MANS = \
	man/ganeti.7 \
515
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
516
	man/ganeti-confd.8 \
517
	man/ganeti-listrunner.8 \
518
	man/ganeti-masterd.8 \
519 520
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
521
	man/ganeti-rapi.8 \
522 523 524
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
525
	man/gnt-debug.8 \
526
	man/gnt-group.8 \
527
	man/gnt-instance.8 \
528
	man/gnt-job.8 \
529
	man/gnt-node.8 \
530 531 532 533 534
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
	man/hspace.1
535

536
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
537
manhtml = $(patsubst %.rst,%.html,$(manrst))
538
mangen = $(patsubst %.rst,%.gen,$(manrst))
539
maninput = \
540
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
541
	$(patsubst %.html,%.html.in,$(manhtml)) \
542
	man/footer.man man/footer.html $(mangen)
543 544

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
545 546 547 548 549
	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 \
550
	test/data/cert1.pem \
551
	test/data/proc_drbd8.txt \
552
	test/data/proc_drbd80-emptyline.txt \
553
	test/data/proc_drbd83.txt \
554
	test/data/sys_drbd_usermode_helper.txt \
555
	test/import-export_unittest-helper
556

557
python_tests = \
Guido Trotter's avatar
Guido Trotter committed
558
	test/ganeti.asyncnotifier_unittest.py \
559
	test/ganeti.backend_unittest.py \
560 561
	test/ganeti.bdev_unittest.py \
	test/ganeti.cli_unittest.py \
René Nussbaumer's avatar
René Nussbaumer committed
562
	test/ganeti.client.gnt_cluster_unittest.py \
563
	test/ganeti.client.gnt_instance_unittest.py \
Guido Trotter's avatar
Guido Trotter committed
564
	test/ganeti.daemon_unittest.py \
565
	test/ganeti.cmdlib_unittest.py \
566
	test/ganeti.compat_unittest.py \
567
	test/ganeti.confd.client_unittest.py \
568
	test/ganeti.config_unittest.py \
569
	test/ganeti.constants_unittest.py \
570
	test/ganeti.errors_unittest.py \
571
	test/ganeti.hooks_unittest.py \
572
	test/ganeti.ht_unittest.py \
573
	test/ganeti.http_unittest.py \
574
	test/ganeti.hypervisor_unittest.py \
575 576
	test/ganeti.hypervisor.hv_chroot_unittest.py \
	test/ganeti.hypervisor.hv_fake_unittest.py \
577
	test/ganeti.hypervisor.hv_kvm_unittest.py \
578 579
	test/ganeti.hypervisor.hv_lxc_unittest.py \
	test/ganeti.hypervisor.hv_xen_unittest.py \
580
	test/ganeti.impexpd_unittest.py \
581
	test/ganeti.jqueue_unittest.py \
582
	test/ganeti.locking_unittest.py \
583
	test/ganeti.luxi_unittest.py \
584
	test/ganeti.masterd.instance_unittest.py \
585
	test/ganeti.mcpu_unittest.py \
586
	test/ganeti.netutils_unittest.py \
587
	test/ganeti.objects_unittest.py \
588
	test/ganeti.opcodes_unittest.py \
589
	test/ganeti.qlang_unittest.py \
590
	test/ganeti.query_unittest.py \
591
	test/ganeti.rapi.baserlib_unittest.py \
David Knowles's avatar
David Knowles committed
592
	test/ganeti.rapi.client_unittest.py \
593
	test/ganeti.rapi.resources_unittest.py \
594
	test/ganeti.rapi.rlib2_unittest.py \
595
	test/ganeti.rpc_unittest.py \
596
	test/ganeti.runtime_unittest.py \
597 598
	test/ganeti.serializer_unittest.py \
	test/ganeti.ssh_unittest.py \
Balazs Lecz's avatar
Balazs Lecz committed
599
	test/ganeti.uidpool_unittest.py \
600
	test/ganeti.utils.algo_unittest.py \
601
	test/ganeti.utils.filelock_unittest.py \
602
	test/ganeti.utils.hash_unittest.py \
603
	test/ganeti.utils.io_unittest.py \
604
	test/ganeti.utils.log_unittest.py \
605
	test/ganeti.utils.mlock_unittest.py \
606
	test/ganeti.utils.nodesetup_unittest.py \
607
	test/ganeti.utils.process_unittest.py \
608
	test/ganeti.utils.retry_unittest.py \
609
	test/ganeti.utils.text_unittest.py \
610
	test/ganeti.utils.wrapper_unittest.py \
611
	test/ganeti.utils.x509_unittest.py \
612
	test/ganeti.utils_unittest.py \
613
	test/ganeti.workerpool_unittest.py \
614
	test/cfgupgrade_unittest.py \
615 616
	test/docs_unittest.py \
	test/tempfile_fork_unittest.py
617

618 619
haskell_tests = htools/test

620
dist_TESTS = \
621
	test/check-cert-expired_unittest.bash \
622
	test/daemon-util_unittest.bash \
623
	test/ganeti-cleaner_unittest.bash \
624
	test/import-export_unittest.bash \
625 626
	$(python_tests)

627
nodist_TESTS =
628 629 630
if WANT_HTOOLS
nodist_TESTS += $(haskell_tests)
endif
631 632 633

TESTS = $(dist_TESTS) $(nodist_TESTS)

634 635 636 637 638
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
639
TESTS_ENVIRONMENT = \
640
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
641

642
all_python_code = \
643 644
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
645
	$(pkglib_python_scripts) \
646
	$(python_tests) \
647
	$(pkgpython_PYTHON) \
648
	$(client_PYTHON) \
649 650
	$(hypervisor_PYTHON) \
	$(rapi_PYTHON) \
651
	$(server_PYTHON) \
652 653
	$(http_PYTHON) \
	$(confd_PYTHON) \
Michael Hanselmann's avatar
Michael Hanselmann committed
654
	$(masterd_PYTHON) \
655
	$(impexpd_PYTHON) \
656
	$(utils_PYTHON) \
657
	$(watcher_PYTHON) \
658 659
	$(noinst_PYTHON) \
	$(qa_scripts)
660

661
srclink_files = \
Iustin Pop's avatar
Iustin Pop committed
662
	man/footer.rst \
663
	test/check-cert-expired_unittest.bash \
664
	test/daemon-util_unittest.bash \
665
	test/ganeti-cleaner_unittest.bash \
666
	test/import-export_unittest.bash \
667 668
	$(all_python_code) \
	$(HSRCS) $(HSRCPROGS)
669 670

check_python_code = \
671
	$(BUILD_BASH_COMPLETION) \
672
	$(DOCPP) \
673 674
	$(all_python_code)

675
lint_python_code = \
676
	ganeti \
677
	ganeti/http/server.py \
678 679
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
680
	$(pkglib_python_scripts) \
681
	$(BUILD_BASH_COMPLETION) \
682
	$(DOCPP) \
683
	$(PYTHON_BOOTSTRAP)
684

685 686
test/daemon-util_unittest.bash: daemons/daemon-util

687 688
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner

689 690 691 692
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod +x $@

693
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
694 695 696
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod u+x $@

697
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
698
	sed -f $(REPLACE_VARS_SED) < $< > $@
699
	chmod +x $@
700

701
doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
702 703
	sed -f $(REPLACE_VARS_SED) < $< > $@

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

707
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
708
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
709
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
710

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

Iustin Pop's avatar
Iustin Pop committed
715 716 717 718 719
man/footer.man: man/footer.rst
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
	$(PANDOC) -f rst -t man -o $@ $<

Iustin Pop's avatar
Iustin Pop committed
720 721 722 723 724
man/footer.html: man/footer.rst
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
	$(PANDOC) -f rst -t html -o $@ $<

725 726 727
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@

728
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
Iustin Pop's avatar
Iustin Pop committed
729 730
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
731
	set -o pipefail ; \
Iustin Pop's avatar
Iustin Pop committed
732 733
	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
	  sed -e 's/\\@/@/g' > $@
734
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
Iustin Pop's avatar
Iustin Pop committed
735

736
man/%.html.in: man/%.gen man/footer.html
Iustin Pop's avatar
Iustin Pop committed
737 738
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
739
	set -o pipefail ; \
Iustin Pop's avatar
Iustin Pop committed
740 741 742
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
	  sed -e 's/\\@/@/g' > $@

743 744 745
man/%.1: man/%.1.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@

746
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
Iustin Pop's avatar
Iustin Pop committed
747
	sed -f $(REPLACE_VARS_SED) < $< > $@
748