Makefile.am 78.1 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
jqueuedir = $(pkgpythondir)/jqueue
87
storagedir = $(pkgpythondir)/storage
88
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
89
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
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
SYMLINK_TARGET_DIRS = \
105
	$(sysconfdir)/ganeti \
106
	$(libdir)/ganeti/iallocators \
107
108
	$(libdir)/ganeti/tools \
	$(prefix)/share/ganeti \
Jose A. Lopes's avatar
Jose A. Lopes committed
109
110
111
112
113
	$(BINDIR) \
	$(SBINDIR) \
	$(MANDIR)/man1 \
	$(MANDIR)/man7 \
	$(MANDIR)/man8
114

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

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

162
163
164
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

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

214
ALL_APIDOC_HS_DIRS = \
215
	$(APIDOC_HS_DIR) \
216
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
217
218
219
220
221

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
222
	$(APIDOC_PY_DIR) \
223
224
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
225
	$(COVERAGE_PY_DIR) \
226
	.hpc
227
228
229

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
230
231
	doc/html \
	doc/man-html
232
233
234
235

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
236
	doc/html/_* \
237
	doc/man-html/_* \
Iustin Pop's avatar
Iustin Pop committed
238
	autom4te.cache
239

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

255
maintainer-clean-local:
256
	rm -rf $(BUILDTIME_DIRS)
257

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

Iustin Pop's avatar
Iustin Pop committed
305
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
306
	$(built_base_sources) \
307
	$(built_python_sources) \
308
309
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
310

311
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
312
if ENABLE_CONFD
313
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
314
endif
315
316
317
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
318

319
built_base_sources = \
320
321
	stamp-directories \
	stamp-srclinks
322

323
built_python_base_sources = \
324
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
325
	lib/_vcsversion.py \
326
327
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
328

329
built_python_sources = \
330
331
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
332

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

337
338
339
340
341
# 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
342
	doc/examples/ganeti.logrotate \
343
	doc/examples/ganeti-master-role.ocf \
344
	doc/examples/ganeti-node-role.ocf \
345
	doc/examples/gnt-config-backup \
346
347
348
349
350
351
352
353
354
355
356
	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-masterd.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
357

358
dist_ifup_SCRIPTS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
359
360
	tools/kvm-ifup-os \
	tools/xen-ifup-os
361

362
nodist_pkgpython_PYTHON = \
363
364
365
	$(built_python_base_sources) \
	lib/_generated_rpc.py

366
367
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
368

369
370
371
372
373
374
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

375
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
376
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
377
378
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
379

380
381
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
382
	lib/asyncnotifier.py \
383
384
385
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
386
	lib/compat.py \
387
388
	lib/config.py \
	lib/constants.py \
389
	lib/daemon.py \
390
	lib/errors.py \
391
	lib/hooksmaster.py \
392
	lib/ht.py \
393
	lib/jstore.py \
394
395
396
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
397
	lib/netutils.py \
398
	lib/objects.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
399
	lib/opcodes_base.py \
400
	lib/outils.py \
401
	lib/ovf.py \
402
	lib/pathutils.py \
403
	lib/qlang.py \
404
	lib/query.py \
405
	lib/rpc_defs.py \
406
	lib/runtime.py \
407
408
409
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
410
	lib/uidpool.py \
411
	lib/vcluster.py \
412
	lib/network.py \
Petr Pudlak's avatar
Petr Pudlak committed
413
	lib/wconfd.py \
414
	lib/workerpool.py
415

416
client_PYTHON = \
417
	lib/client/__init__.py \
418
	lib/client/base.py \
419
	lib/client/gnt_backup.py \
420
	lib/client/gnt_cluster.py \
421
	lib/client/gnt_debug.py \
422
	lib/client/gnt_group.py \
423
	lib/client/gnt_instance.py \
424
	lib/client/gnt_job.py \
425
	lib/client/gnt_node.py \
426
	lib/client/gnt_network.py \
427
428
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
429

430
cmdlib_PYTHON = \
431
	lib/cmdlib/__init__.py \
432
	lib/cmdlib/backup.py \
433
	lib/cmdlib/base.py \
434
	lib/cmdlib/cluster.py \
435
	lib/cmdlib/common.py \
436
	lib/cmdlib/group.py \
437
	lib/cmdlib/instance.py \
438
	lib/cmdlib/instance_migration.py \
439
	lib/cmdlib/instance_operation.py \
440
	lib/cmdlib/instance_query.py \
441
	lib/cmdlib/instance_storage.py \
442
	lib/cmdlib/instance_utils.py \
443
444
445
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
446
	lib/cmdlib/operating_system.py \
447
	lib/cmdlib/query.py \
448
	lib/cmdlib/tags.py \
449
	lib/cmdlib/test.py
450

451
452
453
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
454
	lib/hypervisor/hv_chroot.py \
455
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
456
	lib/hypervisor/hv_lxc.py \
457
458
	lib/hypervisor/hv_xen.py

459
hypervisor_hv_kvm_PYTHON = \
460
  lib/hypervisor/hv_kvm/__init__.py \
461
462
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
463

464
jqueue_PYTHON = \
465
466
	lib/jqueue/__init__.py \
	lib/jqueue/exec.py
467

468
469
470
471
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
472
	lib/storage/container.py \
473
474
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
475
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
476
477
	lib/storage/filestorage.py \
	lib/storage/gluster.py
478

479
480
rapi_PYTHON = \
	lib/rapi/__init__.py \
481
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
482
	lib/rapi/client.py \
483
	lib/rapi/client_utils.py \
484
	lib/rapi/connector.py \
485
486
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
487

488
http_PYTHON = \
489
	lib/http/__init__.py \
490
	lib/http/auth.py \
491
492
	lib/http/client.py \
	lib/http/server.py
493

Guido Trotter's avatar
Guido Trotter committed
494
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
495
	lib/confd/__init__.py \
496
	lib/confd/client.py
497

Michael Hanselmann's avatar
Michael Hanselmann committed
498
masterd_PYTHON = \
499
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
500
	lib/masterd/iallocator.py \
501
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
502

503
504
505
impexpd_PYTHON = \
	lib/impexpd/__init__.py

506
watcher_PYTHON = \
507
	lib/watcher/__init__.py \
508
509
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
510

511
server_PYTHON = \
512
	lib/server/__init__.py \
513
	lib/server/masterd.py \
514
515
	lib/server/noded.py \
	lib/server/rapi.py
516

517
518
rpc_PYTHON = \
	lib/rpc/__init__.py \
519
	lib/rpc/client.py \
520
521
522
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
523

524
525
526
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

527
528
pytools_PYTHON = \
	lib/tools/__init__.py \
529
	lib/tools/burnin.py \
530
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
531
	lib/tools/node_cleanup.py \
532
	lib/tools/node_daemon_setup.py \
533
	lib/tools/prepare_node_join.py
534

535
utils_PYTHON = \
536
	lib/utils/__init__.py \
537
	lib/utils/algo.py \
538
	lib/utils/filelock.py \
539
	lib/utils/hash.py \
540
	lib/utils/io.py \
541
	lib/utils/livelock.py \
542
	lib/utils/log.py \
543
	lib/utils/lvm.py \
544
	lib/utils/mlock.py \
545
	lib/utils/nodesetup.py \
546
	lib/utils/process.py \
547
	lib/utils/retry.py \
548
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
549
	lib/utils/storage.py \
550
	lib/utils/text.py \
551
	lib/utils/version.py \
552
553
	lib/utils/wrapper.py \
	lib/utils/x509.py
554

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

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

645
646
647
648
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
649
if ENABLE_MOND
650
HS_MYEXECLIB_PROGS=src/mon-collector
651
652
653
else
HS_MYEXECLIB_PROGS=
endif
654

655
# Haskell programs to be compiled by "make really-all"
656
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
657
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
658
	src/ganeti-metad \
Petr Pudlak's avatar
Petr Pudlak committed
659
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
660
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
661
	src/hs2py \
662
	src/rpc-test
663
664
665
666
667
668
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
669
670
671
672

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

673
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
674
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
675

676
677
678
679
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
680
681
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
682
	test/hs/htest \
683
	$(HS_COMPILE_PROGS)
684

685
686
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

687
688
689
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

690
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
691
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
692

693
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
694
	-O -Wall -Werror -isrc \
695
696
697
698
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
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

715
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
716
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
717
# internal extra flags (used for test/hs/htest mainly)
718
HEXTRA_INT =
719
720
# combination of HEXTRA and HEXTRA_CONFIGURE
HEXTRA_COMBINED = $(HEXTRA) $(HEXTRA_CONFIGURE)
721
# exclude options for coverage reports
722
HPCEXCL = --exclude Main \
723
	--exclude Ganeti.Constants \
724
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
725
	--exclude Ganeti.THH \
726
	--exclude Ganeti.Version \
727
	--exclude Test.Ganeti.Attoparsec \
728
	--exclude Test.Ganeti.TestCommon \
729
730
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
731
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
732
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
733

734
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
735
	src/Ganeti/BasicTypes.hs \
736
	src/Ganeti/Codec.hs \
Iustin Pop's avatar
Iustin Pop committed
737
738
739
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
740
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
741
742
743
744
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
745
	src/Ganeti/ConfigReader.hs \
746
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
747
	src/Ganeti/ConstantUtils.hs \
748
749
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
750
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
751
752
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
753
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
754
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
755
	src/Ganeti/DataCollectors/Drbd.hs \
756
757
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
758
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
759
	src/Ganeti/DataCollectors/Program.hs \
760
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
761
762
763
764
765
766
767
768
769
770
771
772
773
774
	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 \
775
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
776
777
778
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
779
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
780
781
782
783
784
	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 \
785
	src/Ganeti/HTools/Program/Hsqueeze.hs \
Iustin Pop's avatar
Iustin Pop committed