Makefile.am 27.1 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
	doc/api \
78 79 80 81
	doc/coverage

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
82 83 84 85 86 87 88
	doc/html

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

89
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
90

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

99
maintainer-clean-local:
100
	rm -rf $(BUILDTIME_DIRS)
101

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

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

136 137 138
nodist_pkgpython_PYTHON = \
	lib/_autoconf.py

139
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
140 141
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
142

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

176
client_PYTHON = \
177
	lib/client/__init__.py \
178
	lib/client/gnt_backup.py \
179
	lib/client/gnt_cluster.py \
180
	lib/client/gnt_debug.py \
181
	lib/client/gnt_group.py \
182
	lib/client/gnt_instance.py \
183
	lib/client/gnt_job.py \
184
	lib/client/gnt_node.py \
185
	lib/client/gnt_os.py
186

187 188 189
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
190
	lib/hypervisor/hv_chroot.py \
191
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
192
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
193
	lib/hypervisor/hv_lxc.py \
194 195
	lib/hypervisor/hv_xen.py

196 197
rapi_PYTHON = \
	lib/rapi/__init__.py \
198
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
199
	lib/rapi/client.py \
200
	lib/rapi/client_utils.py \
201 202
	lib/rapi/connector.py \
	lib/rapi/rlib2.py
203

204
http_PYTHON = \
205
	lib/http/__init__.py \
206
	lib/http/auth.py \
207 208
	lib/http/client.py \
	lib/http/server.py
209

Guido Trotter's avatar
Guido Trotter committed
210
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
211
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
212
	lib/confd/client.py \
213 214
	lib/confd/querylib.py \
	lib/confd/server.py
215

Michael Hanselmann's avatar
Michael Hanselmann committed
216
masterd_PYTHON = \
217 218
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
219

220 221 222
impexpd_PYTHON = \
	lib/impexpd/__init__.py

223 224 225
watcher_PYTHON = \
	lib/watcher/__init__.py

226
server_PYTHON = \
227
	lib/server/__init__.py \
228
	lib/server/confd.py \
229
	lib/server/masterd.py \
230 231
	lib/server/noded.py \
	lib/server/rapi.py
232

233
utils_PYTHON = \
234
	lib/utils/__init__.py \
235
	lib/utils/algo.py \
236
	lib/utils/filelock.py \
237
	lib/utils/hash.py \
238
	lib/utils/io.py \
239
	lib/utils/log.py \
240
	lib/utils/mlock.py \
241
	lib/utils/nodesetup.py \
242
	lib/utils/process.py \
243
	lib/utils/retry.py \
244
	lib/utils/text.py \
245 246
	lib/utils/wrapper.py \
	lib/utils/x509.py
247

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

276 277 278 279 280 281 282 283 284
HPROGS = \
	htools/hbal \
	htools/hscan \
	htools/hail \
	htools/hspace

HALLPROGS = $(HPROGS) htools/test
HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS))
# we don't add -Werror by default
285
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
HEXTRA =

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))

313 314
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

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

334
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
335

336
doc/install-quick.rst: INSTALL
337
doc/news.rst: NEWS
338
doc/upgrade.rst: UPGRADE
339

340
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
341 342 343 344 345 346 347
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

348
docdot = \
349 350 351
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
352

353
docpng = $(patsubst %.dot,%.png,$(docdot))
354

355 356 357 358 359 360 361 362
# 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 \
363
	doc/examples/ganeti-kvm-poweroff.initd \
364
	doc/examples/gnt-config-backup \
365 366
	doc/examples/hooks/ipsec \
	$(manhtml)
367

368
gnt_scripts = \
369 370 371
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
372
	scripts/gnt-group \
373 374 375 376 377
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

378
PYTHON_BOOTSTRAP = \
379
	daemons/ganeti-confd \
380
	daemons/ganeti-masterd \
381
	daemons/ganeti-noded \
382
	daemons/ganeti-watcher \
383
	daemons/ganeti-rapi \
384
	scripts/gnt-backup \
385
	scripts/gnt-cluster \
386
	scripts/gnt-debug \
387
	scripts/gnt-group \
388
	scripts/gnt-instance \
389
	scripts/gnt-job \
390
	scripts/gnt-node \
391
	scripts/gnt-os
392

393 394 395 396 397 398 399 400 401 402 403 404 405 406
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

407
bin_SCRIPTS =
408
iallocators_SCRIPTS =
409
if WANT_HTOOLS
410 411
bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS))
iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS))
412 413
endif

414
$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile
415 416 417 418 419
	BINARY=$(@:htools/%=%); \
	$(GHC) --make \
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
	  $@
420

421 422
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
423

424
nodist_sbin_SCRIPTS = \
425
	$(PYTHON_BOOTSTRAP) \
426 427
	daemons/ganeti-cleaner

428 429 430 431
dist_tools_SCRIPTS = \
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
432
	tools/cfgupgrade12 \
433
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
434
	tools/lvmstrap \
435
	tools/move-instance \
436
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
437
	tools/sanitize-config
438

439
pkglib_python_scripts = \
440 441
	daemons/import-export \
	tools/check-cert-expired
442

443
pkglib_SCRIPTS = \
444
	daemons/daemon-util \
445
	daemons/ensure-dirs \
446
	tools/kvm-ifup \
447
	$(pkglib_python_scripts)
448

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

man_MANS = \
	man/ganeti.7 \
500
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
501
	man/ganeti-confd.8 \
502
	man/ganeti-listrunner.8 \
503
	man/ganeti-masterd.8 \
504 505
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
506
	man/ganeti-rapi.8 \
507 508 509
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
510
	man/gnt-debug.8 \
511
	man/gnt-group.8 \
512
	man/gnt-instance.8 \
513
	man/gnt-job.8 \
514
	man/gnt-node.8 \
515 516 517 518 519
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
	man/hspace.1
520

521
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
522
manhtml = $(patsubst %.rst,%.html,$(manrst))
523
mangen = $(patsubst %.rst,%.gen,$(manrst))
524
maninput = \
525
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
526
	$(patsubst %.html,%.html.in,$(manhtml)) \
527
	man/footer.man man/footer.html $(mangen)
528 529

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
530 531 532 533 534
	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 \
535
	test/data/cert1.pem \
536
	test/data/proc_drbd8.txt \
537
	test/data/proc_drbd80-emptyline.txt \
538
	test/data/proc_drbd83.txt \
539
	test/data/sys_drbd_usermode_helper.txt \
540
	test/import-export_unittest-helper
541

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

603
dist_TESTS = \
604
	test/check-cert-expired_unittest.bash \
605
	test/daemon-util_unittest.bash \
606
	test/ganeti-cleaner_unittest.bash \
607
	test/import-export_unittest.bash \
608 609
	$(python_tests)

610 611 612 613
nodist_TESTS =

TESTS = $(dist_TESTS) $(nodist_TESTS)

614 615 616 617 618
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
619
TESTS_ENVIRONMENT = \
620
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
621

622
all_python_code = \
623 624
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
625
	$(pkglib_python_scripts) \
626
	$(python_tests) \
627
	$(pkgpython_PYTHON) \
628
	$(client_PYTHON) \
629 630
	$(hypervisor_PYTHON) \
	$(rapi_PYTHON) \
631
	$(server_PYTHON) \
632 633
	$(http_PYTHON) \
	$(confd_PYTHON) \
Michael Hanselmann's avatar
Michael Hanselmann committed
634
	$(masterd_PYTHON) \
635
	$(impexpd_PYTHON) \
636
	$(utils_PYTHON) \
637
	$(watcher_PYTHON) \
638 639
	$(noinst_PYTHON) \
	$(qa_scripts)
640

641
srclink_files = \
Iustin Pop's avatar
Iustin Pop committed
642
	man/footer.rst \
643
	test/check-cert-expired_unittest.bash \
644
	test/daemon-util_unittest.bash \
645
	test/ganeti-cleaner_unittest.bash \
646
	test/import-export_unittest.bash \
647 648
	$(all_python_code) \
	$(HSRCS) $(HSRCPROGS)
649 650

check_python_code = \
651
	$(BUILD_BASH_COMPLETION) \
652
	$(DOCPP) \
653 654
	$(all_python_code)

655
lint_python_code = \
656
	ganeti \
657
	ganeti/http/server.py \
658 659
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
660
	$(pkglib_python_scripts) \
661
	$(BUILD_BASH_COMPLETION) \
662
	$(DOCPP) \
663
	$(PYTHON_BOOTSTRAP)
664

665 666
test/daemon-util_unittest.bash: daemons/daemon-util

667 668
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner

669 670 671 672
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod +x $@

673
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
674 675 676
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod u+x $@

677
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
678
	sed -f $(REPLACE_VARS_SED) < $< > $@
679
	chmod +x $@
680

681
doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED)
682 683
	sed -f $(REPLACE_VARS_SED) < $< > $@

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

687
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
688
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin
689
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
690

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

Iustin Pop's avatar
Iustin Pop committed
695 696 697 698 699
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
700 701 702 703 704
man/footer.html: man/footer.rst
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
	$(PANDOC) -f rst -t html -o $@ $<

705 706 707
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@

708
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
Iustin Pop's avatar
Iustin Pop committed
709 710
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
711
	set -o pipefail ; \
Iustin Pop's avatar
Iustin Pop committed
712 713
	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
	  sed -e 's/\\@/@/g' > $@
714
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
Iustin Pop's avatar
Iustin Pop committed
715

716
man/%.html.in: man/%.gen man/footer.html
Iustin Pop's avatar
Iustin Pop committed
717 718
	@test -n "$(PANDOC)" || \
	  { echo 'pandoc' not found during configure; exit 1; }
719
	set -o pipefail ; \
Iustin Pop's avatar
Iustin Pop committed
720 721 722
	$(PANDOC) -s -f rst -t html -A man/footer.html $< | \
	  sed -e 's/\\@/@/g' > $@

723 724 725
man/%.1: man/%.1.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@

726
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
Iustin Pop's avatar
Iustin Pop committed
727
	sed -f $(REPLACE_VARS_SED) < $< > $@
728

729
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
Iustin Pop's avatar
Iustin Pop committed
730
	sed -f $(REPLACE_VARS_SED) < $< > $@
731

732
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
Iustin Pop's avatar
Iustin Pop committed
733
	sed -f $(REPLACE_VARS_SED) < $< > $@
734

735 736
epydoc.conf: epydoc.conf.in Makefile
	sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
737

738 739 740 741 742 743 744 745 746
vcs-version:
	if test -d .git; then \
	  git describe > $@; \
	elif test ! -f $@ ; then \
	  echo "Cannot auto-generate $@ file"; exit 1; \
	fi

.PHONY: regen-vcs-version
regen-vcs-version: