Makefile.am 84.7 KB
Newer Older
1 2 3 4 5
# Ganeti makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable (see hypervisor).
# - All directories must be listed DIRS.
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
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
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
hypervisor_hv_kvmdir = $(pkgpythondir)/hypervisor/hv_kvm
86
jqueuedir = $(pkgpythondir)/jqueue
87
storagedir = $(pkgpythondir)/storage
88
httpdir = $(pkgpythondir)/http
89
masterddir = $(pkgpythondir)/masterd
90
confddir = $(pkgpythondir)/confd
91
rapidir = $(pkgpythondir)/rapi
92
rpcdir = $(pkgpythondir)/rpc
93
rpc_stubdir = $(pkgpythondir)/rpc/stub
94
serverdir = $(pkgpythondir)/server
95
watcherdir = $(pkgpythondir)/watcher
96
impexpddir = $(pkgpythondir)/impexpd
97
utilsdir = $(pkgpythondir)/utils
98
toolsdir = $(pkglibdir)/tools
99
iallocatorsdir = $(pkglibdir)/iallocators
100
pytoolsdir = $(pkgpythondir)/tools
101
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
102
ifupdir = $(sysconfdir)/ganeti
103

104 105 106 107 108 109
if USE_BACKUP_DIR
backup_dir = $(BACKUP_DIR)
else
backup_dir = $(localstatedir)/lib
endif

110
SYMLINK_TARGET_DIRS = \
111
	$(sysconfdir)/ganeti \
112
	$(libdir)/ganeti/iallocators \
113 114
	$(libdir)/ganeti/tools \
	$(prefix)/share/ganeti \
Jose A. Lopes's avatar
Jose A. Lopes committed
115 116 117 118 119
	$(BINDIR) \
	$(SBINDIR) \
	$(MANDIR)/man1 \
	$(MANDIR)/man7 \
	$(MANDIR)/man8
120

121 122 123
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

124
HS_DIRS = \
Iustin Pop's avatar
Iustin Pop committed
125 126 127
	src \
	src/Ganeti \
	src/Ganeti/Confd \
128
	src/Ganeti/Curl \
129
	src/Ganeti/Cpu \
Iustin Pop's avatar
Iustin Pop committed
130
	src/Ganeti/DataCollectors \
131
	src/Ganeti/Daemon \
132
	src/Ganeti/Hs2Py \
Iustin Pop's avatar
Iustin Pop committed
133 134 135
	src/Ganeti/HTools \
	src/Ganeti/HTools/Backend \
	src/Ganeti/HTools/Program \
136 137
	src/Ganeti/Hypervisor \
	src/Ganeti/Hypervisor/Xen \
138
	src/Ganeti/JQueue \
139
	src/Ganeti/Locking \
140
	src/Ganeti/Logging \
141
	src/Ganeti/Monitoring \
142
	src/Ganeti/Metad \
143
	src/Ganeti/Objects \
Klaus Aehlig's avatar
Klaus Aehlig committed
144
	src/Ganeti/OpCodes \
Iustin Pop's avatar
Iustin Pop committed
145
	src/Ganeti/Query \
146 147 148
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
149
	src/Ganeti/Storage/Lvm \
150
	src/Ganeti/THH \
151
	src/Ganeti/Utils \
152
	src/Ganeti/WConfd \
153 154 155
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
156 157 158
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
159
	test/hs/Test/Ganeti/Storage/Lvm \
160 161 162
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
163 164
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
165
	test/hs/Test/Ganeti/Locking \
166
	test/hs/Test/Ganeti/Objects \
167
	test/hs/Test/Ganeti/Query \
168
	test/hs/Test/Ganeti/THH \
169 170
	test/hs/Test/Ganeti/Utils \
	test/hs/Test/Ganeti/WConfd
171

172 173 174
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

175
DIRS = \
176
	$(HS_DIRS) \
177 178 179
	autotools \
	daemons \
	devel \
180
	devel/data \
181
	doc \
182
	doc/css \
183
	doc/examples \
184
	doc/examples/gnt-debug \
185
	doc/examples/hooks \
186
	doc/examples/systemd \
187
	doc/users \
188 189 190
	test/data/htools \
	test/data/htools/rapi \
	test/hs/shelltests \
191
	test/autotools \
192
	lib \
193
	lib/build \
194
	lib/client \
195
	lib/cmdlib \
196
	lib/confd \
197
	lib/jqueue \
198
	lib/http \
199
	lib/hypervisor \
200
	lib/hypervisor/hv_kvm \
201
	lib/impexpd \
202
	lib/masterd \
203
	lib/rapi \
204
	lib/rpc \
205
	lib/rpc/stub \
206
	lib/server \
207
	lib/storage \
208
	lib/tools \
209
	lib/utils \
210
	lib/watcher \
211 212
	man \
	qa \
213
	qa/patch \
214 215
	test \
	test/data \
216
	test/data/bdev-rbd \
Agata Murawska's avatar
Agata Murawska committed
217
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
218
	test/data/ovfdata/other \
219
	test/py \
220 221
	test/py/cmdlib \
	test/py/cmdlib/testsupport \
222 223
	tools

224
ALL_APIDOC_HS_DIRS = \
225
	$(APIDOC_HS_DIR) \
226
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
227 228 229 230 231

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
232
	$(APIDOC_PY_DIR) \
233 234
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
235
	$(COVERAGE_PY_DIR) \
236
	.hpc
237 238 239

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
240 241
	doc/html \
	doc/man-html
242 243 244 245

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
246
	doc/html/_* \
247
	doc/man-html/_* \
248
	tools/shebang \
Iustin Pop's avatar
Iustin Pop committed
249
	autom4te.cache
250

251 252 253 254 255 256 257 258
# 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

259
MAINTAINERCLEANFILES = \
260
	$(maninput) \
261
	doc/install-quick.rst \
262
	doc/news.rst \
263
	doc/upgrade.rst \
264
	vcs-version
265

266
maintainer-clean-local:
267
	rm -rf $(BUILDTIME_DIRS)
268

269
CLEANFILES = \
270
	$(addsuffix /*.py[co],$(DIRS)) \
271 272
	$(addsuffix /*.hi,$(HS_DIRS)) \
	$(addsuffix /*.o,$(HS_DIRS)) \
273 274
	$(addsuffix /*.$(HTEST_SUFFIX)_hi,$(HS_DIRS)) \
	$(addsuffix /*.$(HTEST_SUFFIX)_o,$(HS_DIRS)) \
275
	hs-pkg-versions \
276 277
	Makefile.ghc \
	Makefile.ghc.bak \
278
	$(PYTHON_BOOTSTRAP) \
279
	$(gnt_python_sbin_SCRIPTS) \
280
	epydoc.conf \
281
	$(REPLACE_VARS_SED) \
282
	$(SHELL_ENV_INIT) \
283
	daemons/daemon-util \
284
	daemons/ganeti-cleaner \
285 286
	devel/squeeze-amd64.tar.gz \
	devel/squeeze-amd64.conf \
287 288
	$(mandocrst) \
	doc/manpages-enabled.rst \
289
	$(BUILT_EXAMPLES) \
290
	doc/examples/bash_completion \
291
	doc/examples/bash_completion-debug \
292
	$(userspecs) \
293
	lib/_generated_rpc.py \
294 295
	$(man_MANS) \
	$(manhtml) \
296
	tools/kvm-ifup \
297
	tools/kvm-ifup-os \
298
	tools/xen-ifup-os \
299
	tools/vif-ganeti \
300
	tools/vif-ganeti-metad \
301
	tools/net-common \
302
	tools/users-setup \
303
	tools/vcluster-setup \
304
	$(python_scripts_shebang) \
305
	stamp-directories \
306
	stamp-srclinks \
307
	$(nodist_pkgpython_PYTHON) \
308
	$(nodist_pkgpython_rpc_stub_PYTHON) \
309
	$(gnt_scripts) \
310
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
311
	$(HS_BUILT_TEST_HELPERS) \
Iustin Pop's avatar
Iustin Pop committed
312
	src/ganeti-confd \
313
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
314
	src/ganeti-luxid \
315
	src/ganeti-metad \
316
	src/ganeti-mond \
317
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
318
	doc/hs-lint.html
319

Iustin Pop's avatar
Iustin Pop committed
320
GENERATED_FILES = \
321
	$(built_base_sources) \
322
	$(built_python_sources) \
323 324
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
325

326 327 328
clean-local:
	rm -rf tools/shebang

329
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
330
if ENABLE_CONFD
331
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
332
endif
333 334 335
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
336 337 338
if ENABLE_METADATA
HS_GENERATED_FILES += src/ganeti-metad
endif
339

340
built_base_sources = \
341 342
	stamp-directories \
	stamp-srclinks
343

344
built_python_base_sources = \
345
	lib/_constants.py \
346
	lib/_vcsversion.py \
347 348
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
349

350
built_python_sources = \
351 352
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
353

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

358 359 360 361 362
# 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 \
363
	doc/examples/ganeti.logrotate \
364
	doc/examples/ganeti-master-role.ocf \
365
	doc/examples/ganeti-node-role.ocf \
366
	doc/examples/gnt-config-backup \
367 368 369 370 371 372 373 374 375 376
	doc/examples/hooks/ipsec \
	doc/examples/systemd/ganeti-common.service \
	doc/examples/systemd/ganeti-confd.service \
	doc/examples/systemd/ganeti-kvmd.service \
	doc/examples/systemd/ganeti-luxid.service \
	doc/examples/systemd/ganeti-metad.service \
	doc/examples/systemd/ganeti-mond.service \
	doc/examples/systemd/ganeti-noded.service \
	doc/examples/systemd/ganeti-rapi.service \
	doc/examples/systemd/ganeti-wconfd.service
377

378
dist_ifup_SCRIPTS = \
379 380
	tools/kvm-ifup-os \
	tools/xen-ifup-os
381

382
nodist_pkgpython_PYTHON = \
383 384 385
	$(built_python_base_sources) \
	lib/_generated_rpc.py

386 387
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
388

389 390 391 392 393 394
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

395
noinst_PYTHON = \
396
	lib/build/__init__.py \
397 398
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
399

400 401
pkgpython_PYTHON = \
	lib/__init__.py \
402
	lib/asyncnotifier.py \
403 404 405
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
406
	lib/compat.py \
407 408
	lib/config.py \
	lib/constants.py \
409
	lib/daemon.py \
410
	lib/errors.py \
411
	lib/hooksmaster.py \
412
	lib/ht.py \
413
	lib/jstore.py \
414 415 416
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
417
	lib/netutils.py \
418
	lib/objects.py \
419
	lib/opcodes_base.py \
420
	lib/outils.py \
421
	lib/ovf.py \
422
	lib/pathutils.py \
423
	lib/qlang.py \
424
	lib/query.py \
425
	lib/rpc_defs.py \
426
	lib/runtime.py \
427 428 429
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
430
	lib/uidpool.py \
431
	lib/vcluster.py \
432
	lib/network.py \
433
	lib/wconfd.py \
434
	lib/workerpool.py
435

436
client_PYTHON = \
437
	lib/client/__init__.py \
438
	lib/client/base.py \
439
	lib/client/gnt_backup.py \
440
	lib/client/gnt_cluster.py \
441
	lib/client/gnt_debug.py \
442
	lib/client/gnt_group.py \
443
	lib/client/gnt_instance.py \
444
	lib/client/gnt_job.py \
445
	lib/client/gnt_node.py \
446
	lib/client/gnt_network.py \
447 448
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
449

450
cmdlib_PYTHON = \
451
	lib/cmdlib/__init__.py \
452
	lib/cmdlib/backup.py \
453
	lib/cmdlib/base.py \
454
	lib/cmdlib/cluster.py \
455
	lib/cmdlib/common.py \
456
	lib/cmdlib/group.py \
457
	lib/cmdlib/instance.py \
458
	lib/cmdlib/instance_migration.py \
459
	lib/cmdlib/instance_operation.py \
460
	lib/cmdlib/instance_query.py \
461
	lib/cmdlib/instance_storage.py \
462
	lib/cmdlib/instance_utils.py \
463 464 465
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
466
	lib/cmdlib/operating_system.py \
467
	lib/cmdlib/query.py \
468
	lib/cmdlib/tags.py \
469
	lib/cmdlib/test.py
470

471 472 473
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
474
	lib/hypervisor/hv_chroot.py \
475
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
476
	lib/hypervisor/hv_lxc.py \
477 478
	lib/hypervisor/hv_xen.py

479
hypervisor_hv_kvm_PYTHON = \
480
  lib/hypervisor/hv_kvm/__init__.py \
481 482
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
483

484
jqueue_PYTHON = \
485 486
	lib/jqueue/__init__.py \
	lib/jqueue/exec.py
487

488 489 490 491
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
492
	lib/storage/container.py \
493 494
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
495
	lib/storage/drbd_cmdgen.py \
496 497
	lib/storage/filestorage.py \
	lib/storage/gluster.py
498

499 500
rapi_PYTHON = \
	lib/rapi/__init__.py \
501
	lib/rapi/baserlib.py \
502
	lib/rapi/client.py \
503
	lib/rapi/client_utils.py \
504
	lib/rapi/connector.py \
505 506
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
507

508
http_PYTHON = \
509
	lib/http/__init__.py \
510
	lib/http/auth.py \
511 512
	lib/http/client.py \
	lib/http/server.py
513

514
confd_PYTHON = \
515
	lib/confd/__init__.py \
516
	lib/confd/client.py
517

518
masterd_PYTHON = \
519
	lib/masterd/__init__.py \
520
	lib/masterd/iallocator.py \
521
	lib/masterd/instance.py
522

523 524 525
impexpd_PYTHON = \
	lib/impexpd/__init__.py

526
watcher_PYTHON = \
527
	lib/watcher/__init__.py \
528 529
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
530

531
server_PYTHON = \
532
	lib/server/__init__.py \
533
	lib/server/masterd.py \
534 535
	lib/server/noded.py \
	lib/server/rapi.py
536

537 538
rpc_PYTHON = \
	lib/rpc/__init__.py \
539
	lib/rpc/client.py \
540 541 542
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
543

544 545 546
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

547 548
pytools_PYTHON = \
	lib/tools/__init__.py \
549
	lib/tools/burnin.py \
550
	lib/tools/ensure_dirs.py \
551
	lib/tools/node_cleanup.py \
552
	lib/tools/node_daemon_setup.py \
553
	lib/tools/prepare_node_join.py
554

555
utils_PYTHON = \
556
	lib/utils/__init__.py \
557
	lib/utils/algo.py \
558
	lib/utils/filelock.py \
559
	lib/utils/hash.py \
560
	lib/utils/io.py \
561
	lib/utils/livelock.py \
562
	lib/utils/log.py \
563
	lib/utils/lvm.py \
564
	lib/utils/mlock.py \
565
	lib/utils/nodesetup.py \
566
	lib/utils/process.py \
567
	lib/utils/retry.py \
568
	lib/utils/security.py \
569
	lib/utils/storage.py \
570
	lib/utils/text.py \
571
	lib/utils/version.py \
572 573
	lib/utils/wrapper.py \
	lib/utils/x509.py
574

575
docinput = \
576
	doc/admin.rst \
577
	doc/cluster-keys-replacement.rst \
578
	doc/cluster-merge.rst \
579 580
	doc/conf.py \
	doc/css/style.css \
581
	doc/design-2.0.rst \
582
	doc/design-2.1.rst \
583
	doc/design-2.2.rst \
584
	doc/design-2.3.rst \
585
	doc/design-2.4.rst \
586
	doc/design-2.5.rst \
587
	doc/design-2.6.rst \
588
	doc/design-2.7.rst \
589
	doc/design-2.8.rst \
590
	doc/design-2.9.rst \
591
	doc/design-2.10.rst \
592
	doc/design-2.11.rst \
593
	doc/design-2.12.rst \
594 595
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
596
	doc/design-ceph-ganeti-support.rst \
597
	doc/design-chained-jobs.rst \
598
	doc/design-cmdlib-unittests.rst \
599
	doc/design-cpu-pinning.rst \
600
	doc/design-cpu-speed.rst \
601
	doc/design-daemons.rst \
602
	doc/design-device-uuid-name.rst \
603
	doc/design-disks.rst \
604
	doc/design-draft.rst \
605
	doc/design-file-based-storage.rst \
606
	doc/design-glusterfs-ganeti-support.rst \
607 608 609
	doc/design-hotplug.rst \
	doc/design-hroller.rst \
	doc/design-hsqueeze.rst \
610
	doc/design-htools-2.3.rst \
611
	doc/design-http-server.rst \
612
	doc/design-hugepages-support.rst \
613
	doc/design-impexp2.rst \
614
	doc/design-internal-shutdown.rst \
615
	doc/design-kvmd.rst \
616
	doc/design-linuxha.rst \
617 618
	doc/design-lu-generated-jobs.rst \
	doc/design-monitoring-agent.rst \
619
	doc/design-move-instance-improvements.rst \
620
	doc/design-multi-reloc.rst \
621
	doc/design-multi-version-tests.rst \
622
	doc/design-network.rst \
623
	doc/design-node-add.rst \
624
	doc/design-node-security.rst \
625
	doc/design-oob.rst \
626
	doc/design-openvswitch.rst \
627
	doc/design-opportunistic-locking.rst \
628
	doc/design-optables.rst \
629
	doc/design-os.rst \
630
	doc/design-ovf-support.rst \
631
	doc/design-partitioned.rst \
632
	doc/design-performance-tests.rst \
633 634
	doc/design-query-splitting.rst \
	doc/design-query2.rst \
635
	doc/design-query-splitting.rst \
636
	doc/design-reason-trail.rst \
637
	doc/design-resource-model.rst \
638
	doc/design-restricted-commands.rst \
639
	doc/design-shared-storage.rst \
640
	doc/design-ssh-ports.rst \
641
	doc/design-storagetypes.rst \
642
	doc/design-systemd.rst \
643
	doc/design-upgrade.rst \
644
	doc/design-virtual-clusters.rst \
645
	doc/design-x509-ca.rst \
646
	doc/dev-codestyle.rst \
647
	doc/devnotes.rst \
648
	doc/glossary.rst \
649
	doc/hooks.rst \
650
	doc/iallocator.rst \
651
	doc/index.rst \
652
	doc/install-quick.rst \
653
	doc/install.rst \
654
	doc/locking.rst \
655
	doc/manpages-disabled.rst \
656
	doc/monitoring-query-format.rst \
657
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
658
	doc/news.rst \
659
	doc/ovfconverter.rst \
660
	doc/rapi.rst \
661
	doc/security.rst \
662
	doc/upgrade.rst \
663
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
664
	doc/walkthrough.rst
665

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

669 670 671 672
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
673
if ENABLE_MOND
674
HS_MYEXECLIB_PROGS=src/mon-collector
675 676 677
else
HS_MYEXECLIB_PROGS=
endif
678

679
# Haskell programs to be compiled by "make really-all"
680
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
681
	src/ganeti-kvmd \
682
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
683
	src/hluxid \
684
	src/hs2py \
685
	src/rpc-test
686 687 688 689 690 691
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
692 693 694
if ENABLE_METADATA
HS_COMPILE_PROGS += src/ganeti-metad
endif
695 696 697 698

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

699
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
700
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
701

702 703 704 705
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
706 707
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
708
	test/hs/htest \
709
	$(HS_COMPILE_PROGS)
710

711 712
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

713 714 715
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

716
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
717
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
718

719
HFLAGS = \
720
	-O -Wall -isrc \
721 722 723
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)
724 725 726
if DEVELOPER_MODE
HFLAGS += -Werror
endif
727

728 729 730
HTEST_SUFFIX = hpc
HPROF_SUFFIX = prof

731 732 733 734 735 736 737 738 739 740 741
DEP_SUFFIXES =
if GHC_LE_76
DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX) -dep-suffix $(HTEST_SUFFIX)
else
# GHC >= 7.8 stopped putting underscores into -dep-suffix by itself
# (https://ghc.haskell.org/trac/ghc/ticket/9749) so we have to put them.
# It also needs -dep-suffix "" for the .o file.
DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX)_ -dep-suffix $(HTEST_SUFFIX)_ \
	-dep-suffix ""
endif

742
# GHC > 7.6 needs -dynamic-too when using Template Haskell since its
743
# ghci is switched to loading dynamic libraries by default.
744 745 746 747 748
# It must only be used in non-profiling GHC invocations.
# We also don't use it in compilations that use HTEST_SUFFIX (which are
# compiled with -fhpc) because HPC coverage doesn't interact well with
# GHCI shared lib loading (https://ghc.haskell.org/trac/ghc/ticket/9762).
HFLAGS_DYNAMIC =
749
if !GHC_LE_76
750
HFLAGS_DYNAMIC += -dynamic-too
751 752
endif

753
if HPROFILE
754 755
HPROFFLAGS = -prof -fprof-auto-top -osuf $(HPROF_SUFFIX)_o \
	-hisuf $(HPROF_SUFFIX)_hi -rtsopts
756 757 758 759 760 761 762 763 764
endif
if HCOVERAGE
HFLAGS += -fhpc
endif
if HTEST
HFLAGS += -DTEST
endif

HTEST_FLAGS = $(HFLAGS) -fhpc -itest/hs \
765 766
	-osuf $(HTEST_SUFFIX)_o \
	-hisuf $(HTEST_SUFFIX)_hi
767

768
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
769
HEXTRA =
770
# internal extra flags (used for test/hs/htest mainly)
771
HEXTRA_INT =
772 773
# combination of HEXTRA and HEXTRA_CONFIGURE
HEXTRA_COMBINED = $(HEXTRA) $(HEXTRA_CONFIGURE)
774
# exclude options for coverage reports
775
HPCEXCL = --exclude Main \
776
	--exclude Ganeti.Constants \
777
	--exclude Ganeti.HTools.QC \
778
	--exclude Ganeti.THH \
779
	--exclude Ganeti.Version \
780
	--exclude Test.Ganeti.Attoparsec \
781
	--exclude Test.Ganeti.TestCommon \
782 783
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
784
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
785
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
786

787
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
788
	src/Ganeti/BasicTypes.hs \
789
	src/Ganeti/Codec.hs \
Iustin Pop's avatar
Iustin Pop committed
790 791 792
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
793
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
794 795 796 797
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
798
	src/Ganeti/ConfigReader.hs \
799
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
800
	src/Ganeti/ConstantUtils.hs \
801 802
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
803
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
804
	src/Ganeti/Daemon.hs \
805
	src/Ganeti/Daemon/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
806
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
807
	src/Ganeti/DataCollectors/CPUload.hs \
808
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
809
	src/Ganeti/DataCollectors/Drbd.hs \
810 811
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
812
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
813
	src/Ganeti/DataCollectors/Program.hs \
814
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
815 816 817 818 819 820 821 822 823 824 825 826 827 828
	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 \
829
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
830 831 832
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
833
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
834 835 836 837 838
	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 \
839
	src/Ganeti/HTools/Program/Hsqueeze.hs \
Iustin Pop's avatar
Iustin Pop committed
840
	src/Ganeti/HTools/Program/Hroller.hs \
841
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
842
	src/Ganeti/HTools/Types.hs \
843
	src/Ganeti/Hypervisor/Xen.hs \
844 845
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
846
	src/Ganeti/Hash.hs \
847
	src/Ganeti/Hs2Py/GenConstants.hs \
848
	src/Ganeti/Hs2Py/GenOpCodes.hs \
849
	src/Ganeti/Hs2Py/OpDoc.hs \
Iustin Pop's avatar
Iustin Pop committed
850
	src/Ganeti/JQueue.hs \
851
	src/Ganeti/JQueue/Lens.hs \
852
	src/Ganeti/JQueue/Objects.hs \
853
	src/Ganeti/JQScheduler.hs \
Iustin Pop's avatar
Iustin Pop committed
854 855
	src/Ganeti/JSON.hs \
	src/Ganeti/Jobs.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
856
	src/Ganeti/Kvmd.hs \
857
	src/Ganeti/Lens.hs \
858 859 860
	src/Ganeti/Locking/Allocation.hs \
	src/Ganeti/Locking/Types.hs \
	src/Ganeti/Locking/Locks.hs \
861
	src/Ganeti/Locking/Waiting.hs \
Iustin Pop's avatar
Iustin Pop committed
862
	src/Ganeti/Logging.hs \
863
	src/Ganeti/Logging/Lifted.hs \
864
	src/Ganeti/Logging/WriterLog.hs \
Iustin Pop's avatar
Iustin Pop committed
865
	src/Ganeti/Luxi.hs \
866
	src/Ganeti/Metad/Config.hs \
867
	src/Ganeti/Metad/ConfigServer.hs \
868
	src/Ganeti/Metad/Server.hs \
869
	src/Ganeti/Metad/Types.hs \
870
	src/Ganeti/Metad/WebServer.hs \
871
	src/Ganeti/Monitoring/Server.hs \
Iustin Pop's avatar
Iustin Pop committed
872 873
	src/Ganeti/Network.hs \
	src/Ganeti/Objects.hs \
874
	src/Ganeti/Objects/BitArray.hs \
875
	src/Ganeti/Objects/Lens.hs \
Iustin Pop's avatar
Iustin Pop committed
876
	src/Ganeti/OpCodes.hs \
Klaus Aehlig's avatar
Klaus Aehlig committed
877
	src/Ganeti/OpCodes/Lens.hs \
Iustin Pop's avatar
Iustin Pop committed
878 879
	src/Ganeti/OpParams.hs \
	src/Ganeti/Path.hs \
880
	src/Ganeti/Parsers.hs \
881
	src/Ganeti/PyValue.hs \
882
	src/Ganeti/Query/Cluster.hs \
Iustin Pop's avatar
Iustin Pop committed
883
	src/Ganeti/Query/Common.hs \
884
	src/Ganeti/Query/Exec.hs \
885
	src/Ganeti/Query/Export.hs \
Iustin Pop's avatar
Iustin Pop committed
886 887
	src/Ganeti/Query/Filter.hs \
	src/Ganeti/Query/Group.hs \
888
	src/Ganeti/Query/Instance.hs \
Iustin Pop's avatar
Iustin Pop committed
889 890
	src/Ganeti/Query/Job.hs \
	src/Ganeti/Query/Language.hs \
891
	src/Ganeti/Query/Locks.hs \
892
	src/Ganeti/Query/Network.hs \
Iustin Pop's avatar
Iustin Pop committed
893 894 895 896 897 898 899
	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 \
900 901 902 903
	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
904 905
	src/Ganeti/Storage/Lvm/LVParser.hs \
	src/Ganeti/Storage/Lvm/Types.hs \
906
	src/Ganeti/Storage/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
907
	src/Ganeti/THH.hs \
908
	src/Ganeti/THH/Field.hs \
909
	src/Ganeti/THH/HsRPC.hs \
910
	src/Ganeti/THH/PyRPC.hs \
911
	src/Ganeti/THH/PyType.hs \
912
	src/Ganeti/THH/Types.hs \
Petr Pudlak's avatar
Petr Pudlak committed
913
	src/Ganeti/THH/RPC.hs \
Iustin Pop's avatar
Iustin Pop committed
914
	src/Ganeti/Types.hs \
915
	src/Ganeti/UDSServer.hs \
916
	src/Ganeti/Utils.hs \
917
	src/Ganeti/Utils/Atomic.hs \
918
	src/Ganeti/Utils/AsyncWorker.hs \
919
	src/Ganeti/Utils/IORef.hs \
920
	src/Ganeti/Utils/Livelock.hs \
921
	src/Ganeti/Utils/MonadPlus.hs \
922
	src/Ganeti/Utils/MultiMap.hs \
923
	src/Ganeti/Utils/MVarLock.hs \
924
	src/Ganeti/Utils/Random.hs \
925
	src/Ganeti/Utils/Statistics.hs \
926
	src/Ganeti/Utils/UniStd.hs \
Petr Pudlak's avatar
Petr Pudlak committed
927
	src/Ganeti/Utils/Validate.hs \
928 929
	src/Ganeti/VCluster.hs \
	src/Ganeti/WConfd/ConfigState.hs \
930
	src/Ganeti/WConfd/ConfigVerify.hs \
931
	src/Ganeti/WConfd/ConfigWriter.hs \
Petr Pudlak's avatar
Petr Pudlak committed
932
	src/Ganeti/WConfd/Client.hs \
933
	src/Ganeti/WConfd/Core.hs \
934
	src/Ganeti/WConfd/DeathDetection.hs \
935
	src/Ganeti/WConfd/Language.hs \
936
	src/Ganeti/WConfd/Monad.hs \
937
	src/Ganeti/WConfd/Persistent.hs \
938
	src/Ganeti/WConfd/Server.hs \
939 940
	src/Ganeti/WConfd/Ssconf.hs \
	src/Ganeti/WConfd/TempRes.hs
941 942

HS_TEST_SRCS = \
943
	test/hs/Test/AutoConf.hs \
944 945 946 947 948
	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 \
949
	test/hs/Test/Ganeti/Constants.hs \
950 951 952 953 954 955 956
	test/hs/Test/Ganeti/Daemon.hs \
	test/hs/Test/Ganeti/Errors.hs \
	test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
	test/hs/Test/Ganeti/HTools/Backend/Text.hs \
	test/hs/Test/Ganeti/HTools/CLI.hs \
	test/hs/Test/Ganeti/HTools/Cluster.hs \
	test/hs/Test/Ganeti/HTools/Container.hs \
957
	test/hs/Test/Ganeti/HTools/ExtLoader.hs \
958 959 960 961 962 963
	test/hs/Test/Ganeti/HTools/Graph.hs \
	test/hs/Test/Ganeti/HTools/Instance.hs \
	test/hs/Test/Ganeti/HTools/Loader.hs \
	test/hs/Test/Ganeti/HTools/Node.hs \
	test/hs/Test/Ganeti/HTools/PeerMap.hs \
	test/hs/Test/Ganeti/HTools/Types.hs \
964
	test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
965 966 967
	test/hs/Test/Ganeti/JSON.hs \
	test/hs/Test/Ganeti/Jobs.hs \
	test/hs/Test/Ganeti/JQueue.hs \