Makefile.am 76.5 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
hypervisor_hv_kvmdir = $(pkgpythondir)/hypervisor/hv_kvm
86
storagedir = $(pkgpythondir)/storage
87
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
88
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
89
confddir = $(pkgpythondir)/confd
90
rapidir = $(pkgpythondir)/rapi
91
rpcdir = $(pkgpythondir)/rpc
92
rpc_stubdir = $(pkgpythondir)/rpc/stub
93
serverdir = $(pkgpythondir)/server
94
watcherdir = $(pkgpythondir)/watcher
95
impexpddir = $(pkgpythondir)/impexpd
96
utilsdir = $(pkgpythondir)/utils
97
toolsdir = $(pkglibdir)/tools
98
iallocatorsdir = $(pkglibdir)/iallocators
99
pytoolsdir = $(pkgpythondir)/tools
100
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
101
ifupdir = $(sysconfdir)/ganeti
102

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

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

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

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

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

209
ALL_APIDOC_HS_DIRS = \
210
	$(APIDOC_HS_DIR) \
211
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
212
213
214
215
216

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

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
225
226
	doc/html \
	doc/man-html
227
228
229
230

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

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

250
maintainer-clean-local:
251
	rm -rf $(BUILDTIME_DIRS)
252

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

Iustin Pop's avatar
Iustin Pop committed
299
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
300
	$(built_base_sources) \
301
	$(built_python_sources) \
302
303
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
304

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

313
built_base_sources = \
314
315
	stamp-directories \
	stamp-srclinks
316

317
built_python_base_sources = \
318
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
319
	lib/_vcsversion.py \
320
321
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
322

323
built_python_sources = \
324
325
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
326

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

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

342
343
344
dist_ifup_SCRIPTS = \
	tools/kvm-ifup-os

345
nodist_pkgpython_PYTHON = \
346
347
348
	$(built_python_base_sources) \
	lib/_generated_rpc.py

349
350
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
351

352
353
354
355
356
357
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

358
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
359
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
360
361
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
362

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

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

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

435
436
437
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
438
	lib/hypervisor/hv_chroot.py \
439
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
440
	lib/hypervisor/hv_lxc.py \
441
442
	lib/hypervisor/hv_xen.py

443
hypervisor_hv_kvm_PYTHON = \
444
  lib/hypervisor/hv_kvm/__init__.py \
445
446
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
447

448
449
450
451
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
452
	lib/storage/container.py \
453
454
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
455
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
456
457
	lib/storage/filestorage.py \
	lib/storage/gluster.py
458

459
460
rapi_PYTHON = \
	lib/rapi/__init__.py \
461
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
462
	lib/rapi/client.py \
463
	lib/rapi/client_utils.py \
464
	lib/rapi/connector.py \
465
466
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
467

468
http_PYTHON = \
469
	lib/http/__init__.py \
470
	lib/http/auth.py \
471
472
	lib/http/client.py \
	lib/http/server.py
473

Guido Trotter's avatar
Guido Trotter committed
474
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
475
	lib/confd/__init__.py \
476
	lib/confd/client.py
477

Michael Hanselmann's avatar
Michael Hanselmann committed
478
masterd_PYTHON = \
479
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
480
	lib/masterd/iallocator.py \
481
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
482

483
484
485
impexpd_PYTHON = \
	lib/impexpd/__init__.py

486
watcher_PYTHON = \
487
	lib/watcher/__init__.py \
488
489
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
490

491
server_PYTHON = \
492
	lib/server/__init__.py \
493
	lib/server/masterd.py \
494
495
	lib/server/noded.py \
	lib/server/rapi.py
496

497
498
rpc_PYTHON = \
	lib/rpc/__init__.py \
499
	lib/rpc/client.py \
500
501
502
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
503

504
505
506
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

507
508
pytools_PYTHON = \
	lib/tools/__init__.py \
509
	lib/tools/burnin.py \
510
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
511
	lib/tools/node_cleanup.py \
512
	lib/tools/node_daemon_setup.py \
513
	lib/tools/prepare_node_join.py
514

515
utils_PYTHON = \
516
	lib/utils/__init__.py \
517
	lib/utils/algo.py \
518
	lib/utils/filelock.py \
519
	lib/utils/hash.py \
520
	lib/utils/io.py \
521
	lib/utils/livelock.py \
522
	lib/utils/log.py \
523
	lib/utils/lvm.py \
524
	lib/utils/mlock.py \
525
	lib/utils/nodesetup.py \
526
	lib/utils/process.py \
527
	lib/utils/retry.py \
528
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
529
	lib/utils/storage.py \
530
	lib/utils/text.py \
531
	lib/utils/version.py \
532
533
	lib/utils/wrapper.py \
	lib/utils/x509.py
534

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

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

621
622
623
624
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
625
if ENABLE_MOND
626
HS_MYEXECLIB_PROGS=src/mon-collector
627
628
629
else
HS_MYEXECLIB_PROGS=
endif
630

631
# Haskell programs to be compiled by "make really-all"
632
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
633
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
634
	src/ganeti-metad \
Petr Pudlak's avatar
Petr Pudlak committed
635
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
636
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
637
	src/hs2py \
638
	src/rpc-test
639
640
641
642
643
644
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
645
646
647
648

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

649
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
650
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
651

652
653
654
655
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
656
657
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
658
	test/hs/htest \
659
	$(HS_COMPILE_PROGS)
660

661
662
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

663
664
665
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

666
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
667
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
668

669
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
670
	-O -Wall -Werror -isrc \
671
672
673
674
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
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

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

708
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
709
	src/Ganeti/BasicTypes.hs \
710
	src/Ganeti/Codec.hs \
Iustin Pop's avatar
Iustin Pop committed
711
712
713
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
714
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
715
716
717
718
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
719
	src/Ganeti/ConfigReader.hs \
720
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
721
	src/Ganeti/ConstantUtils.hs \
722
723
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
724
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
725
726
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
727
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
728
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
729
	src/Ganeti/DataCollectors/Drbd.hs \
730
731
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
732
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
733
	src/Ganeti/DataCollectors/Program.hs \
734
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
735
736
737
738
739
740
741
742
743
744
745
746
747
748
	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 \
749
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
750
751
752
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
753
	src/Ganeti/HTools/Program/Harep.hs \