Makefile.am 75.2 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
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-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 59 60 61 62 63
if USE_VERSION_FULL
DIRVERSION=VERSION_FULL
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 70
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
71 72 73 74
pkglibdir = $(versiondir)$(libdir)/ganeti
myexeclibdir = $(pkglibdir)
bindir = $(versiondir)$(exec_prefix)/bin
sbindir = $(versiondir)$(exec_prefix)/sbin
75 76 77 78 79 80
mandir = $(versionedsharedir)$(datarootdir)/man
pkgpythondir = $(versionedsharedir)/ganeti
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
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 98
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)

99
SYMLINK_TARGET_DIRS = \
100
	$(sysconfdir)/ganeti \
101
	$(libdir)/ganeti/iallocators \
102 103
	$(libdir)/ganeti/tools \
	$(prefix)/share/ganeti \
104 105 106 107 108
	$(exec_prefix)/bin \
	$(exec_prefix)/sbin \
	$(datarootdir)/man/man1 \
	$(datarootdir)/man/man7 \
	$(datarootdir)/man/man8
109

110 111 112
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

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

146 147 148
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

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

192
ALL_APIDOC_HS_DIRS = \
193
	$(APIDOC_HS_DIR) \
194
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
195 196 197 198 199

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
200
	$(APIDOC_PY_DIR) \
201 202
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
203
	$(COVERAGE_PY_DIR) \
204
	.hpc
205 206 207

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
208 209
	doc/html \
	doc/man-html
210 211 212 213

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
214
	doc/html/_* \
215
	doc/man-html/_* \
Iustin Pop's avatar
Iustin Pop committed
216
	autom4te.cache
217

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

233
maintainer-clean-local:
234
	rm -rf $(BUILDTIME_DIRS)
235

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

Iustin Pop's avatar
Iustin Pop committed
276
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
277
	$(built_base_sources) \
278 279 280
	$(BUILT_PYTHON_SOURCES) \
	$(PYTHON_BOOTSTRAP)

281
HS_GENERATED_FILES =
282
if WANT_HTOOLS
283
HS_GENERATED_FILES += $(HS_PROGS)
284
if ENABLE_CONFD
Thomas Thrainer's avatar
Thomas Thrainer committed
285
HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
286
endif
287 288 289 290

if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
291 292
endif

293
built_base_sources = \
294 295
	stamp-directories \
	stamp-srclinks
296

297
built_python_base_sources = \
298
	lib/_autoconf.py \
299
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
300 301
	lib/_vcsversion.py \
	lib/opcodes.py
302 303 304

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
305
	lib/_generated_rpc.py
306

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

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

322 323 324
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

325 326 327 328 329 330
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

331
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
332
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
333 334
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
335

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

373
client_PYTHON = \
374
	lib/client/__init__.py \
375
	lib/client/gnt_backup.py \
376
	lib/client/gnt_cluster.py \
377
	lib/client/gnt_debug.py \
378
	lib/client/gnt_group.py \
379
	lib/client/gnt_instance.py \
380
	lib/client/gnt_job.py \
381
	lib/client/gnt_node.py \
382
	lib/client/gnt_network.py \
383 384
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
385

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

407 408 409
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
410
	lib/hypervisor/hv_chroot.py \
411
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
412
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
413
	lib/hypervisor/hv_lxc.py \
414 415
	lib/hypervisor/hv_xen.py

416 417 418 419
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
420
	lib/storage/container.py \
421 422
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
423 424
	lib/storage/drbd_cmdgen.py \
	lib/storage/filestorage.py
425

426 427
rapi_PYTHON = \
	lib/rapi/__init__.py \
428
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
429
	lib/rapi/client.py \
430
	lib/rapi/client_utils.py \
431
	lib/rapi/connector.py \
432 433
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
434

435
http_PYTHON = \
436
	lib/http/__init__.py \
437
	lib/http/auth.py \
438 439
	lib/http/client.py \
	lib/http/server.py
440

Guido Trotter's avatar
Guido Trotter committed
441
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
442
	lib/confd/__init__.py \
443
	lib/confd/client.py
444

Michael Hanselmann's avatar
Michael Hanselmann committed
445
masterd_PYTHON = \
446
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
447
	lib/masterd/iallocator.py \
448
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
449

450 451 452
impexpd_PYTHON = \
	lib/impexpd/__init__.py

453
watcher_PYTHON = \
454
	lib/watcher/__init__.py \
455 456
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
457

458
server_PYTHON = \
459
	lib/server/__init__.py \
460
	lib/server/masterd.py \
461 462
	lib/server/noded.py \
	lib/server/rapi.py
463

464 465
pytools_PYTHON = \
	lib/tools/__init__.py \
466
	lib/tools/burnin.py \
467
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
468
	lib/tools/node_cleanup.py \
469
	lib/tools/node_daemon_setup.py \
470
	lib/tools/prepare_node_join.py
471

472
utils_PYTHON = \
473
	lib/utils/__init__.py \
474
	lib/utils/algo.py \
475
	lib/utils/filelock.py \
476
	lib/utils/hash.py \
477
	lib/utils/io.py \
478
	lib/utils/log.py \
479
	lib/utils/lvm.py \
480
	lib/utils/mlock.py \
481
	lib/utils/nodesetup.py \
482
	lib/utils/process.py \
483
	lib/utils/retry.py \
Helga Velroyen's avatar
Helga Velroyen committed
484
	lib/utils/storage.py \
485
	lib/utils/text.py \
486 487
	lib/utils/wrapper.py \
	lib/utils/x509.py
488

489 490 491
docinput = \
	doc/conf.py \
	doc/css/style.css \
492
	doc/admin.rst \
Iustin Pop's avatar
Iustin Pop committed
493
	doc/cluster-merge.rst \
494
	doc/design-2.0.rst \
495
	doc/design-2.1.rst \
496
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
497
	doc/design-2.3.rst \
498
	doc/design-2.4.rst \
499
	doc/design-2.5.rst \
500
	doc/design-2.6.rst \
501
	doc/design-2.7.rst \
502
	doc/design-2.8.rst \
Klaus Aehlig's avatar
Klaus Aehlig committed
503
	doc/design-2.9.rst \
Iustin Pop's avatar
Iustin Pop committed
504 505 506
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
	doc/design-chained-jobs.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
507
	doc/design-cpu-pinning.rst \
508
	doc/design-device-uuid-name.rst \
Iustin Pop's avatar
Iustin Pop committed
509
	doc/design-draft.rst \
Dimitris Aragiorgis's avatar
Dimitris Aragiorgis committed
510
	doc/design-hotplug.rst \
Iustin Pop's avatar
Iustin Pop committed
511
	doc/design-htools-2.3.rst \
512
	doc/design-http-server.rst \
513
	doc/design-impexp2.rst \
514
	doc/design-internal-shutdown.rst \
515
	doc/design-lu-generated-jobs.rst \
516
	doc/design-linuxha.rst \
517
	doc/design-multi-reloc.rst \
518
	doc/design-network.rst \
519
	doc/design-node-add.rst \
Iustin Pop's avatar
Iustin Pop committed
520
	doc/design-oob.rst \
521
	doc/design-ovf-support.rst \
522
	doc/design-opportunistic-locking.rst \
523
	doc/design-optables.rst \
Iustin Pop's avatar
Iustin Pop committed
524 525 526
	doc/design-partitioned.rst \
	doc/design-query-splitting.rst \
	doc/design-query2.rst \
527
	doc/design-reason-trail.rst \
528
	doc/design-resource-model.rst \
529
	doc/design-restricted-commands.rst \
530
	doc/design-shared-storage.rst \
531
	doc/design-monitoring-agent.rst \
532
	doc/design-virtual-clusters.rst \
Iustin Pop's avatar
Iustin Pop committed
533
	doc/design-x509-ca.rst \
534
	doc/design-hroller.rst \
535
	doc/design-storagetypes.rst \
536
        doc/design-upgrade.rst \
537
	doc/devnotes.rst \
538
	doc/glossary.rst \
539
	doc/hooks.rst \
540
	doc/iallocator.rst \
541
	doc/index.rst \
542
	doc/install-quick.rst \
543
	doc/install.rst \
544
	doc/locking.rst \
545
	doc/manpages-disabled.rst \
546
	doc/monitoring-query-format.rst \
547
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
548
	doc/news.rst \
549
	doc/ovfconverter.rst \
550
	doc/rapi.rst \
551
	doc/security.rst \
552
	doc/upgrade.rst \
553
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
554
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
555

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

559 560 561 562
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
563
if ENABLE_MOND
564
HS_MYEXECLIB_PROGS=src/mon-collector
565 566 567
else
HS_MYEXECLIB_PROGS=
endif
568

569
# Haskell programs to be compiled by "make really-all"
570
HS_COMPILE_PROGS= \
571
	src/ganeti-mond \
572
	src/hconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
573
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
574
	src/hs2py \
575 576 577 578 579
	src/rpc-test

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

580
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
581
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
582

583 584
HS_ALL_PROGS = \
	$(HS_PROGS) \
585 586
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
587
	test/hs/htest \
588
	$(HS_COMPILE_PROGS)
589

590
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS)) src/hs2py-constants.hs
591
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
592

593
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
594
	-O -Wall -Werror -isrc \
595 596 597 598
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

599
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
600
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
601
# internal extra flags (used for test/hs/htest mainly)
602
HEXTRA_INT =
603
# exclude options for coverage reports
604
HPCEXCL = --exclude Main \
605
	--exclude Ganeti.Constants \
606
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
607
	--exclude Ganeti.THH \
608
	--exclude Ganeti.Version \
609
	--exclude Test.Ganeti.Attoparsec \
610
	--exclude Test.Ganeti.TestCommon \
611 612
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
613
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
614
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
615

616
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
617 618 619 620
	src/Ganeti/BasicTypes.hs \
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
621
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
622 623 624 625
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
626
	src/Ganeti/ConfigReader.hs \
627
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
628
	src/Ganeti/ConstantUtils.hs \
629 630
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
631
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
632 633
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
634
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
635
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
636
	src/Ganeti/DataCollectors/Drbd.hs \
637 638
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
639
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
640
	src/Ganeti/DataCollectors/Program.hs \
641
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
642 643 644 645 646 647 648 649 650 651 652 653 654 655
	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 \
656
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
657 658 659
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
660
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
661 662 663 664 665 666
	src/Ganeti/HTools/Program/Hbal.hs \
	src/Ganeti/HTools/Program/Hcheck.hs \
	src/Ganeti/HTools/Program/Hinfo.hs \
	src/Ganeti/HTools/Program/Hscan.hs \
	src/Ganeti/HTools/Program/Hspace.hs \
	src/Ganeti/HTools/Program/Hroller.hs \
667
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
668
	src/Ganeti/HTools/Types.hs \
669
	src/Ganeti/Hypervisor/Xen.hs \
670 671
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
672
	src/Ganeti/Hash.hs \
673
	src/Ganeti/Hs2Py/GenConstants.hs \
674
	src/Ganeti/Hs2Py/GenOpCodes.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
675
	src/Ganeti/Hs2Py/OpDoc.hs \
676
	src/Ganeti/HsConstants.hs \
Iustin Pop's avatar
Iustin Pop committed
677 678 679 680 681
	src/Ganeti/JQueue.hs \
	src/Ganeti/JSON.hs \
	src/Ganeti/Jobs.hs \
	src/Ganeti/Logging.hs \
	src/Ganeti/Luxi.hs \
682
	src/Ganeti/Monitoring/Server.hs \
Iustin Pop's avatar
Iustin Pop committed
683 684 685 686 687
	src/Ganeti/Network.hs \
	src/Ganeti/Objects.hs \
	src/Ganeti/OpCodes.hs \
	src/Ganeti/OpParams.hs \
	src/Ganeti/Path.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
688
	src/Ganeti/Parsers.hs \
689
	src/Ganeti/PyValueInstances.hs \
Thomas Thrainer's avatar
Thomas Thrainer committed
690
	src/Ganeti/Query/Cluster.hs \
Iustin Pop's avatar
Iustin Pop committed
691
	src/Ganeti/Query/Common.hs \
692
	src/Ganeti/Query/Export.hs \
Iustin Pop's avatar
Iustin Pop committed
693 694 695 696
	src/Ganeti/Query/Filter.hs \
	src/Ganeti/Query/Group.hs \
	src/Ganeti/Query/Job.hs \
	src/Ganeti/Query/Language.hs \
697
	src/Ganeti/Query/Network.hs \
Iustin Pop's avatar
Iustin Pop committed
698 699 700 701 702 703 704
	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 \
705 706 707 708
	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
709 710
	src/Ganeti/Storage/Lvm/LVParser.hs \
	src/Ganeti/Storage/Lvm/Types.hs \
711
	src/Ganeti/Storage/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
712 713 714
	src/Ganeti/THH.hs \
	src/Ganeti/Types.hs \
	src/Ganeti/Utils.hs
715 716

HS_TEST_SRCS = \
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734
	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 \
	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 \
	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 \
735
	test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
736 737 738 739 740 741 742 743 744
	test/hs/Test/Ganeti/JSON.hs \
	test/hs/Test/Ganeti/Jobs.hs \
	test/hs/Test/Ganeti/JQueue.hs \
	test/hs/Test/Ganeti/Luxi.hs \
	test/hs/Test/Ganeti/Network.hs \
	test/hs/Test/Ganeti/Objects.hs \
	test/hs/Test/Ganeti/OpCodes.hs \
	test/hs/Test/Ganeti/Query/Filter.hs \
	test/hs/Test/Ganeti/Query/Language.hs \
745
	test/hs/Test/Ganeti/Query/Network.hs \
746 747
	test/hs/Test/Ganeti/Query/Query.hs \
	test/hs/Test/Ganeti/Rpc.hs \
748
	test/hs/Test/Ganeti/Runtime.hs \
749
	test/hs/Test/Ganeti/Ssconf.hs \
750 751 752
	test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
	test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
	test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
Michele Tartara's avatar
Michele Tartara committed
753
	test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
754 755 756 757 758 759
	test/hs/Test/Ganeti/THH.hs \
	test/hs/Test/Ganeti/TestCommon.hs \
	test/hs/Test/Ganeti/TestHTools.hs \
	test/hs/Test/Ganeti/TestHelper.hs \
	test/hs/Test/Ganeti/Types.hs \
	test/hs/Test/Ganeti/Utils.hs
760

761
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
762

763
HS_BUILT_SRCS = \
764
	test/hs/Test/Ganeti/TestImports.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
765
	src/AutoConf.hs \
766
	src/Ganeti/Hs2Py/ListConstants.hs \
767
	src/Ganeti/PyConstants.hs \