Makefile.am 93.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.
6
# - Use autogen.sh to generate Makefile.in and configure script.
7

8 9 10 11 12 13
# For distcheck we need the haskell tests to be enabled. Note:
# The "correct" way would be to define AM_DISTCHECK_CONFIGURE_FLAGS.
# However, we still have to support older versions of autotools,
# so we cannot use that yet, hence we fall back to..
DISTCHECK_CONFIGURE_FLAGS = --enable-haskell-tests

14 15 16 17
# Automake doesn't export these variables before version 1.10.
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@

18 19 20 21 22
# Helper values for calling builtin functions
empty :=
space := $(empty) $(empty)
comma := ,

23 24 25
# Helper function to strip src/ and test/hs/ from a list
strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))

26 27 28
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

29 30
EXTRA_DIST=

31 32 33
# Enable colors in shelltest
SHELLTESTARGS = "-c"

34
ACLOCAL_AMFLAGS = -I autotools
35
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
36
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
37
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
38
CHECK_HEADER = $(top_srcdir)/autotools/check-header
39
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
40
CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
41
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
42
CHECK_VERSION = $(top_srcdir)/autotools/check-version
43
CHECK_NEWS = $(top_srcdir)/autotools/check-news
44
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
45
DOCPP = $(top_srcdir)/autotools/docpp
46
REPLACE_VARS_SED = autotools/replace_vars.sed
47
PRINT_PY_CONSTANTS = $(top_srcdir)/autotools/print-py-constants
48
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
49
SHELL_ENV_INIT = autotools/shell-env-init
50

51
# starting as of Ganeti 2.10, all files are stored in two directories,
52
# with only symbolic links added at other places.
53 54 55 56 57 58 59 60 61 62 63 64 65
#
# $(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.
66
if USE_VERSION_FULL
67
DIRVERSION=$(VERSION_FULL)
68 69 70 71
else
DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
endif
versiondir = $(libdir)/ganeti/$(DIRVERSION)
72
defaultversiondir = $(libdir)/ganeti/default
73
versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
74 75
defaultversionedsharedir = $(prefix)/share/ganeti/default

76 77
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
78 79
pkglibdir = $(versiondir)$(libdir)/ganeti
myexeclibdir = $(pkglibdir)
Jose A. Lopes's avatar
Jose A. Lopes committed
80 81 82
bindir = $(versiondir)/$(BINDIR)
sbindir = $(versiondir)$(SBINDIR)
mandir = $(versionedsharedir)/root$(MANDIR)
83
pkgpythondir = $(versionedsharedir)/ganeti
84
pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub
85 86 87 88
gntpythondir = $(versionedsharedir)
pkgpython_bindir = $(versionedsharedir)
gnt_python_sbindir = $(versionedsharedir)
tools_pythondir = $(versionedsharedir)
89

90
clientdir = $(pkgpythondir)/client
91
cmdlibdir = $(pkgpythondir)/cmdlib
Aaron Karper's avatar
Aaron Karper committed
92
cmdlib_clusterdir = $(pkgpythondir)/cmdlib/cluster
93
configdir = $(pkgpythondir)/config
94
hypervisordir = $(pkgpythondir)/hypervisor
95
hypervisor_hv_kvmdir = $(pkgpythondir)/hypervisor/hv_kvm
96
jqueuedir = $(pkgpythondir)/jqueue
97
storagedir = $(pkgpythondir)/storage
98
httpdir = $(pkgpythondir)/http
99
masterddir = $(pkgpythondir)/masterd
100
confddir = $(pkgpythondir)/confd
101
rapidir = $(pkgpythondir)/rapi
102
rpcdir = $(pkgpythondir)/rpc
103
rpc_stubdir = $(pkgpythondir)/rpc/stub
104
serverdir = $(pkgpythondir)/server
105
watcherdir = $(pkgpythondir)/watcher
106
impexpddir = $(pkgpythondir)/impexpd
107
utilsdir = $(pkgpythondir)/utils
108
toolsdir = $(pkglibdir)/tools
109
iallocatorsdir = $(pkglibdir)/iallocators
110
pytoolsdir = $(pkgpythondir)/tools
111
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
112
ifupdir = $(sysconfdir)/ganeti
113

114 115 116 117 118 119
if USE_BACKUP_DIR
backup_dir = $(BACKUP_DIR)
else
backup_dir = $(localstatedir)/lib
endif

120
SYMLINK_TARGET_DIRS = \
121
	$(sysconfdir)/ganeti \
122
	$(libdir)/ganeti/iallocators \
123 124
	$(libdir)/ganeti/tools \
	$(prefix)/share/ganeti \
Jose A. Lopes's avatar
Jose A. Lopes committed
125 126 127 128 129
	$(BINDIR) \
	$(SBINDIR) \
	$(MANDIR)/man1 \
	$(MANDIR)/man7 \
	$(MANDIR)/man8
130

131 132 133
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

134
HS_DIRS = \
Iustin Pop's avatar
Iustin Pop committed
135 136 137
	src \
	src/Ganeti \
	src/Ganeti/Confd \
138
	src/Ganeti/Curl \
139
	src/Ganeti/Cpu \
Iustin Pop's avatar
Iustin Pop committed
140
	src/Ganeti/DataCollectors \
141
	src/Ganeti/Daemon \
142
	src/Ganeti/Hs2Py \
Iustin Pop's avatar
Iustin Pop committed
143 144
	src/Ganeti/HTools \
	src/Ganeti/HTools/Backend \
145
	src/Ganeti/HTools/Cluster \
Iustin Pop's avatar
Iustin Pop committed
146
	src/Ganeti/HTools/Program \
147
	src/Ganeti/HTools/Tags \
148 149
	src/Ganeti/Hypervisor \
	src/Ganeti/Hypervisor/Xen \
150
	src/Ganeti/JQScheduler \
151
	src/Ganeti/JQueue \
152
	src/Ganeti/Locking \
153
	src/Ganeti/Logging \
154
	src/Ganeti/MaintD \
155
	src/Ganeti/Monitoring \
156
	src/Ganeti/Metad \
157
	src/Ganeti/Objects \
Klaus Aehlig's avatar
Klaus Aehlig committed
158
	src/Ganeti/OpCodes \
Iustin Pop's avatar
Iustin Pop committed
159
	src/Ganeti/Query \
160 161 162
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
163
	src/Ganeti/Storage/Lvm \
164
	src/Ganeti/THH \
165
	src/Ganeti/Utils \
166
	src/Ganeti/WConfd \
167 168 169
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
170 171 172
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
173
	test/hs/Test/Ganeti/Storage/Lvm \
174 175 176
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
177 178
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
179
	test/hs/Test/Ganeti/JQueue \
180
	test/hs/Test/Ganeti/Locking \
181
	test/hs/Test/Ganeti/Objects \
182
	test/hs/Test/Ganeti/Query \
183
	test/hs/Test/Ganeti/THH \
184 185
	test/hs/Test/Ganeti/Utils \
	test/hs/Test/Ganeti/WConfd
186

187 188 189
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

190
DIRS = \
191
	$(HS_DIRS) \
192
	autotools \
193
	cabal \
194 195
	daemons \
	devel \
196
	devel/data \
197
	doc \
198
	doc/css \
199
	doc/examples \
200
	doc/examples/gnt-debug \
201
	doc/examples/hooks \
202
	doc/examples/systemd \
203
	doc/users \
204 205 206
	test/data/htools \
	test/data/htools/rapi \
	test/hs/shelltests \
207
	test/autotools \
208
	lib \
209
	lib/build \
210
	lib/client \
211
	lib/cmdlib \
Aaron Karper's avatar
Aaron Karper committed
212
	lib/cmdlib/cluster \
213
	lib/confd \
214
	lib/config \
215
	lib/jqueue \
216
	lib/http \
217
	lib/hypervisor \
218
	lib/hypervisor/hv_kvm \
219
	lib/impexpd \
220
	lib/masterd \
221
	lib/rapi \
222
	lib/rpc \
223
	lib/rpc/stub \
224
	lib/server \
225
	lib/storage \
226
	lib/tools \
227
	lib/utils \
228
	lib/watcher \
229 230
	man \
	qa \
231
	qa/patch \
232 233
	test \
	test/data \
234
	test/data/bdev-rbd \
Agata Murawska's avatar
Agata Murawska committed
235
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
236
	test/data/ovfdata/other \
237 238 239 240 241 242 243 244 245 246 247 248
	test/data/cgroup_root \
        test/data/cgroup_root/memory \
        test/data/cgroup_root/memory/lxc \
        test/data/cgroup_root/memory/lxc/instance1 \
        test/data/cgroup_root/cpuset \
        test/data/cgroup_root/cpuset/some_group \
        test/data/cgroup_root/cpuset/some_group/lxc \
        test/data/cgroup_root/cpuset/some_group/lxc/instance1 \
        test/data/cgroup_root/devices \
        test/data/cgroup_root/devices/some_group \
        test/data/cgroup_root/devices/some_group/lxc \
        test/data/cgroup_root/devices/some_group/lxc/instance1 \
249
	test/py \
250
	test/py/testutils \
251 252
	test/py/cmdlib \
	test/py/cmdlib/testsupport \
253 254
	tools

255
ALL_APIDOC_HS_DIRS = \
256
	$(APIDOC_HS_DIR) \
257
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
258 259 260 261 262

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
263
	$(APIDOC_PY_DIR) \
264 265
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
266
	$(COVERAGE_PY_DIR) \
267
	.hpc
268 269 270

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
271
	apps \
272
	dist \
273 274
	doc/html \
	doc/man-html
275 276 277 278

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
279
	doc/html/_* \
280
	doc/man-html/_* \
281
	tools/shebang \
Iustin Pop's avatar
Iustin Pop committed
282
	autom4te.cache
283

284 285 286 287 288 289 290 291
# 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

292
MAINTAINERCLEANFILES = \
293
	$(maninput) \
294
	doc/install-quick.rst \
295
	doc/news.rst \
296
	doc/upgrade.rst \
297
	vcs-version
298

299
maintainer-clean-local:
300
	rm -rf $(BUILDTIME_DIRS)
301

302
CLEANFILES = \
303
	$(addsuffix /*.py[co],$(DIRS)) \
304 305
	$(addsuffix /*.hi,$(HS_DIRS)) \
	$(addsuffix /*.o,$(HS_DIRS)) \
306 307
	$(addsuffix /*.$(HTEST_SUFFIX)_hi,$(HS_DIRS)) \
	$(addsuffix /*.$(HTEST_SUFFIX)_o,$(HS_DIRS)) \
308
	$(HASKELL_PACKAGE_VERSIONS_FILE) \
309
	$(CABAL_EXECUTABLES_APPS_STAMPS) \
310
	empty-cabal-config \
311
	ganeti.cabal \
312 313
	$(HASKELL_PACKAGE_IDS_FILE) \
	$(HASKELL_PACKAGE_VERSIONS_FILE) \
314 315
	Makefile.ghc \
	Makefile.ghc.bak \
316
	$(PYTHON_BOOTSTRAP) \
317
	$(gnt_python_sbin_SCRIPTS) \
318
	epydoc.conf \
319
	$(REPLACE_VARS_SED) \
320
	$(SHELL_ENV_INIT) \
321
	daemons/daemon-util \
322
	daemons/ganeti-cleaner \
323 324
	devel/squeeze-amd64.tar.gz \
	devel/squeeze-amd64.conf \
325 326
	$(mandocrst) \
	doc/manpages-enabled.rst \
327
	$(BUILT_EXAMPLES) \
328
	doc/examples/bash_completion \
329
	doc/examples/bash_completion-debug \
330
	$(userspecs) \
331
	lib/_generated_rpc.py \
332 333
	$(man_MANS) \
	$(manhtml) \
334
	tools/kvm-ifup \
335
	tools/kvm-ifup-os \
336
	tools/xen-ifup-os \
337
	tools/vif-ganeti \
338
	tools/vif-ganeti-metad \
339
	tools/net-common \
340
	tools/users-setup \
341
	tools/ssl-update \
342
	tools/vcluster-setup \
343 344
	tools/prepare-node-join \
	tools/ssh-update \
345
	$(python_scripts_shebang) \
346
	stamp-directories \
347
	stamp-srclinks \
348
	$(nodist_pkgpython_PYTHON) \
349
	$(nodist_pkgpython_rpc_stub_PYTHON) \
350
	$(gnt_scripts) \
351
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
352
	$(HS_BUILT_TEST_HELPERS) \
Iustin Pop's avatar
Iustin Pop committed
353
	src/ganeti-confd \
354
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
355
	src/ganeti-luxid \
356
	src/ganeti-maintd \
357
	src/ganeti-metad \
358
	src/ganeti-mond \
359
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
360
	doc/hs-lint.html
361

Iustin Pop's avatar
Iustin Pop committed
362
GENERATED_FILES = \
363
	$(built_base_sources) \
364
	$(built_python_sources) \
365 366
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
367

368 369
clean-local:
	rm -rf tools/shebang
370
	rm -rf apps
371
	rm -rf dist
372

373 374
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid \
	src/hconfd src/ganeti-confd
375
if ENABLE_MOND
376
HS_GENERATED_FILES += src/ganeti-mond src/ganeti-maintd
377
endif
378 379 380
if ENABLE_METADATA
HS_GENERATED_FILES += src/ganeti-metad
endif
381

382
built_base_sources = \
383 384
	stamp-directories \
	stamp-srclinks
385

386
built_python_base_sources = \
387
	lib/_constants.py \
388
	lib/_vcsversion.py \
389 390
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
391

392 393 394 395
if ENABLE_METADATA
built_python_base_sources += lib/rpc/stub/metad.py
endif

396
built_python_sources = \
397 398
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
399

400 401 402 403 404
# 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 \
405
	doc/examples/ganeti.logrotate \
406
	doc/examples/ganeti-master-role.ocf \
407
	doc/examples/ganeti-node-role.ocf \
408
	doc/examples/gnt-config-backup \
409 410 411 412 413 414
	doc/examples/hooks/ipsec \
	doc/examples/systemd/ganeti-common.service \
	doc/examples/systemd/ganeti-confd.service \
	doc/examples/systemd/ganeti-kvmd.service \
	doc/examples/systemd/ganeti-luxid.service \
	doc/examples/systemd/ganeti-metad.service \
415
	doc/examples/systemd/ganeti-maintd.service \
416 417 418 419
	doc/examples/systemd/ganeti-mond.service \
	doc/examples/systemd/ganeti-noded.service \
	doc/examples/systemd/ganeti-rapi.service \
	doc/examples/systemd/ganeti-wconfd.service
420

421
nodist_ifup_SCRIPTS = \
422 423
	tools/kvm-ifup-os \
	tools/xen-ifup-os
424

425
nodist_pkgpython_PYTHON = \
426 427 428
	$(built_python_base_sources) \
	lib/_generated_rpc.py

429 430
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
431

432 433 434 435
if ENABLE_METADATA
nodist_pkgpython_rpc_stub_PYTHON += lib/rpc/stub/metad.py
endif

436 437 438 439 440 441
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

442
noinst_PYTHON = \
443
	lib/build/__init__.py \
444 445
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
446

447 448
pkgpython_PYTHON = \
	lib/__init__.py \
449
	lib/asyncnotifier.py \
450 451 452
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
453
	lib/cli_opts.py \
454
	lib/compat.py \
455
	lib/constants.py \
456
	lib/daemon.py \
457
	lib/errors.py \
458
	lib/hooksmaster.py \
459
	lib/ht.py \
460
	lib/jstore.py \
461 462 463
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
464
	lib/metad.py \
465
	lib/netutils.py \
466
	lib/objects.py \
467
	lib/opcodes_base.py \
468
	lib/outils.py \
469
	lib/ovf.py \
470
	lib/pathutils.py \
471
	lib/qlang.py \
472
	lib/query.py \
473
	lib/rpc_defs.py \
474
	lib/runtime.py \
475 476 477
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
478
	lib/uidpool.py \
479
	lib/vcluster.py \
480
	lib/network.py \
481
	lib/wconfd.py \
482
	lib/workerpool.py
483

484
client_PYTHON = \
485
	lib/client/__init__.py \
486
	lib/client/base.py \
487
	lib/client/gnt_backup.py \
488
	lib/client/gnt_cluster.py \
489
	lib/client/gnt_debug.py \
490
	lib/client/gnt_group.py \
491
	lib/client/gnt_instance.py \
492
	lib/client/gnt_job.py \
493
	lib/client/gnt_node.py \
494
	lib/client/gnt_network.py \
495
	lib/client/gnt_os.py \
496 497
	lib/client/gnt_storage.py \
	lib/client/gnt_filter.py
498

499
cmdlib_PYTHON = \
500
	lib/cmdlib/__init__.py \
501
	lib/cmdlib/backup.py \
502
	lib/cmdlib/base.py \
503
	lib/cmdlib/common.py \
504
	lib/cmdlib/group.py \
505
	lib/cmdlib/instance.py \
506
	lib/cmdlib/instance_create.py \
507
	lib/cmdlib/instance_helpervm.py \
508
	lib/cmdlib/instance_migration.py \
509
	lib/cmdlib/instance_operation.py \
510
	lib/cmdlib/instance_query.py \
511
	lib/cmdlib/instance_set_params.py \
512
	lib/cmdlib/instance_storage.py \
513
	lib/cmdlib/instance_utils.py \
514 515 516
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
517
	lib/cmdlib/operating_system.py \
518
	lib/cmdlib/query.py \
519
	lib/cmdlib/tags.py \
520
	lib/cmdlib/test.py
521

Aaron Karper's avatar
Aaron Karper committed
522 523 524 525
cmdlib_cluster_PYTHON = \
	lib/cmdlib/cluster/__init__.py \
	lib/cmdlib/cluster/verify.py

526
config_PYTHON = \
527
	lib/config/__init__.py \
528
	lib/config/verify.py \
529 530
	lib/config/temporary_reservations.py \
	lib/config/utils.py
531

532 533 534
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
535
	lib/hypervisor/hv_chroot.py \
536
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
537
	lib/hypervisor/hv_lxc.py \
538 539
	lib/hypervisor/hv_xen.py

540
hypervisor_hv_kvm_PYTHON = \
541
  lib/hypervisor/hv_kvm/__init__.py \
542 543
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
544

545
jqueue_PYTHON = \
546 547
	lib/jqueue/__init__.py \
	lib/jqueue/exec.py
548

549 550 551 552
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
553
	lib/storage/container.py \
554 555
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
556
	lib/storage/drbd_cmdgen.py \
557
	lib/storage/extstorage.py \
558 559
	lib/storage/filestorage.py \
	lib/storage/gluster.py
560

561 562
rapi_PYTHON = \
	lib/rapi/__init__.py \
563
	lib/rapi/baserlib.py \
564
	lib/rapi/client.py \
565
	lib/rapi/client_utils.py \
566
	lib/rapi/connector.py \
567 568
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
569

570
http_PYTHON = \
571
	lib/http/__init__.py \
572
	lib/http/auth.py \
573 574
	lib/http/client.py \
	lib/http/server.py
575

576
confd_PYTHON = \
577
	lib/confd/__init__.py \
578
	lib/confd/client.py
579

580
masterd_PYTHON = \
581
	lib/masterd/__init__.py \
582
	lib/masterd/iallocator.py \
583
	lib/masterd/instance.py
584

585 586 587
impexpd_PYTHON = \
	lib/impexpd/__init__.py

588
watcher_PYTHON = \
589
	lib/watcher/__init__.py \
590 591
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
592

593
server_PYTHON = \
594
	lib/server/__init__.py \
595
	lib/server/masterd.py \
596 597
	lib/server/noded.py \
	lib/server/rapi.py
598

599 600
rpc_PYTHON = \
	lib/rpc/__init__.py \
601
	lib/rpc/client.py \
602 603 604
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
605

606 607 608
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

609 610
pytools_PYTHON = \
	lib/tools/__init__.py \
611
	lib/tools/burnin.py \
612
	lib/tools/common.py \
613
	lib/tools/ensure_dirs.py \
614
	lib/tools/node_cleanup.py \
615
	lib/tools/node_daemon_setup.py \
616
	lib/tools/prepare_node_join.py \
617
	lib/tools/ssh_update.py \
618
	lib/tools/ssl_update.py \
619
	lib/tools/cfgupgrade.py
620

621
utils_PYTHON = \
622
	lib/utils/__init__.py \
623
	lib/utils/algo.py \
624
	lib/utils/filelock.py \
625
	lib/utils/hash.py \
626
	lib/utils/io.py \
627
	lib/utils/livelock.py \
628
	lib/utils/log.py \
629
	lib/utils/lvm.py \
630
	lib/utils/mlock.py \
631
	lib/utils/nodesetup.py \
632
	lib/utils/process.py \
633
	lib/utils/retry.py \
634
	lib/utils/security.py \
635
	lib/utils/storage.py \
636
	lib/utils/text.py \
637
	lib/utils/tags.py \
638
	lib/utils/version.py \
639
	lib/utils/wrapper.py \
640 641
	lib/utils/x509.py \
	lib/utils/bitarrays.py
642

643
docinput = \
644
	doc/admin.rst \
645
	doc/cluster-keys-replacement.rst \
646
	doc/cluster-merge.rst \
647 648
	doc/conf.py \
	doc/css/style.css \
649
	doc/design-2.0.rst \
650
	doc/design-2.1.rst \
651
	doc/design-2.2.rst \
652
	doc/design-2.3.rst \
653
	doc/design-2.4.rst \
654
	doc/design-2.5.rst \
655
	doc/design-2.6.rst \
656
	doc/design-2.7.rst \
657
	doc/design-2.8.rst \
658
	doc/design-2.9.rst \
659
	doc/design-2.10.rst \
660
	doc/design-2.11.rst \
661
	doc/design-2.12.rst \
662
	doc/design-2.13.rst \
Klaus Aehlig's avatar
Klaus Aehlig committed
663
	doc/design-2.14.rst \
Helga Velroyen's avatar
Helga Velroyen committed
664
	doc/design-2.15.rst \
665
	doc/design-allocation-efficiency.rst \
666 667
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
668
	doc/design-ceph-ganeti-support.rst \
669
	doc/design-configlock.rst \
670
	doc/design-chained-jobs.rst \
671
	doc/design-cmdlib-unittests.rst \
672
	doc/design-cpu-pinning.rst \
673
	doc/design-cpu-speed.rst \
674
	doc/design-daemons.rst \
Helga Velroyen's avatar
Helga Velroyen committed
675
	doc/design-dedicated-allocation.rst \
676
	doc/design-device-uuid-name.rst \
677
	doc/design-disk-conversion.rst \
678
	doc/design-disks.rst \
679
	doc/design-draft.rst \
680
	doc/design-file-based-disks-ownership.rst \
681
	doc/design-file-based-storage.rst \
682
	doc/design-glusterfs-ganeti-support.rst \
683 684 685
	doc/design-hotplug.rst \
	doc/design-hroller.rst \
	doc/design-hsqueeze.rst \
686
	doc/design-htools-2.3.rst \
687
	doc/design-http-server.rst \
688
	doc/design-hugepages-support.rst \
689
	doc/design-ifdown.rst \
690
	doc/design-impexp2.rst \
691
	doc/design-internal-shutdown.rst \
692
	doc/design-kvmd.rst \
693
	doc/design-location.rst \
694
	doc/design-linuxha.rst \
695
	doc/design-lu-generated-jobs.rst \
696
	doc/design-migration-speed-hbal.rst \
697
	doc/design-monitoring-agent.rst \
698
	doc/design-move-instance-improvements.rst \
699
	doc/design-multi-reloc.rst \
700
	doc/design-multi-storage-htools.rst \
701
	doc/design-multi-version-tests.rst \
702
	doc/design-network.rst \
703
	doc/design-network2.rst \
704
	doc/design-node-add.rst \
705
	doc/design-node-security.rst \
706
	doc/design-oob.rst \
707
	doc/design-openvswitch.rst \
708
	doc/design-opportunistic-locking.rst \
709
	doc/design-optables.rst \
710
	doc/design-os.rst \
711
	doc/design-ovf-support.rst \
712
	doc/design-partitioned.rst \
713
	doc/design-plain-redundancy.rst \
714
	doc/design-performance-tests.rst \
715 716
	doc/design-query-splitting.rst \
	doc/design-query2.rst \
717
	doc/design-query-splitting.rst \
718
	doc/design-reason-trail.rst \
719
	doc/design-repaird.rst \
720
	doc/design-reservations.rst \
721
	doc/design-resource-model.rst \
722
	doc/design-restricted-commands.rst \
723
	doc/design-shared-storage.rst \
724
	doc/design-shared-storage-redundancy.rst \
725
	doc/design-ssh-ports.rst \
726
	doc/design-storagetypes.rst \
727
	doc/design-sync-rate-throttling.rst \
728
	doc/design-systemd.rst \
729
	doc/design-upgrade.rst \
730
	doc/design-virtual-clusters.rst \
731
	doc/design-x509-ca.rst \
732
	doc/dev-codestyle.rst \
733
	doc/devnotes.rst \
734
	doc/glossary.rst \
735
	doc/hooks.rst \
736
	doc/iallocator.rst \
737
	doc/index.rst \
738
	doc/install-quick.rst \
739
	doc/install.rst \
740
	doc/locking.rst \
741
	doc/manpages-disabled.rst \
742
	doc/monitoring-query-format.rst \
743
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
744
	doc/news.rst \
745
	doc/ovfconverter.rst \
746
	doc/rapi.rst \
747
	doc/security.rst \
748
	doc/upgrade.rst \
749
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
750
	doc/walkthrough.rst
751

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

755 756 757 758
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
759
if ENABLE_MOND
760
HS_MYEXECLIB_PROGS=src/mon-collector
761 762 763
else
HS_MYEXECLIB_PROGS=
endif
764

765
# Haskell programs to be compiled by "make really-all"
766
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
767
	src/ganeti-kvmd \
768
	src/ganeti-wconfd \
769
	src/hconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
770
	src/hluxid \
771
	src/hs2py \
772
	src/rpc-test
773
if ENABLE_MOND
774
HS_COMPILE_PROGS += src/ganeti-mond src/ganeti-maintd
775
endif
776 777 778
if ENABLE_METADATA
HS_COMPILE_PROGS += src/ganeti-metad
endif
779 780 781 782

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

783
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
784
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
785

786 787 788 789
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
790 791
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
792
	$(HS_COMPILE_PROGS)
793

794 795
if HTEST
HS_DEFAULT_PROGS += test/hs/htest
796 797
else
EXTRA_DIST += test/hs/htest.hs
798 799
endif

800 801
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

802 803 804
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

805
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
806
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
807

808
HFLAGS = \
809
	-O -Wall -isrc \
810 811
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
812
	-optP-include -optP$(HASKELL_PACKAGE_VERSIONS_FILE) \
813
	-hide-all-packages \
814
	`cat $(HASKELL_PACKAGE_IDS_FILE)` \
815
	$(GHC_BYVERSION_FLAGS)
816 817 818
if DEVELOPER_MODE
HFLAGS += -Werror
endif
819

820 821 822
HTEST_SUFFIX = hpc
HPROF_SUFFIX = prof

823 824 825 826 827 828 829 830 831 832 833
DEP_SUFFIXES =
if GHC_LE_76
DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX) -dep-suffix $(HTEST_SUFFIX)
else
# GHC >= 7.8 stopped putting underscores into -dep-suffix by itself
# (https://ghc.haskell.org/trac/ghc/ticket/9749) so we have to put them.
# It also needs -dep-suffix "" for the .o file.
DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX)_ -dep-suffix $(HTEST_SUFFIX)_ \
	-dep-suffix ""
endif

834
# GHC > 7.6 needs -dynamic-too when using Template Haskell since its
835
# ghci is switched to loading dynamic libraries by default.
836 837 838 839 840
# It must only be used in non-profiling GHC invocations.
# We also don't use it in compilations that use HTEST_SUFFIX (which are
# compiled with -fhpc) because HPC coverage doesn't interact well with
# GHCI shared lib loading (https://ghc.haskell.org/trac/ghc/ticket/9762).
HFLAGS_DYNAMIC =
841
if !GHC_LE_76
842
HFLAGS_DYNAMIC += -dynamic-too
843 844
endif

845
if HPROFILE
846 847
HPROFFLAGS = -prof -fprof-auto-top -osuf $(HPROF_SUFFIX)_o \
	-hisuf $(HPROF_SUFFIX)_hi -rtsopts
848 849 850 851 852 853 854 855 856
endif
if HCOVERAGE
HFLAGS += -fhpc
endif
if HTEST
HFLAGS += -DTEST
endif

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

860
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
861
HEXTRA =
862
# internal extra flags (used for test/hs/htest mainly)
863
HEXTRA_INT =
864 865
# combination of HEXTRA and HEXTRA_CONFIGURE
HEXTRA_COMBINED = $(HEXTRA) $(HEXTRA_CONFIGURE)
866
# exclude options for coverage reports
867
HPCEXCL = --exclude Main \
868
	--exclude Ganeti.Constants \
869
	--exclude Ganeti.HTools.QC \
870
	--exclude Ganeti.THH \
871
	--exclude Ganeti.Version \
872
	--exclude Test.Ganeti.Attoparsec \
873
	--exclude Test.Ganeti.TestCommon \
874 875
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
876
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
877
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
878

879
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
880
	src/Ganeti/BasicTypes.hs \
881
	src/Ganeti/Codec.hs \
Iustin Pop's avatar
Iustin Pop committed
882 883 884
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
885
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
886 887 888 889
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
890
	src/Ganeti/ConfigReader.hs \
891
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
892
	src/Ganeti/ConstantUtils.hs \
893 894
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
895
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
896
	src/Ganeti/Daemon.hs \
897
	src/Ganeti/Daemon/Utils.hs \
898
	src/Ganeti/DataCollectors.hs \
Iustin Pop's avatar
Iustin Pop committed
899
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
900
	src/Ganeti/DataCollectors/CPUload.hs \
901
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
902
	src/Ganeti/DataCollectors/Drbd.hs \
903 904
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
905
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
906
	src/Ganeti/DataCollectors/Program.hs \
907
	src/Ganeti/DataCollectors/Types.hs \
908
	src/Ganeti/DataCollectors/XenCpuLoad.hs \
Iustin Pop's avatar
Iustin Pop committed
909
	src/Ganeti/Errors.hs \
910
	src/Ganeti/HTools/AlgorithmParams.hs \
Iustin Pop's avatar
Iustin Pop committed
911 912
	src/Ganeti/HTools/Backend/IAlloc.hs \
	src/Ganeti/HTools/Backend/Luxi.hs \
913
	src/Ganeti/HTools/Backend/MonD.hs \
Iustin Pop's avatar
Iustin Pop committed
914 915 916 917 918
	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 \
919
	src/Ganeti/HTools/Cluster/AllocatePrimitives.hs \
920
	src/Ganeti/HTools/Cluster/AllocateSecondary.hs \
921
	src/Ganeti/HTools/Cluster/AllocationSolution.hs \
922
	src/Ganeti/HTools/Cluster/Evacuate.hs \
923
	src/Ganeti/HTools/Cluster/Metrics.hs \
924
	src/Ganeti/HTools/Cluster/Moves.hs \
925
	src/Ganeti/HTools/Cluster/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
926
	src/Ganeti/HTools/Container.hs \
927
	src/Ganeti/HTools/Dedicated.hs \
Iustin Pop's avatar
Iustin Pop committed
928
	src/Ganeti/HTools/ExtLoader.hs \
929
	src/Ganeti/HTools/GlobalN1.hs \
Iustin Pop's avatar
Iustin Pop committed
930 931 932 933
	src/Ganeti/HTools/Graph.hs \
	src/Ganeti/HTools/Group.hs \
	src/Ganeti/HTools/Instance.hs \
	src/Ganeti/HTools/Loader.hs \
934
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
935 936 937
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
938
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
939 940 941 942 943
	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 \
944
	src/Ganeti/HTools/Program/Hsqueeze.hs \
Iustin Pop's avatar
Iustin Pop committed
945