Makefile.am 75.9 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/Logging \
131
	src/Ganeti/Monitoring \
132
	src/Ganeti/Objects \
Iustin Pop's avatar
Iustin Pop committed
133
	src/Ganeti/Query \
134 135 136
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
137
	src/Ganeti/Storage/Lvm \
138
	src/Ganeti/THH \
139
	src/Ganeti/Utils \
Petr Pudlak's avatar
Petr Pudlak committed
140
	src/Ganeti/WConfd \
141 142 143
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
144 145 146
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
147
	test/hs/Test/Ganeti/Storage/Lvm \
148 149 150
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
151 152
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
153
	test/hs/Test/Ganeti/Locking \
Petr Pudlak's avatar
Petr Pudlak committed
154 155
	test/hs/Test/Ganeti/Query \
	test/hs/Test/Ganeti/THH
156

157 158 159
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

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

206
ALL_APIDOC_HS_DIRS = \
207
	$(APIDOC_HS_DIR) \
208
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
209 210 211 212 213

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
214
	$(APIDOC_PY_DIR) \
215 216
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
217
	$(COVERAGE_PY_DIR) \
218
	.hpc
219 220 221

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
222 223
	doc/html \
	doc/man-html
224 225 226 227

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
228
	doc/html/_* \
229
	doc/man-html/_* \
Iustin Pop's avatar
Iustin Pop committed
230
	autom4te.cache
231

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

247
maintainer-clean-local:
248
	rm -rf $(BUILDTIME_DIRS)
249

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

Iustin Pop's avatar
Iustin Pop committed
296
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
297
	$(built_base_sources) \
298
	$(built_python_sources) \
299 300
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
301

302
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
303
if ENABLE_CONFD
304
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
305
endif
306 307 308
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
309

310
built_base_sources = \
311 312
	stamp-directories \
	stamp-srclinks
313

314
built_python_base_sources = \
315
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
316
	lib/_vcsversion.py \
317 318
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
319

320
built_python_sources = \
321 322
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
323

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

328 329 330 331 332
# 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
333
	doc/examples/ganeti.logrotate \
334
	doc/examples/ganeti-master-role.ocf \
335
	doc/examples/ganeti-node-role.ocf \
336 337 338
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

339 340 341
dist_ifup_SCRIPTS = \
	tools/kvm-ifup-os

342
nodist_pkgpython_PYTHON = \
343 344 345
	$(built_python_base_sources) \
	lib/_generated_rpc.py

346 347
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
348

349 350 351 352 353 354
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

355
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
356
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
357 358
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
359

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

397
client_PYTHON = \
398
	lib/client/__init__.py \
399
	lib/client/base.py \
400
	lib/client/gnt_backup.py \
401
	lib/client/gnt_cluster.py \
402
	lib/client/gnt_debug.py \
403
	lib/client/gnt_group.py \
404
	lib/client/gnt_instance.py \
405
	lib/client/gnt_job.py \
406
	lib/client/gnt_node.py \
407
	lib/client/gnt_network.py \
408 409
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
410

411
cmdlib_PYTHON = \
412
	lib/cmdlib/__init__.py \
413
	lib/cmdlib/backup.py \
414
	lib/cmdlib/base.py \
415
	lib/cmdlib/cluster.py \
416
	lib/cmdlib/common.py \
417
	lib/cmdlib/group.py \
418
	lib/cmdlib/instance.py \
419
	lib/cmdlib/instance_migration.py \
420
	lib/cmdlib/instance_operation.py \
421
	lib/cmdlib/instance_query.py \
422
	lib/cmdlib/instance_storage.py \
423
	lib/cmdlib/instance_utils.py \
424 425 426
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
427
	lib/cmdlib/operating_system.py \
428
	lib/cmdlib/query.py \
429
	lib/cmdlib/tags.py \
430
	lib/cmdlib/test.py
431

432 433 434
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
435
	lib/hypervisor/hv_chroot.py \
436
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
437
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
438
	lib/hypervisor/hv_lxc.py \
439 440
	lib/hypervisor/hv_xen.py

441 442 443 444
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
445
	lib/storage/container.py \
446 447
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
448
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
449 450
	lib/storage/filestorage.py \
	lib/storage/gluster.py
451

452 453
rapi_PYTHON = \
	lib/rapi/__init__.py \
454
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
455
	lib/rapi/client.py \
456
	lib/rapi/client_utils.py \
457
	lib/rapi/connector.py \
458 459
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
460

461
http_PYTHON = \
462
	lib/http/__init__.py \
463
	lib/http/auth.py \
464 465
	lib/http/client.py \
	lib/http/server.py
466

Guido Trotter's avatar
Guido Trotter committed
467
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
468
	lib/confd/__init__.py \
469
	lib/confd/client.py
470

Michael Hanselmann's avatar
Michael Hanselmann committed
471
masterd_PYTHON = \
472
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
473
	lib/masterd/iallocator.py \
474
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
475

476 477 478
impexpd_PYTHON = \
	lib/impexpd/__init__.py

479
watcher_PYTHON = \
480
	lib/watcher/__init__.py \
481 482
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
483

484
server_PYTHON = \
485
	lib/server/__init__.py \
486
	lib/server/masterd.py \
487 488
	lib/server/noded.py \
	lib/server/rapi.py
489

490 491
rpc_PYTHON = \
	lib/rpc/__init__.py \
492
	lib/rpc/client.py \
493 494 495
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
496

497 498 499
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

500 501
pytools_PYTHON = \
	lib/tools/__init__.py \
502
	lib/tools/burnin.py \
503
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
504
	lib/tools/node_cleanup.py \
505
	lib/tools/node_daemon_setup.py \
506
	lib/tools/prepare_node_join.py
507

508
utils_PYTHON = \
509
	lib/utils/__init__.py \
510
	lib/utils/algo.py \
511
	lib/utils/filelock.py \
512
	lib/utils/hash.py \
513
	lib/utils/io.py \
514
	lib/utils/livelock.py \
515
	lib/utils/log.py \
516
	lib/utils/lvm.py \
517
	lib/utils/mlock.py \
518
	lib/utils/nodesetup.py \
519
	lib/utils/process.py \
520
	lib/utils/retry.py \
521
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
522
	lib/utils/storage.py \
523
	lib/utils/text.py \
524
	lib/utils/version.py \
525 526
	lib/utils/wrapper.py \
	lib/utils/x509.py
527

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

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

614 615 616 617
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
618
if ENABLE_MOND
619
HS_MYEXECLIB_PROGS=src/mon-collector
620 621 622
else
HS_MYEXECLIB_PROGS=
endif
623

624
# Haskell programs to be compiled by "make really-all"
625
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
626
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
627
	src/ganeti-metad \
Petr Pudlak's avatar
Petr Pudlak committed
628
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
629
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
630
	src/hs2py \
631
	src/rpc-test
632 633 634 635 636 637
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
638 639 640 641

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

642
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
643
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
644

645 646 647 648
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
649 650
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
651
	test/hs/htest \
652
	$(HS_COMPILE_PROGS)
653

654 655
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

656 657 658
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

659
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
660
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
661

662
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
663
	-O -Wall -Werror -isrc \
664 665 666 667
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
if HPROFILE
HFLAGS += -prof -auto-all
endif
if HCOVERAGE
HFLAGS += -fhpc
endif
if HTEST
HFLAGS += -DTEST
endif

HTEST_SUFFIX = hpc

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

684
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
685
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
686
# internal extra flags (used for test/hs/htest mainly)
687
HEXTRA_INT =
688
# exclude options for coverage reports
689
HPCEXCL = --exclude Main \
690
	--exclude Ganeti.Constants \
691
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
692
	--exclude Ganeti.THH \
693
	--exclude Ganeti.Version \
694
	--exclude Test.Ganeti.Attoparsec \
695
	--exclude Test.Ganeti.TestCommon \
696 697
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
698
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
699
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
700

701
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
702
	src/Ganeti/BasicTypes.hs \
703
	src/Ganeti/Codec.hs \
Iustin Pop's avatar
Iustin Pop committed
704 705 706
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
707
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
708 709 710 711
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
712
	src/Ganeti/ConfigReader.hs \
713
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
714
	src/Ganeti/ConstantUtils.hs \
715 716
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
717
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
718 719
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
720
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
721
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
722
	src/Ganeti/DataCollectors/Drbd.hs \
723 724
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
725
	src/Ganeti/DataCollectors/Lv.hs \