Makefile.am 74 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 \
Petr Pudlak's avatar
Petr Pudlak committed
134
	src/Ganeti/WConfd \
135 136 137
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
138 139 140
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
141
	test/hs/Test/Ganeti/Storage/Lvm \
142 143 144
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
145 146
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
Petr Pudlak's avatar
Petr Pudlak committed
147 148
	test/hs/Test/Ganeti/Query \
	test/hs/Test/Ganeti/THH
149

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

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

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

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

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

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

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

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

241
CLEANFILES = \
242
	$(addsuffix /*.py[co],$(DIRS)) \
243 244
	$(addsuffix /*.hi,$(HS_DIRS)) \
	$(addsuffix /*.o,$(HS_DIRS)) \
245
	$(PYTHON_BOOTSTRAP) \
246
	$(gnt_python_sbin_SCRIPTS) \
247
	epydoc.conf \
Iustin Pop's avatar
Iustin Pop committed
248
	$(REPLACE_VARS_SED) \
249
	$(SHELL_ENV_INIT) \
250
	daemons/daemon-util \
251
	daemons/ganeti-cleaner \
252 253
	devel/squeeze-amd64.tar.gz \
	devel/squeeze-amd64.conf \
254 255
	$(mandocrst) \
	doc/manpages-enabled.rst \
256
	$(BUILT_EXAMPLES) \
257
	doc/examples/bash_completion \
258
	doc/examples/bash_completion-debug \
259
	$(userspecs) \
260
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
261 262
	$(man_MANS) \
	$(manhtml) \
263
	tools/kvm-ifup \
264
	tools/kvm-ifup-os \
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 \
Petr Pudlak's avatar
Petr Pudlak committed
276
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
277
	src/ganeti-luxid \
278
	src/ganeti-mond \
279
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
280
	doc/hs-lint.html
281

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

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

296
built_base_sources = \
297 298
	stamp-directories \
	stamp-srclinks
299

300
built_python_base_sources = \
301
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
302 303
	lib/_vcsversion.py \
	lib/opcodes.py
304 305 306

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
307
	lib/_generated_rpc.py
308

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

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

324 325 326
dist_ifup_SCRIPTS = \
	tools/kvm-ifup-os

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_defs.py \
368
	lib/runtime.py \
369 370 371
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
372
	lib/uidpool.py \
373
	lib/vcluster.py \
374
	lib/network.py \
375
	lib/workerpool.py
376

377
client_PYTHON = \
378
	lib/client/__init__.py \
379
	lib/client/base.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
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
429 430
	lib/storage/filestorage.py \
	lib/storage/gluster.py
431

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

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

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

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

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

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

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

470 471
rpc_PYTHON = \
	lib/rpc/__init__.py \
472
	lib/rpc/client.py \
473 474 475
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
476

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

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

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

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

590 591 592 593
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

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

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

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

614
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
615
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
616

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

626 627
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

628
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
629
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
630

631
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
632
	-O -Wall -Werror -isrc \
633 634 635 636
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

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

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