Makefile.am 34 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
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
49
50
	htools/Ganeti/HTools \
	htools/Ganeti/HTools/Program
51

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

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

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
94
95
96
97
98
99
100
	doc/html

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

101
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
102

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

119
maintainer-clean-local:
120
	rm -rf $(BUILDTIME_DIRS)
121

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

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

158
nodist_pkgpython_PYTHON = \
159
160
	lib/_autoconf.py \
	lib/_vcsversion.py
161

162
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
163
164
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
165

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

199
client_PYTHON = \
200
	lib/client/__init__.py \
201
	lib/client/gnt_backup.py \
202
	lib/client/gnt_cluster.py \
203
	lib/client/gnt_debug.py \
204
	lib/client/gnt_group.py \
205
	lib/client/gnt_instance.py \
206
	lib/client/gnt_job.py \
207
	lib/client/gnt_node.py \
208
	lib/client/gnt_os.py
209

210
211
212
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
213
	lib/hypervisor/hv_chroot.py \
214
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
215
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
216
	lib/hypervisor/hv_lxc.py \
217
218
	lib/hypervisor/hv_xen.py

219
220
rapi_PYTHON = \
	lib/rapi/__init__.py \
221
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
222
	lib/rapi/client.py \
223
	lib/rapi/client_utils.py \
224
225
	lib/rapi/connector.py \
	lib/rapi/rlib2.py
226

227
http_PYTHON = \
228
	lib/http/__init__.py \
229
	lib/http/auth.py \
230
231
	lib/http/client.py \
	lib/http/server.py
232

Guido Trotter's avatar
Guido Trotter committed
233
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
234
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
235
	lib/confd/client.py \
236
237
	lib/confd/querylib.py \
	lib/confd/server.py
238

Michael Hanselmann's avatar
Michael Hanselmann committed
239
masterd_PYTHON = \
240
241
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
242

243
244
245
impexpd_PYTHON = \
	lib/impexpd/__init__.py

246
watcher_PYTHON = \
247
	lib/watcher/__init__.py \
248
249
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
250

251
server_PYTHON = \
252
	lib/server/__init__.py \
253
	lib/server/confd.py \
254
	lib/server/masterd.py \
255
256
	lib/server/noded.py \
	lib/server/rapi.py
257

258
259
260
261
pytools_PYTHON = \
	lib/tools/__init__.py \
	lib/tools/ensure_dirs.py

262
utils_PYTHON = \
263
	lib/utils/__init__.py \
264
	lib/utils/algo.py \
265
	lib/utils/filelock.py \
266
	lib/utils/hash.py \
267
	lib/utils/io.py \
268
	lib/utils/log.py \
269
	lib/utils/mlock.py \
270
	lib/utils/nodesetup.py \
271
	lib/utils/process.py \
272
	lib/utils/retry.py \
273
	lib/utils/text.py \
274
275
	lib/utils/wrapper.py \
	lib/utils/x509.py
276

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

315
316
HS_PROGS = htools/htools
HS_BIN_ROLES = hbal hscan hspace
317

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

329
HS_LIB_SRCS = \
330
331
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
332
	htools/Ganeti/HTools/Compat.hs \
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
	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 \
348
	htools/Ganeti/HTools/Program/Hail.hs \
349
	htools/Ganeti/HTools/Program/Hbal.hs \
350
	htools/Ganeti/HTools/Program/Hscan.hs \
351
	htools/Ganeti/HTools/Program/Hspace.hs \
352
353
354
355
	htools/Ganeti/Jobs.hs \
	htools/Ganeti/Luxi.hs \
	htools/Ganeti/OpCodes.hs

356
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
357
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
358

359
360
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
361
362
363
364
365
# 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
366
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
Iustin Pop's avatar
Iustin Pop committed
367
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
368
	| lib/_autoconf.py lib/_vcsversion.py
369
370
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
371
	@mkdir_p@ $(dir $@)
372
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
373
	    -d . \
374
375
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
376
377
378
379
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

380
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
381

382
doc/install-quick.rst: INSTALL
383
doc/news.rst: NEWS
384
doc/upgrade.rst: UPGRADE
385

386
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
387
388
389
390
391
392
393
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

394
docdot = \
395
396
397
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
398

399
docpng = $(patsubst %.dot,%.png,$(docdot))
400

401
402
403
404
405
406
407
408
# 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 \
409
	doc/examples/ganeti-kvm-poweroff.initd \
410
	doc/examples/gnt-config-backup \
411
412
	doc/examples/hooks/ipsec \
	$(manhtml)
413

414
gnt_scripts = \
415
416
417
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
418
	scripts/gnt-group \
419
420
421
422
423
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

424
PYTHON_BOOTSTRAP_SBIN = \
425
	daemons/ganeti-confd \
426
	daemons/ganeti-masterd \
427
	daemons/ganeti-noded \
428
	daemons/ganeti-watcher \
429
	daemons/ganeti-rapi \
430
	scripts/gnt-backup \
431
	scripts/gnt-cluster \
432
	scripts/gnt-debug \
433
	scripts/gnt-group \
434
	scripts/gnt-instance \
435
	scripts/gnt-job \
436
	scripts/gnt-node \
437
	scripts/gnt-os
438

439
440
441
442
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

443
444
445
446
447
448
449
450
451
452
453
454
455
456
qa_scripts = \
	qa/ganeti-qa.py \
	qa/qa_cluster.py \
	qa/qa_config.py \
	qa/qa_daemon.py \
	qa/qa_env.py \
	qa/qa_error.py \
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

457
458
bin_SCRIPTS =
if WANT_HTOOLS
459
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
460
461
install-exec-hook:
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
462
463
# FIXME: this is a hardcoded logic, instead of auto-resolving
	$(LN_S) -f ../../../bin/htools \
464
		   $(DESTDIR)$(iallocatorsdir)/hail
465
	for role in $(HS_BIN_ROLES); do \
466
		$(LN_S) -f htools \
467
468
			   $(DESTDIR)$(bindir)/$$role ; \
	done
469
470
endif

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

486
487
488
489
490
# 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

491
492
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
493

494
nodist_sbin_SCRIPTS = \
495
	$(PYTHON_BOOTSTRAP_SBIN) \
496
497
	daemons/ganeti-cleaner

498
dist_tools_PYTHON = \
499
500
501
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
502
	tools/cfgupgrade12 \
503
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
504
	tools/lvmstrap \
505
	tools/move-instance \
506
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
507
	tools/sanitize-config
508

509
510
dist_tools_SCRIPTS = \
	$(dist_tools_PYTHON) \
511
	tools/kvm-console-wrapper \
512
513
	tools/xm-console-wrapper

514
pkglib_python_scripts = \
515
516
	daemons/import-export \
	tools/check-cert-expired
517

518
519
520
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

521
pkglib_SCRIPTS = \
522
	daemons/daemon-util \
523
	tools/kvm-ifup \
524
	$(pkglib_python_scripts)
525

526
527
528
nodist_pkglib_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

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

man_MANS = \
	man/ganeti.7 \
580
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
581
	man/ganeti-confd.8 \
582
	man/ganeti-listrunner.8 \
583
	man/ganeti-masterd.8 \
584
585
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
586
	man/ganeti-rapi.8 \
587
588
589
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
590
	man/gnt-debug.8 \
591
	man/gnt-group.8 \
592
	man/gnt-instance.8 \
593
	man/gnt-job.8 \
594
	man/gnt-node.8 \
595
596
597
598
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
	man/hscan.1 \
Iustin Pop's avatar
Iustin Pop committed
599
600
	man/hspace.1 \
	man/htools.1
601

602
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
603
manhtml = $(patsubst %.rst,%.html,$(manrst))
604
mangen = $(patsubst %.rst,%.gen,$(manrst))
605
maninput = \
606
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
607
	$(patsubst %.html,%.html.in,$(manhtml)) \
608
	man/footer.man man/footer.html $(mangen)
609
610

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
611
612
613
614
615
	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 \
616
	test/data/cert1.pem \
617
618
619
620
621
622
623
	test/data/ip-addr-show-dummy0.txt \
	test/data/ip-addr-show-lo-ipv4.txt \
	test/data/ip-addr-show-lo-ipv6.txt \
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
	test/data/ip-addr-show-lo-oneline.txt \
	test/data/ip-addr-show-lo.txt \
624
	test/data/proc_drbd8.txt \
625
	test/data/proc_drbd80-emptyline.txt \
626
	test/data/proc_drbd83.txt \
627
	test/data/sys_drbd_usermode_helper.txt \
628
	test/import-export_unittest-helper
629

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

692
693
haskell_tests = htools/test

694
dist_TESTS = \
695
	test/check-cert-expired_unittest.bash \
696
	test/daemon-util_unittest.bash \
697
	test/ganeti-cleaner_unittest.bash \
698
	test/import-export_unittest.bash \
699
700
	$(python_tests)

701
nodist_TESTS =
702
if WANT_HTOOLSTESTS
703
704
nodist_TESTS += $(haskell_tests)
endif
705
706
707

TESTS = $(dist_TESTS) $(nodist_TESTS)

708
709
710
711
712
# Environment for all tests
PLAIN_TESTS_ENVIRONMENT = \
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)

# Environment for tests run by automake
713
TESTS_ENVIRONMENT = \
714
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
715

716
all_python_code = \
717
	$(dist_sbin_SCRIPTS) \
718
	$(dist_tools_PYTHON) \
719
	$(pkglib_python_scripts) \
720
	$(nodist_pkglib_python_scripts) \
721
	$(python_tests) \
722
	$(pkgpython_PYTHON) \
723
	$(client_PYTHON) \
724
725
	$(hypervisor_PYTHON) \
	$(rapi_PYTHON) \
726
	$(server_PYTHON) \
727
	$(pytools_PYTHON) \
728
729
	$(http_PYTHON) \
	$(confd_PYTHON) \
Michael Hanselmann's avatar
Michael Hanselmann committed
730
	$(masterd_PYTHON) \
731
	$(impexpd_PYTHON) \
732
	$(utils_PYTHON) \
733
	$(watcher_PYTHON) \
734
735
	$(noinst_PYTHON) \
	$(qa_scripts)
736

737
srclink_files = \
Iustin Pop's avatar
Iustin Pop committed
738
	man/footer.rst \
739
	test/check-cert-expired_unittest.bash \
740
	test/daemon-util_unittest.bash \
741
	test/ganeti-cleaner_unittest.bash \
742
	test/import-export_unittest.bash \
743
	$(all_python_code) \
744
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
745
746

check_python_code = \
747
	$(BUILD_BASH_COMPLETION) \
748
	$(DOCPP) \
749
750
	$(all_python_code)