Makefile.am 32 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
REPLACE_VARS_SED = autotools/replace_vars.sed
24
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
25

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

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

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

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

79
BUILDTIME_DIR_AUTOCREATE = \
80
	scripts \
81 82 83 84 85 86 87
	$(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) \
88
	.hpc
89 90 91

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

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

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

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

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

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

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

155 156 157
nodist_pkgpython_PYTHON = \
	lib/_autoconf.py

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

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

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

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

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

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

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

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

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

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

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

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

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

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

305
HS_PROGS = \
306 307 308 309 310
	htools/hbal \
	htools/hscan \
	htools/hail \
	htools/hspace

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

320
HS_LIB_SRCS = \
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
	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

342
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
343
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
344

345 346
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

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

366
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
367

368
doc/install-quick.rst: INSTALL
369
doc/news.rst: NEWS
370
doc/upgrade.rst: UPGRADE
371

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

380
docdot = \
381 382 383
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
384

385
docpng = $(patsubst %.dot,%.png,$(docdot))
386

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

400
gnt_scripts = \
401 402 403
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
404
	scripts/gnt-group \
405 406 407 408 409
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

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

425 426 427 428
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

429 430 431 432 433 434 435 436 437 438 439 440 441 442
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

443
bin_SCRIPTS =
444
iallocators_SCRIPTS =
445
if WANT_HTOOLS
446 447
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
448 449
endif

450
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
451 452 453 454
	@if [ -z "$(HTOOLS)" ]; then \
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
	  exit 1; \
	fi
455 456
	@BINARY=$(@:htools/%=%); \
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
457 458
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
	  exit 1; \
459 460
	fi
	BINARY=$(@:htools/%=%); $(GHC) --make \
461
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
462
	  -osuf $$BINARY.o -hisuf $$BINARY.hi $@
463

464 465 466 467 468
# 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

469 470
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
471

472
nodist_sbin_SCRIPTS = \
473
	$(PYTHON_BOOTSTRAP_SBIN) \
474 475
	daemons/ganeti-cleaner

476 477 478 479
dist_tools_SCRIPTS = \
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
480
	tools/cfgupgrade12 \
481
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
482
	tools/lvmstrap \
483
	tools/move-instance \
484
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
485
	tools/sanitize-config
486

487
pkglib_python_scripts = \
488 489
	daemons/import-export \
	tools/check-cert-expired
490

491 492 493
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

494
pkglib_SCRIPTS = \
495
	daemons/daemon-util \
496
	tools/kvm-ifup \
497
	$(pkglib_python_scripts)
498

499 500 501
nodist_pkglib_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

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

man_MANS = \
	man/ganeti.7 \
553
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
554
	man/ganeti-confd.8 \
555
	man/ganeti-listrunner.8 \
556
	man/ganeti-masterd.8 \
557 558
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
559
	man/ganeti-rapi.8 \
560 561 562
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
563
	man/gnt-debug.8 \
564
	man/gnt-group.8 \
565
	man/gnt-instance.8 \
566
	man/gnt-job.8 \
567
	man/gnt-node.8 \
568 569 570 571 572
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
	man/hspace.1
573

574
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
575
manhtml = $(patsubst %.rst,%.html,$(manrst))
576
mangen = $(patsubst %.rst,%.gen,$(manrst))
577
maninput = \
578
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
579
	$(patsubst %.html,%.html.in,$(manhtml)) \
580
	man/footer.man man/footer.html $(mangen)
581 582

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
583 584 585 586 587
	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 \
588
	test/data/cert1.pem \
589
	test/data/proc_drbd8.txt \
590
	test/data/proc_drbd80-emptyline.txt \
591
	test/data/proc_drbd83.txt \
592
	test/data/sys_drbd_usermode_helper.txt \
593
	test/import-export_unittest-helper
594

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

657 658
haskell_tests = htools/test

659
dist_TESTS = \
660
	test/check-cert-expired_unittest.bash \
661
	test/daemon-util_unittest.bash \
662
	test/ganeti-cleaner_unittest.bash \
663
	test/import-export_unittest.bash \
664 665
	$(python_tests)

666
nodist_TESTS =
667 668 669
if WANT_HTOOLS
nodist_TESTS += $(haskell_tests)
endif
670 671 672

TESTS = $(dist_TESTS) $(nodist_TESTS)

673 674 675 676 677
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
678
TESTS_ENVIRONMENT = \
679
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
680

681
all_python_code = \
682 683
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
684
	$(pkglib_python_scripts) \
685
	$(nodist_pkglib_python_scripts) \
686
	$(python_tests) \
687
	$(pkgpython_PYTHON) \
688
	$(client_PYTHON) \
689 690
	$(hypervisor_PYTHON) \
	$(rapi_PYTHON) \
691
	$(server_PYTHON) \
692
	$(pytools_PYTHON) \
693 694
	$(http_PYTHON) \
	$(confd_PYTHON) \
Michael Hanselmann's avatar
Michael Hanselmann committed
695
	$(masterd_PYTHON) \
696
	$(impexpd_PYTHON) \
697
	$(utils_PYTHON) \
698
	$(watcher_PYTHON) \
699 700
	$(noinst_PYTHON) \
	$(qa_scripts)
701

702
srclink_files = \
Iustin Pop's avatar
Iustin Pop committed
703
	man/footer.rst \
704
	test/check-cert-expired_unittest.bash \
705
	test/daemon-util_unittest.bash \
706
	test/ganeti-cleaner_unittest.bash \
707
	test/import-export_unittest.bash \
708
	$(all_python_code) \
709
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
710 711

check_python_code = \
712
	$(BUILD_BASH_COMPLETION) \
713
	$(DOCPP) \
714 715
	$(all_python_code)

716
lint_python_code = \
717
	ganeti \
718
	ganeti/http/server.py \
719 720
	$(dist_sbin_SCRIPTS) \
	$(dist_tools_SCRIPTS) \
721
	$(pkglib_python_scripts) \
722
	$(BUILD_BASH_COMPLETION) \
723
	$(DOCPP) \
724
	$(PYTHON_BOOTSTRAP)
725

726 727
test/daemon-util_unittest.bash: daemons/daemon-util

728 729
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner

730 731 732 733
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod +x $@

734
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
735 736 737
	sed -f $(REPLACE_VARS_SED) < $< > $@
	chmod u+x $@

738
daemons/%: daemons/%.in $(REPLACE_VARS_SED)
739
	sed -f $(REPLACE_VARS_SED) < $< > $@
740
	chmod +x $@
741

742