Makefile.am 73.5 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
# Helper function to strip src/ and test/hs/ from a list
strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))

20 21 22
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

23 24 25
# Enable colors in shelltest
SHELLTESTARGS = "-c"

26
ACLOCAL_AMFLAGS = -I autotools
27
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
28
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
29
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
30
CHECK_HEADER = $(top_srcdir)/autotools/check-header
Iustin Pop's avatar
Iustin Pop committed
31
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
32
CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
33
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
34
CHECK_VERSION = $(top_srcdir)/autotools/check-version
35
CHECK_NEWS = $(top_srcdir)/autotools/check-news
36
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
37
DOCPP = $(top_srcdir)/autotools/docpp
38
REPLACE_VARS_SED = autotools/replace_vars.sed
39
PRINT_PY_CONSTANTS = $(top_srcdir)/autotools/print-py-constants
40
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
41
SHELL_ENV_INIT = autotools/shell-env-init
42

43
# starting as of Ganeti 2.10, all files are stored in two directories,
44
# with only symbolic links added at other places.
45 46 47 48 49 50 51 52 53 54 55 56 57
#
# $(versiondir) contains most of Ganeti and all architecture-dependent files
# $(versionedsharedir) contains only architecture-independent files; all python
# executables need to go directly to $(versionedsharedir), as all ganeti python
# mdules are installed outside the usual python path, i.e., as private modules.
#
# $(defaultversiondir) and $(defaultversionedsharedir) are the corresponding
# directories for "the currently running" version of Ganeti. We never install
# there, but all symbolic links go there, rather than directory to $(versiondir)
# or $(versionedsharedir). Note that all links to $(default*dir) need to be stable;
# so, if some currently architecture-independent executable is replaced by an
# architecture-dependent one (and hence has to go under $(versiondir)), add a link
# under $(versionedsharedir) but do not change the external links.
58
if USE_VERSION_FULL
Klaus Aehlig's avatar
Klaus Aehlig committed
59
DIRVERSION=$(VERSION_FULL)
60 61 62 63
else
DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
endif
versiondir = $(libdir)/ganeti/$(DIRVERSION)
64
defaultversiondir = $(libdir)/ganeti/default
65
versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
66 67
defaultversionedsharedir = $(prefix)/share/ganeti/default

68 69
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
70 71
pkglibdir = $(versiondir)$(libdir)/ganeti
myexeclibdir = $(pkglibdir)
Jose A. Lopes's avatar
Jose A. Lopes committed
72 73 74
bindir = $(versiondir)/$(BINDIR)
sbindir = $(versiondir)$(SBINDIR)
mandir = $(versionedsharedir)/root$(MANDIR)
75 76 77 78 79
pkgpythondir = $(versionedsharedir)/ganeti
gntpythondir = $(versionedsharedir)
pkgpython_bindir = $(versionedsharedir)
gnt_python_sbindir = $(versionedsharedir)
tools_pythondir = $(versionedsharedir)
80

81
clientdir = $(pkgpythondir)/client
82
cmdlibdir = $(pkgpythondir)/cmdlib
83
hypervisordir = $(pkgpythondir)/hypervisor
84
storagedir = $(pkgpythondir)/storage
85
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
86
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
87
confddir = $(pkgpythondir)/confd
88
rapidir = $(pkgpythondir)/rapi
89
rpcdir = $(pkgpythondir)/rpc
90
serverdir = $(pkgpythondir)/server
91
watcherdir = $(pkgpythondir)/watcher
92
impexpddir = $(pkgpythondir)/impexpd
93
utilsdir = $(pkgpythondir)/utils
94
toolsdir = $(pkglibdir)/tools
95
iallocatorsdir = $(pkglibdir)/iallocators
96
pytoolsdir = $(pkgpythondir)/tools
97
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
98
ifupdir = $(sysconfdir)/ganeti
99

100
SYMLINK_TARGET_DIRS = \
101
	$(sysconfdir)/ganeti \
102
	$(libdir)/ganeti/iallocators \
103 104
	$(libdir)/ganeti/tools \
	$(prefix)/share/ganeti \
Jose A. Lopes's avatar
Jose A. Lopes committed
105 106 107 108 109
	$(BINDIR) \
	$(SBINDIR) \
	$(MANDIR)/man1 \
	$(MANDIR)/man7 \
	$(MANDIR)/man8
110

111 112 113
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

114
HS_DIRS = \
Iustin Pop's avatar
Iustin Pop committed
115 116 117
	src \
	src/Ganeti \
	src/Ganeti/Confd \
118
	src/Ganeti/Curl \
119
	src/Ganeti/Cpu \
Iustin Pop's avatar
Iustin Pop committed
120
	src/Ganeti/DataCollectors \
121
	src/Ganeti/Hs2Py \
Iustin Pop's avatar
Iustin Pop committed
122 123 124
	src/Ganeti/HTools \
	src/Ganeti/HTools/Backend \
	src/Ganeti/HTools/Program \
125 126
	src/Ganeti/Hypervisor \
	src/Ganeti/Hypervisor/Xen \
127
	src/Ganeti/Monitoring \
Iustin Pop's avatar
Iustin Pop committed
128
	src/Ganeti/Query \
129 130 131
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
132
	src/Ganeti/Storage/Lvm \
133
	src/Ganeti/THH \
134 135 136
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
137 138 139
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
140
	test/hs/Test/Ganeti/Storage/Lvm \
141 142 143
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
144 145
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
146
	test/hs/Test/Ganeti/Query
147

148 149 150
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

151
DIRS = \
152
	$(HS_DIRS) \
153 154 155
	autotools \
	daemons \
	devel \
156
	devel/data \
157
	doc \
158
	doc/css \
159
	doc/examples \
160
	doc/examples/gnt-debug \
Iustin Pop's avatar
Iustin Pop committed
161
	doc/examples/hooks \
162
	doc/users \
163 164 165
	test/data/htools \
	test/data/htools/rapi \
	test/hs/shelltests \
Michele Tartara's avatar
Michele Tartara committed
166
	test/autotools \
167
	lib \
168
	lib/build \
Iustin Pop's avatar
Iustin Pop committed
169
	lib/client \
170
	lib/cmdlib \
171
	lib/confd \
172
	lib/http \
173
	lib/hypervisor \
174
	lib/impexpd \
Michael Hanselmann's avatar
Michael Hanselmann committed
175
	lib/masterd \
176
	lib/rapi \
177
	lib/rpc \
178
	lib/server \
179
	lib/storage \
180
	lib/tools \
181
	lib/utils \
182
	lib/watcher \
183 184 185 186
	man \
	qa \
	test \
	test/data \
187
	test/data/bdev-rbd \
Agata Murawska's avatar
Agata Murawska committed
188
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
189
	test/data/ovfdata/other \
Iustin Pop's avatar
Iustin Pop committed
190
	test/py \
191 192
	test/py/cmdlib \
	test/py/cmdlib/testsupport \
193 194
	tools

195
ALL_APIDOC_HS_DIRS = \
196
	$(APIDOC_HS_DIR) \
197
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
198 199 200 201 202

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
203
	$(APIDOC_PY_DIR) \
204 205
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
206
	$(COVERAGE_PY_DIR) \
207
	.hpc
208 209 210

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
211 212
	doc/html \
	doc/man-html
213 214 215 216

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
217
	doc/html/_* \
218
	doc/man-html/_* \
Iustin Pop's avatar
Iustin Pop committed
219
	autom4te.cache
220

221 222 223 224 225 226 227 228
# 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
229
MAINTAINERCLEANFILES = \
230
	$(maninput) \
231
	doc/install-quick.rst \
232
	doc/news.rst \
233
	doc/upgrade.rst \
234
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
235

236
maintainer-clean-local:
237
	rm -rf $(BUILDTIME_DIRS)
238

239
CLEANFILES = \
240
	$(addsuffix /*.py[co],$(DIRS)) \
241 242
	$(addsuffix /*.hi,$(HS_DIRS)) \
	$(addsuffix /*.o,$(HS_DIRS)) \
243
	$(PYTHON_BOOTSTRAP) \
244
	$(gnt_python_sbin_SCRIPTS) \
245
	epydoc.conf \
Iustin Pop's avatar
Iustin Pop committed
246
	$(REPLACE_VARS_SED) \
247
	$(SHELL_ENV_INIT) \
248
	daemons/daemon-util \
249
	daemons/ganeti-cleaner \
250 251
	devel/squeeze-amd64.tar.gz \
	devel/squeeze-amd64.conf \
252 253
	$(mandocrst) \
	doc/manpages-enabled.rst \
254
	$(BUILT_EXAMPLES) \
255
	doc/examples/bash_completion \
256
	doc/examples/bash_completion-debug \
257
	$(userspecs) \
258
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
259 260
	$(man_MANS) \
	$(manhtml) \
261
	tools/kvm-ifup \
262
	tools/kvm-ifup-os \
263 264
	tools/vif-ganeti \
	tools/net-common \
265
	tools/users-setup \
266
	tools/vcluster-setup \
267
	stamp-directories \
268
	stamp-srclinks \
269
	$(nodist_pkgpython_PYTHON) \
270
	$(gnt_scripts) \
271
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
272
	$(HS_BUILT_TEST_HELPERS) \
Iustin Pop's avatar
Iustin Pop committed
273
	src/ganeti-confd \
Thomas Thrainer's avatar
Thomas Thrainer committed
274
	src/ganeti-luxid \
275
	src/ganeti-mond \
276
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
277
	doc/hs-lint.html
278

Iustin Pop's avatar
Iustin Pop committed
279
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
280
	$(built_base_sources) \
281
	$(BUILT_PYTHON_SOURCES) \
282 283
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
284

285
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
286
if ENABLE_CONFD
287
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
288
endif
289 290 291
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
292

293
built_base_sources = \
294 295
	stamp-directories \
	stamp-srclinks
296

297
built_python_base_sources = \
298
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
299 300
	lib/_vcsversion.py \
	lib/opcodes.py
301 302 303

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
304
	lib/_generated_rpc.py
305

Iustin Pop's avatar
Iustin Pop committed
306 307
# Generating the RPC wrappers depends on many things, so make sure
# it's built at the end of the built sources
308 309
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)

310 311 312 313 314
# 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 \
Apollon Oikonomopoulos's avatar
Apollon Oikonomopoulos committed
315
	doc/examples/ganeti.logrotate \
316
	doc/examples/ganeti-master-role.ocf \
317
	doc/examples/ganeti-node-role.ocf \
318 319 320
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

321 322 323
dist_ifup_SCRIPTS = \
	tools/kvm-ifup-os

324 325 326
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

327 328 329 330 331 332
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

333
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
334
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
335 336
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
337

338 339
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
340
	lib/asyncnotifier.py \
341 342 343
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
344
	lib/compat.py \
345 346
	lib/config.py \
	lib/constants.py \
347
	lib/daemon.py \
348
	lib/errors.py \
349
	lib/hooksmaster.py \
350
	lib/ht.py \
351
	lib/jqueue.py \
352
	lib/jstore.py \
353 354 355
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
356
	lib/netutils.py \
357
	lib/objects.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
358
	lib/opcodes_base.py \
359
	lib/outils.py \
360
	lib/ovf.py \
361
	lib/pathutils.py \
362
	lib/qlang.py \
363
	lib/query.py \
364
	lib/rpc_defs.py \
365
	lib/runtime.py \
366 367 368
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
369
	lib/uidpool.py \
370
	lib/vcluster.py \
371
	lib/network.py \
372
	lib/workerpool.py
373

374
client_PYTHON = \
375
	lib/client/__init__.py \
376
	lib/client/base.py \
377
	lib/client/gnt_backup.py \
378
	lib/client/gnt_cluster.py \
379
	lib/client/gnt_debug.py \
380
	lib/client/gnt_group.py \
381
	lib/client/gnt_instance.py \
382
	lib/client/gnt_job.py \
383
	lib/client/gnt_node.py \
384
	lib/client/gnt_network.py \
385 386
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
387

388
cmdlib_PYTHON = \
389
	lib/cmdlib/__init__.py \
390
	lib/cmdlib/backup.py \
391
	lib/cmdlib/base.py \
392
	lib/cmdlib/cluster.py \
393
	lib/cmdlib/common.py \
394
	lib/cmdlib/group.py \
395
	lib/cmdlib/instance.py \
396
	lib/cmdlib/instance_migration.py \
397
	lib/cmdlib/instance_operation.py \
398
	lib/cmdlib/instance_query.py \
399
	lib/cmdlib/instance_storage.py \
400
	lib/cmdlib/instance_utils.py \
401 402 403
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
404
	lib/cmdlib/operating_system.py \
405
	lib/cmdlib/query.py \
406
	lib/cmdlib/tags.py \
407
	lib/cmdlib/test.py
408

409 410 411
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
412
	lib/hypervisor/hv_chroot.py \
413
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
414
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
415
	lib/hypervisor/hv_lxc.py \
416 417
	lib/hypervisor/hv_xen.py

418 419 420 421
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
422
	lib/storage/container.py \
423 424
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
425
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
426 427
	lib/storage/filestorage.py \
	lib/storage/gluster.py
428

429 430
rapi_PYTHON = \
	lib/rapi/__init__.py \
431
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
432
	lib/rapi/client.py \
433
	lib/rapi/client_utils.py \
434
	lib/rapi/connector.py \
435 436
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
437

438
http_PYTHON = \
439
	lib/http/__init__.py \
440
	lib/http/auth.py \
441 442
	lib/http/client.py \
	lib/http/server.py
443

Guido Trotter's avatar
Guido Trotter committed
444
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
445
	lib/confd/__init__.py \
446
	lib/confd/client.py
447

Michael Hanselmann's avatar
Michael Hanselmann committed
448
masterd_PYTHON = \
449
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
450
	lib/masterd/iallocator.py \
451
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
452

453 454 455
impexpd_PYTHON = \
	lib/impexpd/__init__.py

456
watcher_PYTHON = \
457
	lib/watcher/__init__.py \
458 459
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
460

461
server_PYTHON = \
462
	lib/server/__init__.py \
463
	lib/server/masterd.py \
464 465
	lib/server/noded.py \
	lib/server/rapi.py
466

467 468
rpc_PYTHON = \
	lib/rpc/__init__.py \
469
	lib/rpc/client.py \
470 471 472
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
473

474 475
pytools_PYTHON = \
	lib/tools/__init__.py \
476
	lib/tools/burnin.py \
477
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
478
	lib/tools/node_cleanup.py \
479
	lib/tools/node_daemon_setup.py \
480
	lib/tools/prepare_node_join.py
481

482
utils_PYTHON = \
483
	lib/utils/__init__.py \
484
	lib/utils/algo.py \
485
	lib/utils/filelock.py \
486
	lib/utils/hash.py \
487
	lib/utils/io.py \
488
	lib/utils/log.py \
489
	lib/utils/lvm.py \
490
	lib/utils/mlock.py \
491
	lib/utils/nodesetup.py \
492
	lib/utils/process.py \
493
	lib/utils/retry.py \
494
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
495
	lib/utils/storage.py \
496
	lib/utils/text.py \
497
	lib/utils/version.py \
498 499
	lib/utils/wrapper.py \
	lib/utils/x509.py
500

501
docinput = \
502
	doc/admin.rst \
Jose A. Lopes's avatar
Jose A. Lopes committed
503
	doc/cluster-keys-replacement.rst \
Iustin Pop's avatar
Iustin Pop committed
504
	doc/cluster-merge.rst \
505 506
	doc/conf.py \
	doc/css/style.css \
507
	doc/design-2.0.rst \
508
	doc/design-2.1.rst \
509
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
510
	doc/design-2.3.rst \
511
	doc/design-2.4.rst \
512
	doc/design-2.5.rst \
513
	doc/design-2.6.rst \
514
	doc/design-2.7.rst \
515
	doc/design-2.8.rst \
Klaus Aehlig's avatar
Klaus Aehlig committed
516
	doc/design-2.9.rst \
517
	doc/design-2.10.rst \
518
	doc/design-2.11.rst \
Iustin Pop's avatar
Iustin Pop committed
519 520
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
521
	doc/design-ceph-ganeti-support.rst \
Iustin Pop's avatar
Iustin Pop committed
522
	doc/design-chained-jobs.rst \
523
	doc/design-cmdlib-unittests.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
524
	doc/design-cpu-pinning.rst \
525
	doc/design-daemons.rst \
526
	doc/design-device-uuid-name.rst \
Iustin Pop's avatar
Iustin Pop committed
527
	doc/design-draft.rst \
Jose A. Lopes's avatar
Jose A. Lopes committed
528
	doc/design-file-based-storage.rst \
529
	doc/design-glusterfs-ganeti-support.rst \
530 531 532
	doc/design-hotplug.rst \
	doc/design-hroller.rst \
	doc/design-hsqueeze.rst \
Iustin Pop's avatar
Iustin Pop committed
533
	doc/design-htools-2.3.rst \
534
	doc/design-http-server.rst \
535
	doc/design-hugepages-support.rst \
536
	doc/design-impexp2.rst \
537
	doc/design-internal-shutdown.rst \
Jose A. Lopes's avatar
Jose A. Lopes committed
538
	doc/design-kvmd.rst \
539
	doc/design-linuxha.rst \
540 541
	doc/design-lu-generated-jobs.rst \
	doc/design-monitoring-agent.rst \
542
	doc/design-multi-reloc.rst \
543
	doc/design-multi-version-tests.rst \
544
	doc/design-network.rst \
545
	doc/design-node-add.rst \
Iustin Pop's avatar
Iustin Pop committed
546
	doc/design-oob.rst \
547
	doc/design-openvswitch.rst \
548
	doc/design-opportunistic-locking.rst \
549
	doc/design-optables.rst \
550
	doc/design-os.rst \
551
	doc/design-ovf-support.rst \
Iustin Pop's avatar
Iustin Pop committed
552 553
	doc/design-partitioned.rst \
	doc/design-query2.rst \
554
	doc/design-query-splitting.rst \
555
	doc/design-reason-trail.rst \
556
	doc/design-resource-model.rst \
557
	doc/design-restricted-commands.rst \
558
	doc/design-shared-storage.rst \
559
	doc/design-ssh-ports.rst \
560 561
	doc/design-storagetypes.rst \
	doc/design-upgrade.rst \
562
	doc/design-virtual-clusters.rst \
Iustin Pop's avatar
Iustin Pop committed
563
	doc/design-x509-ca.rst \
564
	doc/dev-codestyle.rst \
565
	doc/devnotes.rst \
566
	doc/glossary.rst \
567
	doc/hooks.rst \
568
	doc/iallocator.rst \
569
	doc/index.rst \
570
	doc/install-quick.rst \
571
	doc/install.rst \
572
	doc/locking.rst \
573
	doc/manpages-disabled.rst \
574
	doc/monitoring-query-format.rst \
575
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
576
	doc/news.rst \
577
	doc/ovfconverter.rst \
578
	doc/rapi.rst \
579
	doc/security.rst \
580
	doc/upgrade.rst \
581
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
582
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
583

584 585 586
# Generates file names such as "doc/man-gnt-instance.rst"
mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))

587 588 589 590
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
591
if ENABLE_MOND
592
HS_MYEXECLIB_PROGS=src/mon-collector
593 594 595
else
HS_MYEXECLIB_PROGS=
endif
596

597
# Haskell programs to be compiled by "make really-all"
598
HS_COMPILE_PROGS= \
Jose A. Lopes's avatar
Jose A. Lopes committed
599
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
600
	src/ganeti-metad \
601
	src/ganeti-mond \
602
	src/hconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
603
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
604
	src/hs2py \
605 606 607 608 609
	src/rpc-test

# All Haskell non-test programs to be compiled but not automatically installed
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)

610
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
611
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
612

613 614 615 616
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
617 618
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
619
	test/hs/htest \
620
	$(HS_COMPILE_PROGS)
621

622 623
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

624
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
625
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
626

627
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
628
	-O -Wall -Werror -isrc \
629 630 631 632
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

633
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
634
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
635
# internal extra flags (used for test/hs/htest mainly)
636
HEXTRA_INT =
637
# exclude options for coverage reports
638
HPCEXCL = --exclude Main \
639
	--exclude Ganeti.Constants \
640
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
641
	--exclude Ganeti.THH \
642
	--exclude Ganeti.Version \
643
	--exclude Test.Ganeti.Attoparsec \
644
	--exclude Test.Ganeti.TestCommon \
645 646
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
647
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
648
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
649

650
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
651 652 653 654
	src/Ganeti/BasicTypes.hs \
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
655
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
656 657 658 659
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
660
	src/Ganeti/ConfigReader.hs \
661
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
662
	src/Ganeti/ConstantUtils.hs \
663 664
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
665
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
666 667
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
668
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
669
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
670
	src/Ganeti/DataCollectors/Drbd.hs \
671 672
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
673
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
674
	src/Ganeti/DataCollectors/Program.hs \
675
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
676 677 678 679 680 681 682 683 684 685 686 687 688 689
	src/Ganeti/Errors.hs \
	src/Ganeti/HTools/Backend/IAlloc.hs \
	src/Ganeti/HTools/Backend/Luxi.hs \
	src/Ganeti/HTools/Backend/Rapi.hs \
	src/Ganeti/HTools/Backend/Simu.hs \
	src/Ganeti/HTools/Backend/Text.hs \
	src/Ganeti/HTools/CLI.hs \
	src/Ganeti/HTools/Cluster.hs \
	src/Ganeti/HTools/Container.hs \
	src/Ganeti/HTools/ExtLoader.hs \
	src/Ganeti/HTools/Graph.hs \
	src/Ganeti/HTools/Group.hs \
	src/Ganeti/HTools/Instance.hs \
	src/Ganeti/HTools/Loader.hs \
690
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
691 692 693
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
694
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
695 696 697 698 699
	src/Ganeti/HTools/Program/Hbal.hs \
	src/Ganeti/HTools/Program/Hcheck.hs \
	src/Ganeti/HTools/Program/Hinfo.hs \
	src/Ganeti/HTools/Program/Hscan.hs \
	src/Ganeti/HTools/Program/Hspace.hs \
700
	src/Ganeti/HTools/Program/Hsqueeze.hs \
Iustin Pop's avatar
Iustin Pop committed
701
	src/Ganeti/HTools/Program/Hroller.hs \
702
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
703
	src/Ganeti/HTools/Types.hs \
704
	src/Ganeti/Hypervisor/Xen.hs \
705 706
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
707
	src/Ganeti/Hash.hs \
708
	src/Ganeti/Hs2Py/GenConstants.hs \
709
	src/Ganeti/Hs2Py/GenOpCodes.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
710
	src/Ganeti/Hs2Py/OpDoc.hs \
Iustin Pop's avatar
Iustin Pop committed
711
	src/Ganeti/JQueue.hs \
712
	src/Ganeti/JQScheduler.hs \
Iustin Pop's avatar
Iustin Pop committed
713 714
	src/Ganeti/JSON.hs \
	src/Ganeti/Jobs.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
715
	src/Ganeti/Kvmd.hs \
Iustin Pop's avatar
Iustin Pop committed
716 717
	src/Ganeti/Logging.hs \
	src/Ganeti/Luxi.hs \
718
	src/Ganeti/Monitoring/Server.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
719
	src/Ganeti/Metad.hs \
Iustin Pop's avatar
Iustin Pop committed
720 721 722 723 724
	src/Ganeti/Network.hs \
	src/Ganeti/Objects.hs \
	src/Ganeti/OpCodes.hs \
	src/Ganeti/OpParams.hs \
	src/Ganeti/Path.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
725
	src/Ganeti/Parsers.hs \
726
	src/Ganeti/PyValue.hs \
Thomas Thrainer's avatar
Thomas Thrainer committed
727
	src/Ganeti/Query/Cluster.hs \