Makefile.am 77 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 \
Iustin Pop's avatar
Iustin Pop committed
137
	src/Ganeti/Query \
138 139 140
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
141
	src/Ganeti/Storage/Lvm \
142
	src/Ganeti/THH \
143
	src/Ganeti/Utils \
Petr Pudlak's avatar
Petr Pudlak committed
144
	src/Ganeti/WConfd \
145 146 147
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
148 149 150
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
151
	test/hs/Test/Ganeti/Storage/Lvm \
152 153 154
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
155 156
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
157
	test/hs/Test/Ganeti/Locking \
Petr Pudlak's avatar
Petr Pudlak committed
158 159
	test/hs/Test/Ganeti/Query \
	test/hs/Test/Ganeti/THH
160

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

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

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

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

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

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

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

253
maintainer-clean-local:
254
	rm -rf $(BUILDTIME_DIRS)
255

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

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

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

317
built_base_sources = \
318 319
	stamp-directories \
	stamp-srclinks
320

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

327
built_python_sources = \
328 329
	$(nodist_pkgpython_PYTHON) \
	$(nodist_pkgpython_rpc_stub_PYTHON)
330

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

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

346
dist_ifup_SCRIPTS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
347 348
	tools/kvm-ifup-os \
	tools/xen-ifup-os
349

350
nodist_pkgpython_PYTHON = \
351 352 353
	$(built_python_base_sources) \
	lib/_generated_rpc.py

354 355
nodist_pkgpython_rpc_stub_PYTHON = \
	lib/rpc/stub/wconfd.py
356

357 358 359 360 361 362
nodist_pkgpython_bin_SCRIPTS = \
	$(nodist_pkglib_python_scripts)

pkgpython_bin_SCRIPTS = \
	$(pkglib_python_scripts)

363
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
364
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
365 366
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
367

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

404
client_PYTHON = \
405
	lib/client/__init__.py \
406
	lib/client/base.py \
407
	lib/client/gnt_backup.py \
408
	lib/client/gnt_cluster.py \
409
	lib/client/gnt_debug.py \
410
	lib/client/gnt_group.py \
411
	lib/client/gnt_instance.py \
412
	lib/client/gnt_job.py \
413
	lib/client/gnt_node.py \
414
	lib/client/gnt_network.py \
415 416
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
417

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

439 440 441
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
442
	lib/hypervisor/hv_chroot.py \
443
	lib/hypervisor/hv_fake.py \
Iustin Pop's avatar
Iustin Pop committed
444
	lib/hypervisor/hv_lxc.py \
445 446
	lib/hypervisor/hv_xen.py

447
hypervisor_hv_kvm_PYTHON = \
448
  lib/hypervisor/hv_kvm/__init__.py \
449 450
  lib/hypervisor/hv_kvm/monitor.py \
  lib/hypervisor/hv_kvm/netdev.py
451

452
jqueue_PYTHON = \
453 454
	lib/jqueue/__init__.py \
	lib/jqueue/exec.py
455

456 457 458 459
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
460
	lib/storage/container.py \
461 462
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
463
	lib/storage/drbd_cmdgen.py \
Santi Raffa's avatar
Santi Raffa committed
464 465
	lib/storage/filestorage.py \
	lib/storage/gluster.py
466

467 468
rapi_PYTHON = \
	lib/rapi/__init__.py \
469
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
470
	lib/rapi/client.py \
471
	lib/rapi/client_utils.py \
472
	lib/rapi/connector.py \
473 474
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
475

476
http_PYTHON = \
477
	lib/http/__init__.py \
478
	lib/http/auth.py \
479 480
	lib/http/client.py \
	lib/http/server.py
481

Guido Trotter's avatar
Guido Trotter committed
482
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
483
	lib/confd/__init__.py \
484
	lib/confd/client.py
485

Michael Hanselmann's avatar
Michael Hanselmann committed
486
masterd_PYTHON = \
487
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
488
	lib/masterd/iallocator.py \
489
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
490

491 492 493
impexpd_PYTHON = \
	lib/impexpd/__init__.py

494
watcher_PYTHON = \
495
	lib/watcher/__init__.py \
496 497
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
498

499
server_PYTHON = \
500
	lib/server/__init__.py \
501
	lib/server/masterd.py \
502 503
	lib/server/noded.py \
	lib/server/rapi.py
504

505 506
rpc_PYTHON = \
	lib/rpc/__init__.py \
507
	lib/rpc/client.py \
508 509 510
	lib/rpc/errors.py \
	lib/rpc/node.py \
	lib/rpc/transport.py
511

512 513 514
rpc_stub_PYTHON = \
	lib/rpc/stub/__init__.py

515 516
pytools_PYTHON = \
	lib/tools/__init__.py \
517
	lib/tools/burnin.py \
518
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
519
	lib/tools/node_cleanup.py \
520
	lib/tools/node_daemon_setup.py \
521
	lib/tools/prepare_node_join.py
522

523
utils_PYTHON = \
524
	lib/utils/__init__.py \
525
	lib/utils/algo.py \
526
	lib/utils/filelock.py \
527
	lib/utils/hash.py \
528
	lib/utils/io.py \
529
	lib/utils/livelock.py \
530
	lib/utils/log.py \
531
	lib/utils/lvm.py \
532
	lib/utils/mlock.py \
533
	lib/utils/nodesetup.py \
534
	lib/utils/process.py \
535
	lib/utils/retry.py \
536
	lib/utils/security.py \
Helga Velroyen's avatar
Helga Velroyen committed
537
	lib/utils/storage.py \
538
	lib/utils/text.py \
539
	lib/utils/version.py \
540 541
	lib/utils/wrapper.py \
	lib/utils/x509.py
542

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

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

630 631 632 633
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
634
if ENABLE_MOND
635
HS_MYEXECLIB_PROGS=src/mon-collector
636 637 638
else
HS_MYEXECLIB_PROGS=
endif
639

640
# Haskell programs to be compiled by "make really-all"
641
HS_COMPILE_PROGS = \
Jose A. Lopes's avatar
Jose A. Lopes committed
642
	src/ganeti-kvmd \
Jose A. Lopes's avatar
Jose A. Lopes committed
643
	src/ganeti-metad \
Petr Pudlak's avatar
Petr Pudlak committed
644
	src/ganeti-wconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
645
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
646
	src/hs2py \
647
	src/rpc-test
648 649 650 651 652 653
if ENABLE_CONFD
HS_COMPILE_PROGS += src/hconfd
endif
if ENABLE_MOND
HS_COMPILE_PROGS += src/ganeti-mond
endif
654 655 656 657

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

658
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
659
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
660

661 662 663 664
# Haskell programs that cannot be disabled at configure (e.g., unlike
# 'mon-collector')
HS_DEFAULT_PROGS = \
	$(HS_BIN_PROGS) \
665 666
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
667
	test/hs/htest \
668
	$(HS_COMPILE_PROGS)
669

670 671
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)

672 673 674
HS_TEST_PROGS = $(filter test/%,$(HS_ALL_PROGS))
HS_SRC_PROGS = $(filter-out test/%,$(HS_ALL_PROGS))

675
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
676
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
677

678
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
679
	-O -Wall -Werror -isrc \
680 681 682 683
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
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

700
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
701
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
702
# internal extra flags (used for test/hs/htest mainly)
703
HEXTRA_INT =
704
# exclude options for coverage reports
705
HPCEXCL = --exclude Main \
706
	--exclude Ganeti.Constants \
707
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
708
	--exclude Ganeti.THH \
709
	--exclude Ganeti.Version \
710
	--exclude Test.Ganeti.Attoparsec \
711
	--exclude Test.Ganeti.TestCommon \
712 713
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
714
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
715
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
716

717
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
718
	src/Ganeti/BasicTypes.hs \
719
	src/Ganeti/Codec.hs \