Makefile.am 90.6 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 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
Klaus Aehlig's avatar
Klaus Aehlig committed
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
hypervisordir = $(pkgpythondir)/hypervisor
94
hypervisor_hv_kvmdir = $(pkgpythondir)/hypervisor/hv_kvm
95
jqueuedir = $(pkgpythondir)/jqueue
96
storagedir = $(pkgpythondir)/storage
97
httpdir = $(pkgpythondir)/http
98
masterddir = $(pkgpythondir)/masterd
99
confddir = $(pkgpythondir)/confd
100
rapidir = $(pkgpythondir)/rapi
101
rpcdir = $(pkgpythondir)/rpc
102
rpc_stubdir = $(pkgpythondir)/rpc/stub
103
serverdir = $(pkgpythondir)/server
104
watcherdir = $(pkgpythondir)/watcher
105
impexpddir = $(pkgpythondir)/impexpd
106
utilsdir = $(pkgpythondir)/utils
107
toolsdir = $(pkglibdir)/tools
108
iallocatorsdir = $(pkglibdir)/iallocators
109
pytoolsdir = $(pkgpythondir)/tools
110
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
111
ifupdir = $(sysconfdir)/ganeti
112

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

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

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

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

183 184 185
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

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

249
ALL_APIDOC_HS_DIRS = \
250
	$(APIDOC_HS_DIR) \
251
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
252 253 254 255 256

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
257
	$(APIDOC_PY_DIR) \
258 259
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
260
	$(COVERAGE_PY_DIR) \
261
	.hpc
262 263 264

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
265
	apps \
266
	dist \
267 268
	doc/html \
	doc/man-html
269 270 271 272

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
273
	doc/html/_* \
274
	doc/man-html/_* \
275
	tools/shebang \
Iustin Pop's avatar
Iustin Pop committed
276
	autom4te.cache
277

278 279 280 281 282 283 284 285
# 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
286
MAINTAINERCLEANFILES = \
287
	$(maninput) \
288
	doc/install-quick.rst \
289
	doc/news.rst \
290
	doc/upgrade.rst \
291
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
292

293
maintainer-clean-local:
294
	rm -rf $(BUILDTIME_DIRS)
295

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

Iustin Pop's avatar
Iustin Pop committed
353
GENERATED_FILES = \
354
	$(built_base_sources) \
355
	$(built_python_sources) \
356 357
	$(PYTHON_BOOTSTRAP) \
	$(gnt_python_sbin_SCRIPTS)
358

359 360
clean-local:
	rm -rf tools/shebang
361
	rm -rf apps
362
	rm -rf dist
363

364
HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
365
if ENABLE_CONFD
366
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
367
endif
368 369 370
if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
371 372 373
if ENABLE_METADATA
HS_GENERATED_FILES += src/ganeti-metad
endif
374

375
built_base_sources = \
376 377
	stamp-directories \
	stamp-srclinks
378

379
built_python_base_sources = \
380
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
381
	lib/_vcsversion.py \
382 383
	lib/opcodes.py \
	lib/rpc/stub/wconfd.py
384

385
built_python_sources = \
386 387
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
388

389 390
# Generating the RPC wrappers depends on many things, so make sure
# it's built at the end of the built sources
391 392
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)

393 394 395 396 397
# 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 \
398
	doc/examples/ganeti.logrotate \
399
	doc/examples/ganeti-master-role.ocf \
400
	doc/examples/ganeti-node-role.ocf \
401
	doc/examples/gnt-config-backup \
402 403 404 405 406 407 408 409 410 411
	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 \
	doc/examples/systemd/ganeti-mond.service \
	doc/examples/systemd/ganeti-noded.service \
	doc/examples/systemd/ganeti-rapi.service \
	doc/examples/systemd/ganeti-wconfd.service
412

413
dist_ifup_SCRIPTS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
414 415
	tools/kvm-ifup-os \
	tools/xen-ifup-os
416

417
nodist_pkgpython_PYTHON = \
418 419 420
	$(built_python_base_sources) \
	lib/_generated_rpc.py

421 422
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
423

424 425 426 427 428 429
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

430
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
431
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
432 433
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
434

435 436
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
437
	lib/asyncnotifier.py \
438 439 440
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
441
	lib/cli_opts.py \
442
	lib/compat.py \
443 444
	lib/config.py \
	lib/constants.py \
445
	lib/daemon.py \
446
	lib/errors.py \
447
	lib/hooksmaster.py \
448
	lib/ht.py \
449
	lib/jstore.py \
450 451 452
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
453
	lib/netutils.py \
454
	lib/objects.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
455
	lib/opcodes_base.py \
456
	lib/outils.py \
457
	lib/ovf.py \
458
	lib/pathutils.py \
459
	lib/qlang.py \
460
	lib/query.py \
461
	lib/rpc_defs.py \
462
	lib/runtime.py \
463 464 465
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
466
	lib/uidpool.py \
467
	lib/vcluster.py \
468
	lib/network.py \
469
	lib/wconfd.py \
470
	lib/workerpool.py
471

472
client_PYTHON = \
473
	lib/client/__init__.py \
474
	lib/client/base.py \
475
	lib/client/gnt_backup.py \
476
	lib/client/gnt_cluster.py \
477
	lib/client/gnt_debug.py \
478
	lib/client/gnt_group.py \
479
	lib/client/gnt_instance.py \
480
	lib/client/gnt_job.py \
481
	lib/client/gnt_node.py \
482
	lib/client/gnt_network.py \
483
	lib/client/gnt_os.py \
484 485
	lib/client/gnt_storage.py \
	lib/client/gnt_filter.py
486

487
cmdlib_PYTHON = \
488
	lib/cmdlib/__init__.py \
489
	lib/cmdlib/backup.py \
490
	lib/cmdlib/base.py \
491
	lib/cmdlib/common.py \
492
	lib/cmdlib/group.py \
493
	lib/cmdlib/instance.py \
494
	lib/cmdlib/instance_create.py \
495
	lib/cmdlib/instance_migration.py \
496
	lib/cmdlib/instance_operation.py \
497
	lib/cmdlib/instance_query.py \
498
	lib/cmdlib/instance_set_params.py \
499
	lib/cmdlib/instance_storage.py \
500
	lib/cmdlib/instance_utils.py \
501 502 503
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
504
	lib/cmdlib/operating_system.py \
505
	lib/cmdlib/query.py \
506
	lib/cmdlib/tags.py \
507
	lib/cmdlib/test.py
508

Aaron Karper's avatar
Aaron Karper committed
509 510 511 512
cmdlib_cluster_PYTHON = \
	lib/cmdlib/cluster/__init__.py \
	lib/cmdlib/cluster/verify.py

513 514 515
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
516
	lib/hypervisor/hv_chroot.py \
517
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
518
	lib/hypervisor/hv_lxc.py \
519 520
	lib/hypervisor/hv_xen.py

521
hypervisor_hv_kvm_PYTHON = \
522
  lib/hypervisor/hv_kvm/__init__.py \
523 524
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
525

526
jqueue_PYTHON = \
527 528
	lib/jqueue/__init__.py \
	lib/jqueue/exec.py
529

530 531 532 533
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
534
	lib/storage/container.py \
535 536
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
537
	lib/storage/drbd_cmdgen.py \
538
	lib/storage/extstorage.py \
539 540
	lib/storage/filestorage.py \
	lib/storage/gluster.py
541

542 543
rapi_PYTHON = \
	lib/rapi/__init__.py \
544
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
545
	lib/rapi/client.py \
546
	lib/rapi/client_utils.py \
547
	lib/rapi/connector.py \
548 549
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
550

551
http_PYTHON = \
552
	lib/http/__init__.py \
553
	lib/http/auth.py \
554 555
	lib/http/client.py \
	lib/http/server.py
556

557
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
558
	lib/confd/__init__.py \
559
	lib/confd/client.py
560

561
masterd_PYTHON = \
562
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
563
	lib/masterd/iallocator.py \
564
	lib/masterd/instance.py
565

566 567 568
impexpd_PYTHON = \
	lib/impexpd/__init__.py

569
watcher_PYTHON = \
570
	lib/watcher/__init__.py \
571 572
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
573

574
server_PYTHON = \
575
	lib/server/__init__.py \
576
	lib/server/masterd.py \
577 578
	lib/server/noded.py \
	lib/server/rapi.py
579

580 581
rpc_PYTHON = \
	lib/rpc/__init__.py \
582
	lib/rpc/client.py \
583 584 585
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
586

587 588 589
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

590 591
pytools_PYTHON = \
	lib/tools/__init__.py \
592
	lib/tools/burnin.py \
593
	lib/tools/ensure_dirs.py \
594
	lib/tools/node_cleanup.py \
595
	lib/tools/node_daemon_setup.py \
596 597 598
	lib/tools/prepare_node_join.py \
	lib/tools/common.py \
	lib/tools/ssh_update.py
599

600
utils_PYTHON = \
601
	lib/utils/__init__.py \
602
	lib/utils/algo.py \
603
	lib/utils/filelock.py \
604
	lib/utils/hash.py \
605
	lib/utils/io.py \
606
	lib/utils/livelock.py \
607
	lib/utils/log.py \
608
	lib/utils/lvm.py \
609
	lib/utils/mlock.py \
610
	lib/utils/nodesetup.py \
611
	lib/utils/process.py \
612
	lib/utils/retry.py \
613
	lib/utils/security.py \
614
	lib/utils/storage.py \
615
	lib/utils/text.py \
616
	lib/utils/version.py \
617 618
	lib/utils/wrapper.py \
	lib/utils/x509.py
619

620
docinput = \
621
	doc/admin.rst \
622
	doc/cluster-keys-replacement.rst \
Iustin Pop's avatar
Iustin Pop committed
623
	doc/cluster-merge.rst \
624 625
	doc/conf.py \
	doc/css/style.css \
626
	doc/design-2.0.rst \
627
	doc/design-2.1.rst \
628
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
629
	doc/design-2.3.rst \
630
	doc/design-2.4.rst \
631
	doc/design-2.5.rst \
632
	doc/design-2.6.rst \
633
	doc/design-2.7.rst \
634
	doc/design-2.8.rst \
Klaus Aehlig's avatar
Klaus Aehlig committed
635
	doc/design-2.9.rst \
636
	doc/design-2.10.rst \
637
	doc/design-2.11.rst \
638
	doc/design-2.12.rst \
Iustin Pop's avatar
Iustin Pop committed
639 640
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
641
	doc/design-ceph-ganeti-support.rst \
642
	doc/design-configlock.rst \
Iustin Pop's avatar
Iustin Pop committed
643
	doc/design-chained-jobs.rst \
644
	doc/design-cmdlib-unittests.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
645
	doc/design-cpu-pinning.rst \
646
	doc/design-cpu-speed.rst \
647
	doc/design-daemons.rst \
648
	doc/design-device-uuid-name.rst \
649
	doc/design-disk-conversion.rst \
650
	doc/design-disks.rst \
Iustin Pop's avatar
Iustin Pop committed
651
	doc/design-draft.rst \
652
	doc/design-file-based-storage.rst \
653
	doc/design-glusterfs-ganeti-support.rst \
654 655 656
	doc/design-hotplug.rst \
	doc/design-hroller.rst \
	doc/design-hsqueeze.rst \
Iustin Pop's avatar
Iustin Pop committed
657
	doc/design-htools-2.3.rst \
658
	doc/design-http-server.rst \
659
	doc/design-hugepages-support.rst \
660
	doc/design-ifdown.rst \
661
	doc/design-impexp2.rst \
662
	doc/design-internal-shutdown.rst \
663
	doc/design-kvmd.rst \
664
	doc/design-location.rst \
665
	doc/design-linuxha.rst \
666 667
	doc/design-lu-generated-jobs.rst \
	doc/design-monitoring-agent.rst \
668
	doc/design-move-instance-improvements.rst \
669
	doc/design-multi-reloc.rst \
670
	doc/design-multi-version-tests.rst \
671
	doc/design-network.rst \
672
	doc/design-network2.rst \
673
	doc/design-node-add.rst \
674
	doc/design-node-security.rst \
Iustin Pop's avatar
Iustin Pop committed
675
	doc/design-oob.rst \
676
	doc/design-openvswitch.rst \
677
	doc/design-opportunistic-locking.rst \
678
	doc/design-optables.rst \
679
	doc/design-os.rst \
680
	doc/design-ovf-support.rst \
Iustin Pop's avatar
Iustin Pop committed
681
	doc/design-partitioned.rst \
682
	doc/design-performance-tests.rst \
Iustin Pop's avatar
Iustin Pop committed
683 684
	doc/design-query-splitting.rst \
	doc/design-query2.rst \
685
	doc/design-query-splitting.rst \
686
	doc/design-reason-trail.rst \
687
	doc/design-reservations.rst \
688
	doc/design-resource-model.rst \
689
	doc/design-restricted-commands.rst \
690
	doc/design-shared-storage.rst \
691
	doc/design-ssh-ports.rst \
692
	doc/design-storagetypes.rst \
693
	doc/design-systemd.rst \
694
	doc/design-upgrade.rst \
695
	doc/design-virtual-clusters.rst \
Iustin Pop's avatar
Iustin Pop committed
696
	doc/design-x509-ca.rst \
697
	doc/dev-codestyle.rst \
698
	doc/devnotes.rst \
699
	doc/glossary.rst \
700
	doc/hooks.rst \
701
	doc/iallocator.rst \
702
	doc/index.rst \
703
	doc/install-quick.rst \
704
	doc/install.rst \
705
	doc/locking.rst \
706
	doc/manpages-disabled.rst \
707
	doc/monitoring-query-format.rst \
708
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
709
	doc/news.rst \
710
	doc/ovfconverter.rst \
711
	doc/rapi.rst \
712
	doc/security.rst \
713
	doc/upgrade.rst \
714
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
715
	doc/walkthrough.rst
716

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

720 721 722 723
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
724
if ENABLE_MOND
725
HS_MYEXECLIB_PROGS=src/mon-collector
726 727 728
else
HS_MYEXECLIB_PROGS=
endif
729

730
# Haskell programs to be compiled by "make really-all"
731
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
732
	src/ganeti-kvmd \
Petr Pudlak's avatar
Petr Pudlak committed
733
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
734
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
735
	src/hs2py \
736
	src/rpc-test
737 738 739 740 741 742
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
743 744 745
if ENABLE_METADATA
HS_COMPILE_PROGS += src/ganeti-metad
endif
746 747 748 749

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

750
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
751
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
752

753 754 755 756
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
757 758
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
759
	$(HS_COMPILE_PROGS)
760

761 762
if HTEST
HS_DEFAULT_PROGS += test/hs/htest
763 764
else
EXTRA_DIST += test/hs/htest.hs
765 766
endif

767 768
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

769 770 771
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

772
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
773
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
774

775
HFLAGS = \
776
	-O -Wall -isrc \
777 778 779
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)
780 781 782
if DEVELOPER_MODE
HFLAGS += -Werror
endif
783

784 785 786
HTEST_SUFFIX = hpc
HPROF_SUFFIX = prof

787 788 789 790 791 792 793 794 795 796 797
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

798
# GHC > 7.6 needs -dynamic-too when using Template Haskell since its
799
# ghci is switched to loading dynamic libraries by default.
800 801 802 803 804
# 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 =
805
if !GHC_LE_76
806
HFLAGS_DYNAMIC += -dynamic-too
Niklas Hambuechen's avatar