Makefile.am 74.6 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
pkgpythondir = $(versionedsharedir)/ganeti
76
pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub
77 78 79 80
gntpythondir = $(versionedsharedir)
pkgpython_bindir = $(versionedsharedir)
gnt_python_sbindir = $(versionedsharedir)
tools_pythondir = $(versionedsharedir)
81

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

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

113 114 115
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

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

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

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

201
ALL_APIDOC_HS_DIRS = \
202
	$(APIDOC_HS_DIR) \
203
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
204 205 206 207 208

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

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
217 218
	doc/html \
	doc/man-html
219 220 221 222

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

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

242
maintainer-clean-local:
243
	rm -rf $(BUILDTIME_DIRS)
244

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

Iustin Pop's avatar
Iustin Pop committed
287
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
288
	$(built_base_sources) \
289
	$(built_python_sources) \
290 291
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
292

293
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
294
if ENABLE_CONFD
295
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
296
endif
297 298 299
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
300

301
built_base_sources = \
302 303
	stamp-directories \
	stamp-srclinks
304

305
built_python_base_sources = \
306
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
307
	lib/_vcsversion.py \
308 309
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
310

311
built_python_sources = \
312 313
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
314

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

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

330 331 332
dist_ifup_SCRIPTS = \
	tools/kvm-ifup-os

333
nodist_pkgpython_PYTHON = \
334 335 336
	$(built_python_base_sources) \
	lib/_generated_rpc.py

337 338
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
339

340 341 342 343 344 345
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

346
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
347
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
348 349
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
350

351 352
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
353
	lib/asyncnotifier.py \
354 355 356
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
357
	lib/compat.py \
358 359
	lib/config.py \
	lib/constants.py \
360
	lib/daemon.py \
361
	lib/errors.py \
362
	lib/hooksmaster.py \
363
	lib/ht.py \
364
	lib/jqueue.py \
365
	lib/jstore.py \
366 367 368
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
369
	lib/netutils.py \
370
	lib/objects.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
371
	lib/opcodes_base.py \
372
	lib/outils.py \
373
	lib/ovf.py \
374
	lib/pathutils.py \
375
	lib/qlang.py \
376
	lib/query.py \
377
	lib/rpc_defs.py \
378
	lib/runtime.py \
379 380 381
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
382
	lib/uidpool.py \
383
	lib/vcluster.py \
384
	lib/network.py \
Petr Pudlak's avatar
Petr Pudlak committed
385
	lib/wconfd.py \
386
	lib/workerpool.py
387

388
client_PYTHON = \
389
	lib/client/__init__.py \
390
	lib/client/base.py \
391
	lib/client/gnt_backup.py \
392
	lib/client/gnt_cluster.py \
393
	lib/client/gnt_debug.py \
394
	lib/client/gnt_group.py \
395
	lib/client/gnt_instance.py \
396
	lib/client/gnt_job.py \
397
	lib/client/gnt_node.py \
398
	lib/client/gnt_network.py \
399 400
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
401

402
cmdlib_PYTHON = \
403
	lib/cmdlib/__init__.py \
404
	lib/cmdlib/backup.py \
405
	lib/cmdlib/base.py \
406
	lib/cmdlib/cluster.py \
407
	lib/cmdlib/common.py \
408
	lib/cmdlib/group.py \
409
	lib/cmdlib/instance.py \
410
	lib/cmdlib/instance_migration.py \
411
	lib/cmdlib/instance_operation.py \
412
	lib/cmdlib/instance_query.py \
413
	lib/cmdlib/instance_storage.py \
414
	lib/cmdlib/instance_utils.py \
415 416 417
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
418
	lib/cmdlib/operating_system.py \
419
	lib/cmdlib/query.py \
420
	lib/cmdlib/tags.py \
421
	lib/cmdlib/test.py
422

423 424 425
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
426
	lib/hypervisor/hv_chroot.py \
427
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
428
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
429
	lib/hypervisor/hv_lxc.py \
430 431
	lib/hypervisor/hv_xen.py

432 433 434 435
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
436
	lib/storage/container.py \
437 438
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
439
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
440 441
	lib/storage/filestorage.py \
	lib/storage/gluster.py
442

443 444
rapi_PYTHON = \
	lib/rapi/__init__.py \
445
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
446
	lib/rapi/client.py \
447
	lib/rapi/client_utils.py \
448
	lib/rapi/connector.py \
449 450
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
451

452
http_PYTHON = \
453
	lib/http/__init__.py \
454
	lib/http/auth.py \
455 456
	lib/http/client.py \
	lib/http/server.py
457

Guido Trotter's avatar
Guido Trotter committed
458
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
459
	lib/confd/__init__.py \
460
	lib/confd/client.py
461

Michael Hanselmann's avatar
Michael Hanselmann committed
462
masterd_PYTHON = \
463
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
464
	lib/masterd/iallocator.py \
465
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
466

467 468 469
impexpd_PYTHON = \
	lib/impexpd/__init__.py

470
watcher_PYTHON = \
471
	lib/watcher/__init__.py \
472 473
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
474

475
server_PYTHON = \
476
	lib/server/__init__.py \
477
	lib/server/masterd.py \
478 479
	lib/server/noded.py \
	lib/server/rapi.py
480

481 482
rpc_PYTHON = \
	lib/rpc/__init__.py \
483
	lib/rpc/client.py \
484 485 486
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
487

488 489 490
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

491 492
pytools_PYTHON = \
	lib/tools/__init__.py \
493
	lib/tools/burnin.py \
494
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
495
	lib/tools/node_cleanup.py \
496
	lib/tools/node_daemon_setup.py \
497
	lib/tools/prepare_node_join.py
498

499
utils_PYTHON = \
500
	lib/utils/__init__.py \
501
	lib/utils/algo.py \
502
	lib/utils/filelock.py \
503
	lib/utils/hash.py \
504
	lib/utils/io.py \
505
	lib/utils/log.py \
506
	lib/utils/lvm.py \
507
	lib/utils/mlock.py \
508
	lib/utils/nodesetup.py \
509
	lib/utils/process.py \
510
	lib/utils/retry.py \
511
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
512
	lib/utils/storage.py \
513
	lib/utils/text.py \
514
	lib/utils/version.py \
515 516
	lib/utils/wrapper.py \
	lib/utils/x509.py
517

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

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

604 605 606 607
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
608
if ENABLE_MOND
609
HS_MYEXECLIB_PROGS=src/mon-collector
610 611 612
else
HS_MYEXECLIB_PROGS=
endif
613

614
# Haskell programs to be compiled by "make really-all"
615
HS_COMPILE_PROGS= \
Jose A. Lopes's avatar
Jose A. Lopes committed
616
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
617
	src/ganeti-metad \
618
	src/ganeti-mond \
619
	src/hconfd \
Petr Pudlak's avatar
Petr Pudlak committed
620
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
621
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
622
	src/hs2py \
623 624 625 626 627
	src/rpc-test

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

628
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
629
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
630

631 632 633 634
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
635 636
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
637
	test/hs/htest \
638
	$(HS_COMPILE_PROGS)
639

640 641
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

642
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
643
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
644

645
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
646
	-O -Wall -Werror -isrc \
647 648 649 650
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

651
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
652
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
653
# internal extra flags (used for test/hs/htest mainly)
654
HEXTRA_INT =
655
# exclude options for coverage reports
656
HPCEXCL = --exclude Main \
657
	--exclude Ganeti.Constants \
658
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
659
	--exclude Ganeti.THH \
660
	--exclude Ganeti.Version \
661
	--exclude Test.Ganeti.Attoparsec \
662
	--exclude Test.Ganeti.TestCommon \
663 664
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
665
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
666
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
667

668
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
669 670 671 672
	src/Ganeti/BasicTypes.hs \
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
673
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
674 675 676 677
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
678
	src/Ganeti/ConfigReader.hs \
679
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
680
	src/Ganeti/ConstantUtils.hs \
681 682
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
683
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
684 685
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
686
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
687
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
688
	src/Ganeti/DataCollectors/Drbd.hs \
689 690
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
691
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
692
	src/Ganeti/DataCollectors/Program.hs \
693
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
694 695 696 697 698 699 700 701 702 703 704 705 706 707
	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 \
708
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
709 710 711
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
712
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
713 714 715 716 717
	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 \
718
	src/Ganeti/HTools/Program/Hsqueeze.hs \
Iustin Pop's avatar
Iustin Pop committed
719
	src/Ganeti/HTools/Program/Hroller.hs \
720
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
721
	src/Ganeti/HTools/Types.hs \
722
	src/Ganeti/Hypervisor/Xen.hs \
723 724
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \