Makefile.am 72.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
serverdir = $(pkgpythondir)/server
90
watcherdir = $(pkgpythondir)/watcher
91
impexpddir = $(pkgpythondir)/impexpd
92
utilsdir = $(pkgpythondir)/utils
93
toolsdir = $(pkglibdir)/tools
94
iallocatorsdir = $(pkglibdir)/iallocators
95
pytoolsdir = $(pkgpythondir)/tools
96 97
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)

98 99 100 101 102 103
if USE_BACKUP_DIR
backup_dir = $(BACKUP_DIR)
else
backup_dir = $(localstatedir)/lib
endif

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

115 116 117
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

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

151 152 153
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

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

198
ALL_APIDOC_HS_DIRS = \
199
	$(APIDOC_HS_DIR) \
200
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
201 202 203 204 205

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

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
214 215
	doc/html \
	doc/man-html
216 217 218 219

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

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

239
maintainer-clean-local:
240
	rm -rf $(BUILDTIME_DIRS)
241

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

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

287
HS_GENERATED_FILES =
288
if WANT_HTOOLS
289
HS_GENERATED_FILES += $(HS_PROGS)
290
if ENABLE_CONFD
Thomas Thrainer's avatar
Thomas Thrainer committed
291
HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
292
endif
293 294 295 296

if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
297 298
endif

299
built_base_sources = \
300 301
	stamp-directories \
	stamp-srclinks
302

303
built_python_base_sources = \
304
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
305 306
	lib/_vcsversion.py \
	lib/opcodes.py
307 308 309

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
310
	lib/_generated_rpc.py
311

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

316 317 318 319 320
# 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
321
	doc/examples/ganeti.logrotate \
322
	doc/examples/ganeti-master-role.ocf \
323
	doc/examples/ganeti-node-role.ocf \
324 325 326
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

327 328 329
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

330 331 332 333 334 335
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

336
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
337
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
338 339
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
340

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

378
client_PYTHON = \
379
	lib/client/__init__.py \
380
	lib/client/gnt_backup.py \
381
	lib/client/gnt_cluster.py \
382
	lib/client/gnt_debug.py \
383
	lib/client/gnt_group.py \
384
	lib/client/gnt_instance.py \
385
	lib/client/gnt_job.py \
386
	lib/client/gnt_node.py \
387
	lib/client/gnt_network.py \
388 389
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
390

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

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

421 422 423 424
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
425
	lib/storage/container.py \
426 427
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
428 429
	lib/storage/drbd_cmdgen.py \
	lib/storage/filestorage.py
430

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

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

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

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

455 456 457
impexpd_PYTHON = \
	lib/impexpd/__init__.py

458
watcher_PYTHON = \
459
	lib/watcher/__init__.py \
460 461
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
462

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

469 470
pytools_PYTHON = \
	lib/tools/__init__.py \
471
	lib/tools/burnin.py \
472
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
473
	lib/tools/node_cleanup.py \
474
	lib/tools/node_daemon_setup.py \
475
	lib/tools/prepare_node_join.py
476

477
utils_PYTHON = \
478
	lib/utils/__init__.py \
479
	lib/utils/algo.py \
480
	lib/utils/filelock.py \
481
	lib/utils/hash.py \
482
	lib/utils/io.py \
483
	lib/utils/log.py \
484
	lib/utils/lvm.py \
485
	lib/utils/mlock.py \
486
	lib/utils/nodesetup.py \
487
	lib/utils/process.py \
488
	lib/utils/retry.py \
Helga Velroyen's avatar
Helga Velroyen committed
489
	lib/utils/storage.py \
490
	lib/utils/text.py \
491
	lib/utils/version.py \
492 493
	lib/utils/wrapper.py \
	lib/utils/x509.py
494

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

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

577 578 579 580
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
581
if ENABLE_MOND
582
HS_MYEXECLIB_PROGS=src/mon-collector
583 584 585
else
HS_MYEXECLIB_PROGS=
endif
586

587
# Haskell programs to be compiled by "make really-all"
588
HS_COMPILE_PROGS= \
589
	src/ganeti-mond \
590
	src/hconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
591
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
592
	src/hs2py \
593 594 595 596 597
	src/rpc-test

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

598
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
599
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
600

601 602 603 604
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
605 606
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
607
	test/hs/htest \
608
	$(HS_COMPILE_PROGS)
609

610 611
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

612
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
613
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
614

615
HFLAGS = \
616
	-O -Wall -isrc \
617 618 619
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)
620 621 622
if DEVELOPER_MODE
HFLAGS += -Werror
endif
623

624
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
625
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
626
# internal extra flags (used for test/hs/htest mainly)
627
HEXTRA_INT =
628 629
# combination of HEXTRA and HEXTRA_CONFIGURE
HEXTRA_COMBINED = $(HEXTRA) $(HEXTRA_CONFIGURE)
630
# exclude options for coverage reports
631
HPCEXCL = --exclude Main \
632
	--exclude Ganeti.Constants \
633
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
634
	--exclude Ganeti.THH \
635
	--exclude Ganeti.Version \
636
	--exclude Test.Ganeti.Attoparsec \
637
	--exclude Test.Ganeti.TestCommon \
638 639
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
640
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
641
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
642

643
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
644 645 646 647
	src/Ganeti/BasicTypes.hs \
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
648
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
649 650 651 652
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
653
	src/Ganeti/ConfigReader.hs \
654
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
655
	src/Ganeti/ConstantUtils.hs \
656 657
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
658
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
659 660
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
661
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
662
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
663
	src/Ganeti/DataCollectors/Drbd.hs \
664 665
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
666
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
667
	src/Ganeti/DataCollectors/Program.hs \
668
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
669 670 671 672 673 674 675 676 677 678 679 680 681 682
	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 \
683
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
684 685 686
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
687
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
688 689 690 691 692 693
	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 \
	src/Ganeti/HTools/Program/Hroller.hs \
694
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
695
	src/Ganeti/HTools/Types.hs \
696
	src/Ganeti/Hypervisor/Xen.hs \
697 698
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
699
	src/Ganeti/Hash.hs \
700
	src/Ganeti/Hs2Py/GenConstants.hs \
701
	src/Ganeti/Hs2Py/GenOpCodes.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
702
	src/Ganeti/Hs2Py/OpDoc.hs \
Iustin Pop's avatar
Iustin Pop committed
703 704 705 706 707
	src/Ganeti/JQueue.hs \
	src/Ganeti/JSON.hs \
	src/Ganeti/Jobs.hs \
	src/Ganeti/Logging.hs \
	src/Ganeti/Luxi.hs \
708
	src/Ganeti/Monitoring/Server.hs \
Iustin Pop's avatar
Iustin Pop committed
709 710 711 712 713
	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
714
	src/Ganeti/Parsers.hs \
715
	src/Ganeti/PyValueInstances.hs \
Thomas Thrainer's avatar
Thomas Thrainer committed
716
	src/Ganeti/Query/Cluster.hs \
Iustin Pop's avatar
Iustin Pop committed
717
	src/Ganeti/Query/Common.hs \
718
	src/Ganeti/Query/Export.hs \
Iustin Pop's avatar
Iustin Pop committed
719 720 721 722
	src/Ganeti/Query/Filter.hs \
	src/Ganeti/Query/Group.hs \
	src/Ganeti/Query/Job.hs \
	src/Ganeti/Query/Language.hs \
723
	src/Ganeti/Query/Network.hs \
Iustin Pop's avatar
Iustin Pop committed
724 725 726 727 728 729 730
	src/Ganeti/Query/Node.hs \
	src/Ganeti/Query/Query.hs \
	src/Ganeti/Query/Server.hs \
	src/Ganeti/Query/Types.hs \
	src/Ganeti/Rpc.hs \
	src/Ganeti/Runtime.hs \
	src/Ganeti/Ssconf.hs \
731 732 733 734
	src/Ganeti/Storage/Diskstats/Parser.hs \
	src/Ganeti/Storage/Diskstats/Types.hs \
	src/Ganeti/Storage/Drbd/Parser.hs \
	src/Ganeti/Storage/Drbd/Types.hs \
Michele Tartara's avatar
Michele Tartara committed
735 736
	src/Ganeti/Storage/Lvm/LVParser.hs \
	src/Ganeti/Storage/Lvm/Types.hs \
737
	src/Ganeti/Storage/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
738 739 740
	src/Ganeti/THH.hs \
	src/Ganeti/Types.hs \
	src/Ganeti/Utils.hs
741 742

HS_TEST_SRCS = \
743
	test/hs/Test/AutoConf.hs \
744 745 746 747 748
	test/hs/Test/Ganeti/Attoparsec.hs \
	test/hs/Test/Ganeti/BasicTypes.hs \
	test/hs/Test/Ganeti/Common.hs \
	test/hs/Test/Ganeti/Confd/Types.hs \
	test/hs/Test/Ganeti/Confd/Utils.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
749
	test/hs/Test/Ganeti/Constants.hs \