Makefile.am 41.7 KB
Newer Older
1
2
3
4
5
# Ganeti makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable (see hypervisor).
# - All directories must be listed DIRS.
Michael Hanselmann's avatar
Michael Hanselmann committed
6
# - Use autogen.sh to generate Makefile.in and configure script.
7
8
9
10
11

# Automake doesn't export these variables before version 1.10.
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@

12
13
14
15
16
# Helper values for calling builtin functions
empty :=
space := $(empty) $(empty)
comma := ,

17
18
19
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

20
ACLOCAL_AMFLAGS = -I autotools
21
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
22
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
23
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
24
CHECK_HEADER = $(top_srcdir)/autotools/check-header
Iustin Pop's avatar
Iustin Pop committed
25
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
26
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
27
CHECK_VERSION = $(top_srcdir)/autotools/check-version
28
CHECK_NEWS = $(top_srcdir)/autotools/check-news
29
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
30
DOCPP = $(top_srcdir)/autotools/docpp
31
REPLACE_VARS_SED = autotools/replace_vars.sed
32
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
33
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
34

35
36
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
37
clientdir = $(pkgpythondir)/client
38
hypervisordir = $(pkgpythondir)/hypervisor
39
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
40
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
41
confddir = $(pkgpythondir)/confd
42
rapidir = $(pkgpythondir)/rapi
43
serverdir = $(pkgpythondir)/server
44
watcherdir = $(pkgpythondir)/watcher
45
impexpddir = $(pkgpythondir)/impexpd
46
utilsdir = $(pkgpythondir)/utils
47
toolsdir = $(pkglibdir)/tools
48
iallocatorsdir = $(pkglibdir)/iallocators
49
pytoolsdir = $(pkgpythondir)/tools
50
docdir = $(datadir)/doc/$(PACKAGE)
51
myexeclibdir = $(pkglibdir)
52

53
54
55
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

56
57
58
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
Iustin Pop's avatar
Iustin Pop committed
59
	htools/Ganeti/Confd \
60
61
	htools/Ganeti/HTools \
	htools/Ganeti/HTools/Program
62

63
64
65
66
67
68
DIRS = \
	autotools \
	daemons \
	devel \
	doc \
	doc/examples \
Guido Trotter's avatar
Guido Trotter committed
69
	doc/examples/hooks \
70
	doc/examples/gnt-debug \
71
	$(HTOOLS_DIRS) \
72
	lib \
73
	lib/client \
74
	lib/build \
75
	lib/confd \
76
	lib/http \
77
	lib/hypervisor \
78
	lib/impexpd \
Michael Hanselmann's avatar
Michael Hanselmann committed
79
	lib/masterd \
80
	lib/rapi \
81
	lib/server \
82
	lib/tools \
83
	lib/utils \
84
	lib/watcher \
85
86
87
88
	man \
	qa \
	test \
	test/data \
Iustin Pop's avatar
Iustin Pop committed
89
	test/data/htools \
90
	test/data/htools/rapi \
Agata Murawska's avatar
Agata Murawska committed
91
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
92
	test/data/ovfdata/other \
93
94
	tools

95
BUILDTIME_DIR_AUTOCREATE = \
96
	scripts \
97
98
99
	$(APIDOC_DIR) \
	$(APIDOC_PY_DIR) \
	$(APIDOC_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
100
101
102
	$(APIDOC_HS_DIR)/Ganeti \
	$(APIDOC_HS_DIR)/Ganeti/Confd \
	$(APIDOC_HS_DIR)/Ganeti/HTools \
103
	$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
104
105
106
	$(COVERAGE_DIR) \
	$(COVERAGE_PY_DIR) \
	$(COVERAGE_HS_DIR) \
107
	.hpc
108
109
110

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
111
112
113
114
115
116
117
	doc/html

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

118
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
119

120
121
122
123
124
125
126
127
# 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
128
MAINTAINERCLEANFILES = \
129
	$(docpng) \
130
	$(maninput) \
131
	doc/install-quick.rst \
132
	doc/news.rst \
133
	doc/upgrade.rst \
134
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
135

136
maintainer-clean-local:
137
	rm -rf $(BUILDTIME_DIRS)
138

139
CLEANFILES = \
140
	$(addsuffix /*.py[co],$(DIRS)) \
141
142
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
143
	$(all_dirfiles) \
144
	$(PYTHON_BOOTSTRAP) \
145
	epydoc.conf \
146
	autotools/replace_vars.sed \
147
	daemons/daemon-util \
148
	daemons/ganeti-cleaner \
149
	devel/upload \
150
	$(BUILT_EXAMPLES) \
151
	doc/examples/bash_completion \
152
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
153
154
	$(man_MANS) \
	$(manhtml) \
155
	tools/kvm-ifup \
156
	stamp-srclinks \
157
	$(nodist_pkgpython_PYTHON) \
158
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
159
	$(HS_BUILT_TEST_HELPERS) \
160
161
	.hpc/*.mix htools/*.tix \
	doc/hs-lint.html
162

163
164
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
# it'll cause the target to rebuild every time.
165
BUILT_SOURCES = \
166
167
168
169
170
  $(built_base_sources) \
	$(BUILT_PYTHON_SOURCES) \
	$(PYTHON_BOOTSTRAP)

built_base_sources = \
171
	ganeti \
172
	stamp-srclinks \
173
	$(all_dirfiles)
174

175
built_python_base_sources = \
176
	lib/_autoconf.py \
177
178
179
180
	lib/_vcsversion.py

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
181
	lib/_generated_rpc.py
182

183
184
185
186
# Generating the RPC wrappers depends on many things, so make sure it's built at
# the end of the built sources
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)

187
188
189
190
191
192
193
194
# these are all built from the underlying %.in sources
BUILT_EXAMPLES = \
	doc/examples/ganeti-kvm-poweroff.initd \
	doc/examples/ganeti.cron \
	doc/examples/ganeti.initd \
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

195
196
197
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

198
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
199
	lib/build/__init__.py \
200
201
	lib/build/sphinx_ext.py \
	lib/build/shell_example_lexer.py
202

203
204
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
205
	lib/asyncnotifier.py \
206
207
208
209
210
	lib/backend.py \
	lib/bdev.py \
	lib/bootstrap.py \
	lib/cli.py \
	lib/cmdlib.py \
211
	lib/compat.py \
212
213
	lib/config.py \
	lib/constants.py \
214
	lib/daemon.py \
215
	lib/errors.py \
216
	lib/ht.py \
217
	lib/jqueue.py \
218
	lib/jstore.py \
219
220
221
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
222
	lib/netutils.py \
223
224
	lib/objects.py \
	lib/opcodes.py \
225
	lib/ovf.py \
226
	lib/qlang.py \
227
	lib/query.py \
228
	lib/rpc.py \
229
	lib/rpc_defs.py \
230
	lib/runtime.py \
231
232
233
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
234
	lib/storage.py \
235
	lib/uidpool.py \
236
	lib/workerpool.py
237

238
client_PYTHON = \
239
	lib/client/__init__.py \
240
	lib/client/gnt_backup.py \
241
	lib/client/gnt_cluster.py \
242
	lib/client/gnt_debug.py \
243
	lib/client/gnt_group.py \
244
	lib/client/gnt_instance.py \
245
	lib/client/gnt_job.py \
246
	lib/client/gnt_node.py \
247
	lib/client/gnt_os.py
248

249
250
251
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
252
	lib/hypervisor/hv_chroot.py \
253
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
254
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
255
	lib/hypervisor/hv_lxc.py \
256
257
	lib/hypervisor/hv_xen.py

258
259
rapi_PYTHON = \
	lib/rapi/__init__.py \
260
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
261
	lib/rapi/client.py \
262
	lib/rapi/client_utils.py \
263
	lib/rapi/connector.py \
264
265
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
266

267
http_PYTHON = \
268
	lib/http/__init__.py \
269
	lib/http/auth.py \
270
271
	lib/http/client.py \
	lib/http/server.py
272

Guido Trotter's avatar
Guido Trotter committed
273
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
274
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
275
	lib/confd/client.py \
276
277
	lib/confd/querylib.py \
	lib/confd/server.py
278

Michael Hanselmann's avatar
Michael Hanselmann committed
279
masterd_PYTHON = \
280
281
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
282

283
284
285
impexpd_PYTHON = \
	lib/impexpd/__init__.py

286
watcher_PYTHON = \
287
	lib/watcher/__init__.py \
288
289
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
290

291
server_PYTHON = \
292
	lib/server/__init__.py \
293
	lib/server/confd.py \
294
	lib/server/masterd.py \
295
296
	lib/server/noded.py \
	lib/server/rapi.py
297

298
299
300
301
pytools_PYTHON = \
	lib/tools/__init__.py \
	lib/tools/ensure_dirs.py

302
utils_PYTHON = \
303
	lib/utils/__init__.py \
304
	lib/utils/algo.py \
305
	lib/utils/filelock.py \
306
	lib/utils/hash.py \
307
	lib/utils/io.py \
308
	lib/utils/log.py \
309
	lib/utils/mlock.py \
310
	lib/utils/nodesetup.py \
311
	lib/utils/process.py \
312
	lib/utils/retry.py \
313
	lib/utils/text.py \
314
315
	lib/utils/wrapper.py \
	lib/utils/x509.py
316

Michael Hanselmann's avatar
Michael Hanselmann committed
317
docrst = \
318
	doc/admin.rst \
319
	doc/design-2.0.rst \
320
	doc/design-2.1.rst \
321
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
322
	doc/design-2.3.rst \
323
	doc/design-htools-2.3.rst \
324
	doc/design-2.4.rst \
325
	doc/design-2.5.rst \
326
	doc/design-draft.rst \
327
	doc/design-oob.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
328
	doc/design-cpu-pinning.rst \
329
	doc/design-query2.rst \
330
	doc/design-x509-ca.rst \
331
	doc/design-http-server.rst \
332
	doc/design-impexp2.rst \
333
	doc/design-lu-generated-jobs.rst \
334
	doc/design-multi-reloc.rst \
335
	doc/design-network.rst \
Michael Hanselmann's avatar
Michael Hanselmann committed
336
	doc/design-chained-jobs.rst \
337
	doc/design-ovf-support.rst \
338
	doc/design-resource-model.rst \
339
	doc/cluster-merge.rst \
340
	doc/design-shared-storage.rst \
341
	doc/design-node-state-cache.rst \
342
	doc/design-virtual-clusters.rst \
343
	doc/devnotes.rst \
344
	doc/glossary.rst \
345
	doc/hooks.rst \
346
	doc/iallocator.rst \
347
	doc/index.rst \
348
	doc/install-quick.rst \
349
	doc/install.rst \
350
	doc/locking.rst \
351
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
352
	doc/news.rst \
353
	doc/rapi.rst \
354
	doc/security.rst \
355
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
356
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
357

358
HS_PROGS = htools/htools
359
HS_BIN_ROLES = hbal hscan hspace hinfo
360

361
HS_ALL_PROGS = $(HS_PROGS) htools/test htools/hpc-htools htools/hconfd
362
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
363
364
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail

365
366
HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
367
HEXTRA =
368
369
# internal extra flags (used for htools/test mainly)
HEXTRA_INT =
370
# exclude options for coverage reports
371
HPCEXCL = --exclude Main \
372
	--exclude Ganeti.Constants \
373
374
375
	--exclude Ganeti.THH \
	--exclude Ganeti.HTools.QC \
	--exclude Ganeti.HTools.QCHelper \
376
	--exclude Ganeti.HTools.Version
377

378
HS_LIB_SRCS = \
379
380
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
381
	htools/Ganeti/HTools/Compat.hs \
382
383
384
385
386
	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 \
387
	htools/Ganeti/HTools/JSON.hs \
388
389
390
391
392
	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 \
393
	htools/Ganeti/HTools/QCHelper.hs \
394
395
396
397
398
	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 \
399
	htools/Ganeti/HTools/Program.hs \
400
	htools/Ganeti/HTools/Program/Hail.hs \
401
	htools/Ganeti/HTools/Program/Hbal.hs \
402
	htools/Ganeti/HTools/Program/Hinfo.hs \
403
	htools/Ganeti/HTools/Program/Hscan.hs \
404
	htools/Ganeti/HTools/Program/Hspace.hs \
405
	htools/Ganeti/BasicTypes.hs \
406
	htools/Ganeti/Confd.hs \
Iustin Pop's avatar
Iustin Pop committed
407
	htools/Ganeti/Confd/Server.hs \
408
	htools/Ganeti/Config.hs \
409
	htools/Ganeti/Daemon.hs \
410
	htools/Ganeti/Hash.hs \
411
	htools/Ganeti/Jobs.hs \
Iustin Pop's avatar
Iustin Pop committed
412
	htools/Ganeti/Logging.hs \
413
	htools/Ganeti/Luxi.hs \
414
	htools/Ganeti/Objects.hs \
415
	htools/Ganeti/OpCodes.hs \
Iustin Pop's avatar
Iustin Pop committed
416
	htools/Ganeti/Runtime.hs \
Iustin Pop's avatar
Iustin Pop committed
417
	htools/Ganeti/Ssconf.hs \
418
	htools/Ganeti/THH.hs
419

420
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
421
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
422

423
424
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
425
426
427
428
429
# 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
430
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
431
432
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
	lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
433
	| $(BUILT_PYTHON_SOURCES)
434
435
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
436
	@mkdir_p@ $(dir $@)
437
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
438
	    -d . \
439
440
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
441
442
443
444
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

445
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
446

447
doc/install-quick.rst: INSTALL
448
doc/news.rst: NEWS
449
doc/upgrade.rst: UPGRADE
450

451
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
452
453
454
455
456
457
458
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

459
docdot = \
460
461
462
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
463

464
docpng = $(patsubst %.dot,%.png,$(docdot))
465

466
467
468
469
470
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
	devel/upload \
	doc/html \
471
	$(BUILT_EXAMPLES) \
472
473
	doc/examples/bash_completion \
	$(manhtml)
474

475
gnt_scripts = \
476
477
478
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
479
	scripts/gnt-group \
480
481
482
483
484
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

485
PYTHON_BOOTSTRAP_SBIN = \
486
	daemons/ganeti-masterd \
487
	daemons/ganeti-noded \
488
	daemons/ganeti-watcher \
489
	daemons/ganeti-rapi \
490
	$(gnt_scripts)
491

492
493
494
495
if PY_CONFD
PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
endif

496
497
498
499
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

500
501
502
503
504
505
506
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 \
Andrea Spadaccini's avatar
Andrea Spadaccini committed
507
	qa/qa_group.py \
508
509
510
511
512
513
514
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

515
516
bin_SCRIPTS =
if WANT_HTOOLS
517
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
518
519
install-exec-hook:
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
520
521
# FIXME: this is a hardcoded logic, instead of auto-resolving
	$(LN_S) -f ../../../bin/htools \
522
		   $(DESTDIR)$(iallocatorsdir)/hail
523
	for role in $(HS_BIN_ROLES); do \
524
		$(LN_S) -f htools \
525
526
			   $(DESTDIR)$(bindir)/$$role ; \
	done
527
528
529
if HS_CONFD
	mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
endif
530
531
endif

532
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
533
534
535
536
	@if [ -z "$(HTOOLS)" ]; then \
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
	  exit 1; \
	fi
537
538
	@BINARY=$(@:htools/%=%); \
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
539
540
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
	  exit 1; \
541
	fi
542
	rm -f $(@:htools/%=%).tix
543
	BINARY=$(@:htools/%=%); $(GHC) --make \
Iustin Pop's avatar
Iustin Pop committed
544
	  $(HFLAGS) \
545
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
Iustin Pop's avatar
Iustin Pop committed
546
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
547
	  $(HEXTRA) $(HEXTRA_INT) $@
548
# for the htools/test binary, we need to enable profiling/coverage
549
htools/test: HEXTRA_INT=-fhpc -Wwarn -fno-warn-missing-signatures \
550
551
552
	-fno-warn-monomorphism-restriction -fno-warn-orphans \
	-fno-warn-missing-methods -fno-warn-unused-imports

553
554
# we compile the hpc-htools binary with the program coverage
htools/hpc-htools: HEXTRA_INT=-fhpc
555

556
# test dependency
557
htools/offline-tests.sh: htools/hpc-htools
558

559
560
561
562
563
564
565
566
567
568
569
570
571
572
# rules for building profiling-enabled versions of the haskell
# programs: hs-prof does the full two-step build, whereas
# hs-prof-quick does only the final rebuild (hs-prof must have been
# run before)
.PHONY: hs-prof hs-prof-quick
hs-prof:
	$(MAKE) clean
	$(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
	rm -f $(HS_ALL_PROGS)
	$(MAKE) hs-prof-quick

hs-prof-quick:
	$(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"

573
574
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
575

576
nodist_sbin_SCRIPTS = \
577
	$(PYTHON_BOOTSTRAP_SBIN) \
578
579
	daemons/ganeti-cleaner

580
581
582
583
if HS_CONFD
nodist_sbin_SCRIPTS += htools/hconfd
endif

584
python_scripts = \
585
586
587
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
588
	tools/cfgupgrade12 \
589
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
590
	tools/confd-client \
591
	tools/fmtjson \
Iustin Pop's avatar
Iustin Pop committed
592
	tools/lvmstrap \
593
	tools/move-instance \
594
	tools/ovfconverter \
595
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
596
	tools/sanitize-config
597

598
dist_tools_SCRIPTS = \
599
	$(python_scripts) \
600
	tools/kvm-console-wrapper \
601
602
	tools/xm-console-wrapper \
	tools/master-ip-setup
603

604
pkglib_python_scripts = \
605
606
	daemons/import-export \
	tools/check-cert-expired
607

608
609
610
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

611
myexeclib_SCRIPTS = \
612
	daemons/daemon-util \
613
	tools/kvm-ifup \
614
	$(pkglib_python_scripts)
615

616
nodist_myexeclib_SCRIPTS = \
617
618
	$(nodist_pkglib_python_scripts)

619
620
EXTRA_DIST = \
	NEWS \
621
	UPGRADE \
622
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
623
	pylintrc \
624
	autotools/build-bash-completion \
625
	autotools/build-rpc \
626
	autotools/check-header \
627
	autotools/check-python-code \
628
	autotools/check-imports \
Iustin Pop's avatar
Iustin Pop committed
629
	autotools/check-man-dashes \
630
	autotools/check-man-warnings \
631
	autotools/check-news \
632
	autotools/check-tar \
633
	autotools/check-version \
634
	autotools/convert-constants \
635
	autotools/docpp \
636
	autotools/gen-coverage \
637
	autotools/testrunner \
638
	$(RUN_IN_TEMPDIR) \
639
	daemons/daemon-util.in \
640
	daemons/ganeti-cleaner.in \
641
	$(pkglib_python_scripts) \
642
	devel/upload.in \
643
	tools/kvm-ifup.in \
644
	$(docdot) \
645
	$(docpng) \
646
647
648
	$(docrst) \
	doc/conf.py \
	doc/html \
649
	$(BUILT_EXAMPLES:%=%.in) \
650
651
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
652
	doc/examples/hooks/ethers \
653
654
655
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
656
	test/lockperf.py \
657
658
659
660
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
661
662
	man/footer.rst \
	$(manrst) \
663
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
664
	qa/qa-sample.json \
665
	$(qa_scripts) \
666
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
667
	$(HS_PROG_SRCS) \
668
669
670
	htools/lint-hints.hs \
	htools/cli-tests-defs.sh \
	htools/offline-test.sh
671
672
673

man_MANS = \
	man/ganeti.7 \
674
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
675
	man/ganeti-confd.8 \
676
	man/ganeti-listrunner.8 \
677
	man/ganeti-masterd.8 \
678
679
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
680
	man/ganeti-rapi.8 \
681
682
683
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
684
	man/gnt-debug.8 \
685
	man/gnt-group.8 \
686
	man/gnt-instance.8 \
687
	man/gnt-job.8 \
688
	man/gnt-node.8 \
689
690
691
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
René Nussbaumer's avatar
René Nussbaumer committed
692
	man/hinfo.1 \
693
	man/hscan.1 \
Iustin Pop's avatar
Iustin Pop committed
694
695
	man/hspace.1 \
	man/htools.1
696

697
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
698
manhtml = $(patsubst %.rst,%.html,$(manrst))
699
mangen = $(patsubst %.rst,%.gen,$(manrst))
700
maninput = \
701
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
702
	$(patsubst %.html,%.html.in,$(manhtml)) \
703
	man/footer.man man/footer.html $(mangen)
704
705

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
706
707
708
709
710
	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 \
711
	test/data/cert1.pem \
712
713
714
715
716
717
718
	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 \
719
	test/data/proc_drbd8.txt \
720
	test/data/proc_drbd80-emptyline.txt \
721
	test/data/proc_drbd83.txt \
722
723
	test/data/proc_drbd83_sync.txt \
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
724
725
726
727
	test/data/kvm_1.0_help.txt \
	test/data/kvm_0.15.90_help.txt \
	test/data/kvm_0.12.5_help.txt \
	test/data/kvm_0.9.1_help.txt \
728
	test/data/sys_drbd_usermode_helper.txt \
Iustin Pop's avatar
Iustin Pop committed
729
730
	test/data/htools/hail-alloc-drbd.json \
	test/data/htools/hail-change-group.json \
Iustin Pop's avatar
Iustin Pop committed
731
	test/data/htools/hail-invalid-reloc.json \
Iustin Pop's avatar
Iustin Pop committed
732
733
	test/data/htools/hail-node-evac.json \
	test/data/htools/hail-reloc-drbd.json \
Iustin Pop's avatar
Iustin Pop committed
734
735
736
	test/data/htools/common-suffix.data \
	test/data/htools/invalid-node.data \
	test/data/htools/missing-resources.data \
Iustin Pop's avatar
Iustin Pop committed
737
738
739
740
	test/data/htools/rapi/groups.json \
	test/data/htools/rapi/info.json \
	test/data/htools/rapi/instances.json \
	test/data/htools/rapi/nodes.json \
Agata Murawska's avatar
Agata Murawska committed
741
	test/data/ovfdata/compr_disk.vmdk.gz \
Agata Murawska's avatar
Agata Murawska committed
742
	test/data/ovfdata/config.ini \
Agata Murawska's avatar
Agata Murawska committed
743
	test/data/ovfdata/corrupted_resources.ovf \
Agata Murawska's avatar
Agata Murawska committed
744
	test/data/ovfdata/empty.ini \
Agata Murawska's avatar
Agata Murawska committed
745
746
747
748
749
	test/data/ovfdata/empty.ovf \
	test/data/ovfdata/ganeti.mf \
	test/data/ovfdata/ganeti.ovf \
	test/data/ovfdata/gzip_disk.ovf \
	test/data/ovfdata/new_disk.vmdk \
Agata Murawska's avatar
Agata Murawska committed
750
	test/data/ovfdata/no_disk.ini \
Agata Murawska's avatar
Agata Murawska committed
751
	test/data/ovfdata/no_disk_in_ref.ovf \
Agata Murawska's avatar
Agata Murawska committed
752
	test/data/ovfdata/no_os.ini \
Agata Murawska's avatar
Agata Murawska committed
753
754
755
	test/data/ovfdata/no_ovf.ova \
	test/data/ovfdata/ova.ova \
	test/data/ovfdata/second_disk.vmdk \
Agata Murawska's avatar
Agata Murawska committed
756
757
	test/data/ovfdata/rawdisk.raw \
	test/data/ovfdata/unsafe_path.ini \
Agata Murawska's avatar
Agata Murawska committed
758
759
	test/data/ovfdata/virtualbox.ovf \
	test/data/ovfdata/wrong_extension.ovd \
Agata Murawska's avatar
Agata Murawska committed
760
	test/data/ovfdata/wrong_config.ini \
Agata Murawska's avatar
Agata Murawska committed
761
762
763
764
	test/data/ovfdata/wrong_manifest.mf \
	test/data/ovfdata/wrong_manifest.ovf \
	test/data/ovfdata/wrong_ova.ova \
	test/data/ovfdata/wrong_xml.ovf \
Agata Murawska's avatar
Agata Murawska committed
765
	test/data/ovfdata/other/rawdisk.raw \
766
767
768
769
770
	test/data/vgreduce-removemissing-2.02.02.txt \
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
	test/data/vgs-missing-pvs-2.02.02.txt \
	test/data/vgs-missing-pvs-2.02.66.txt \
771
	test/import-export_unittest-helper \
Iustin Pop's avatar
Iustin Pop committed
772
773
	test/gnt-cli.test \
	test/ganeti-cli.test \
774
775
776
777
778
779
780
781
782
783
784
785
	test/htools-balancing.test \
	test/htools-basic.test \
	test/htools-dynutil.test \
	test/htools-excl.test \
	test/htools-hail.test \
	test/htools-hspace.test \
	test/htools-invalid.test \
	test/htools-multi-group.test \
	test/htools-no-backend.test \
	test/htools-rapi.test \
	test/htools-single-group.test \
	test/htools-text-backend.test
786

787
python_tests = \
Guido Trotter's avatar
Guido Trotter committed
788
	test/ganeti.asyncnotifier_unittest.py \
789
	test/ganeti.backend_unittest.py \
790
791
	test/ganeti.bdev_unittest.py \
	test/ganeti.cli_unittest.py \
René Nussbaumer's avatar
René Nussbaumer committed
792
	test/ganeti.client.gnt_cluster_unittest.py \
793
	test/ganeti.client.gnt_instance_unittest.py \
Guido Trotter's avatar
Guido Trotter committed
794
	test/ganeti.daemon_unittest.py \
795
	test/ganeti.cmdlib_unittest.py \
796
	test/ganeti.compat_unittest.py \
797
	test/ganeti.confd.client_unittest.py \
798
	test/ganeti.config_unittest.py \
799
	test/ganeti.constants_unittest.py \
800
	test/ganeti.errors_unittest.py \
801
	test/ganeti.hooks_unittest.py \
802
	test/ganeti.ht_unittest.py \
803
	test/ganeti.http_unittest.py \
804
	test/ganeti.hypervisor_unittest.py \
805
806
	test/ganeti.hypervisor.hv_chroot_unittest.py \
	test/ganeti.hypervisor.hv_fake_unittest.py \
807
	test/ganeti.hypervisor.hv_kvm_unittest.py \
808
809
	test/ganeti.hypervisor.hv_lxc_unittest.py \
	test/ganeti.hypervisor.hv_xen_unittest.py \
810
	test/ganeti.impexpd_unittest.py \
811
	test/ganeti.jqueue_unittest.py \
812
	test/ganeti.locking_unittest.py \
813
	test/ganeti.luxi_unittest.py \
814
	test/ganeti.masterd.instance_unittest.py \