Makefile.am 72.5 KB
Newer Older
1 2 3 4 5
# Ganeti makefile
# - Indent with tabs only.
# - Keep files sorted; one line per file.
# - Directories in lib/ must have their own *dir variable (see hypervisor).
# - All directories must be listed DIRS.
Michael Hanselmann's avatar
Michael Hanselmann committed
6
# - Use autogen.sh to generate Makefile.in and configure script.
7 8 9 10 11

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

12 13 14 15 16
# Helper values for calling builtin functions
empty :=
space := $(empty) $(empty)
comma := ,

17 18 19
# Helper function to strip src/ and test/hs/ from a list
strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))

20 21 22
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

23 24 25
# Enable colors in shelltest
SHELLTESTARGS = "-c"

26
ACLOCAL_AMFLAGS = -I autotools
27
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
28
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
29
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
30
CHECK_HEADER = $(top_srcdir)/autotools/check-header
Iustin Pop's avatar
Iustin Pop committed
31
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
32
CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
33
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
34
CHECK_VERSION = $(top_srcdir)/autotools/check-version
35
CHECK_NEWS = $(top_srcdir)/autotools/check-news
36
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
37
DOCPP = $(top_srcdir)/autotools/docpp
38
REPLACE_VARS_SED = autotools/replace_vars.sed
39
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
40
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
41
SHELL_ENV_INIT = autotools/shell-env-init
42

43 44
# starting as of Ganeti 2.10, all files are stored in a single directory,
# with only symbolic links added at other places.
45
versiondir = $(libdir)/ganeti-$(VERSION)
46

47 48
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
49 50 51 52 53 54 55
pkglibdir = $(versiondir)$(libdir)/ganeti
myexeclibdir = $(pkglibdir)
bindir = $(versiondir)$(exec_prefix)/bin
sbindir = $(versiondir)$(exec_prefix)/sbin
mandir = $(versiondir)$(datarootdir)/man
pkgpythondir = $(versiondir)$(pythondir)/ganeti

56
clientdir = $(pkgpythondir)/client
57
cmdlibdir = $(pkgpythondir)/cmdlib
58
hypervisordir = $(pkgpythondir)/hypervisor
59
storagedir = $(pkgpythondir)/storage
60
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
61
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
62
confddir = $(pkgpythondir)/confd
63
rapidir = $(pkgpythondir)/rapi
64
serverdir = $(pkgpythondir)/server
65
watcherdir = $(pkgpythondir)/watcher
66
impexpddir = $(pkgpythondir)/impexpd
67
utilsdir = $(pkgpythondir)/utils
68
toolsdir = $(pkglibdir)/tools
69
iallocatorsdir = $(pkglibdir)/iallocators
70
pytoolsdir = $(pkgpythondir)/tools
71 72
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)

73 74 75 76 77 78 79 80 81 82 83
SYMLINK_TARGET_DIRS = \
	$(pythondir) \
	$(libdir)/ganeti/iallocators \
	$(exec_prefix)/bin \
	$(exec_prefix)/sbin \
	$(datarootdir)/man/man1 \
	$(datarootdir)/man/man7 \
	$(datarootdir)/man/man8
SYMLINK_DIRS = \
	$(pythondir)/ganeti \
	$(libdir)/ganeti/tools
84

85 86 87
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

88
HS_DIRS = \
Iustin Pop's avatar
Iustin Pop committed
89 90 91
	src \
	src/Ganeti \
	src/Ganeti/Confd \
92
	src/Ganeti/Curl \
93
	src/Ganeti/Cpu \
Iustin Pop's avatar
Iustin Pop committed
94
	src/Ganeti/DataCollectors \
95
	src/Ganeti/Hs2Py \
Iustin Pop's avatar
Iustin Pop committed
96 97 98
	src/Ganeti/HTools \
	src/Ganeti/HTools/Backend \
	src/Ganeti/HTools/Program \
99 100
	src/Ganeti/Hypervisor \
	src/Ganeti/Hypervisor/Xen \
101
	src/Ganeti/Monitoring \
Iustin Pop's avatar
Iustin Pop committed
102
	src/Ganeti/Query \
103 104 105
	src/Ganeti/Storage \
	src/Ganeti/Storage/Diskstats \
	src/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
106
	src/Ganeti/Storage/Lvm \
107 108 109
	test/hs \
	test/hs/Test \
	test/hs/Test/Ganeti \
110 111 112
	test/hs/Test/Ganeti/Storage \
	test/hs/Test/Ganeti/Storage/Diskstats \
	test/hs/Test/Ganeti/Storage/Drbd \
Michele Tartara's avatar
Michele Tartara committed
113
	test/hs/Test/Ganeti/Storage/Lvm \
114 115 116
	test/hs/Test/Ganeti/Confd \
	test/hs/Test/Ganeti/HTools \
	test/hs/Test/Ganeti/HTools/Backend \
117 118
	test/hs/Test/Ganeti/Hypervisor \
	test/hs/Test/Ganeti/Hypervisor/Xen \
119
	test/hs/Test/Ganeti/Query
120

121 122 123
# Haskell directories without the roots (src, test/hs)
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))

124
DIRS = \
125
	$(HS_DIRS) \
126 127 128
	autotools \
	daemons \
	devel \
129
	devel/data \
130
	doc \
131
	doc/css \
132
	doc/examples \
133
	doc/examples/gnt-debug \
Iustin Pop's avatar
Iustin Pop committed
134
	doc/examples/hooks \
135
	doc/users \
136 137 138
	test/data/htools \
	test/data/htools/rapi \
	test/hs/shelltests \
Michele Tartara's avatar
Michele Tartara committed
139
	test/autotools \
140
	lib \
141
	lib/build \
Iustin Pop's avatar
Iustin Pop committed
142
	lib/client \
143
	lib/cmdlib \
144
	lib/confd \
145
	lib/http \
146
	lib/hypervisor \
147
	lib/impexpd \
Michael Hanselmann's avatar
Michael Hanselmann committed
148
	lib/masterd \
149
	lib/rapi \
150
	lib/server \
151
	lib/storage \
152
	lib/tools \
153
	lib/utils \
154
	lib/watcher \
155 156 157 158
	man \
	qa \
	test \
	test/data \
159
	test/data/bdev-rbd \
Agata Murawska's avatar
Agata Murawska committed
160
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
161
	test/data/ovfdata/other \
Iustin Pop's avatar
Iustin Pop committed
162
	test/py \
163 164
	test/py/cmdlib \
	test/py/cmdlib/testsupport \
165 166
	tools

167
ALL_APIDOC_HS_DIRS = \
168
	$(APIDOC_HS_DIR) \
169
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
170 171 172 173 174

BUILDTIME_DIR_AUTOCREATE = \
	scripts \
	$(APIDOC_DIR) \
	$(ALL_APIDOC_HS_DIRS) \
Iustin Pop's avatar
Iustin Pop committed
175
	$(APIDOC_PY_DIR) \
176 177
	$(COVERAGE_DIR) \
	$(COVERAGE_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
178
	$(COVERAGE_PY_DIR) \
179
	.hpc
180 181 182

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
183 184
	doc/html \
	doc/man-html
185 186 187 188

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
Iustin Pop's avatar
Iustin Pop committed
189
	doc/html/_* \
190
	doc/man-html/_* \
Iustin Pop's avatar
Iustin Pop committed
191
	autom4te.cache
192

193 194 195 196 197 198 199 200
# 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
201
MAINTAINERCLEANFILES = \
202
	$(maninput) \
203
	doc/install-quick.rst \
204
	doc/news.rst \
205
	doc/upgrade.rst \
206
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
207

208
maintainer-clean-local:
209
	rm -rf $(BUILDTIME_DIRS)
210

211
CLEANFILES = \
212
	$(addsuffix /*.py[co],$(DIRS)) \
213 214
	$(addsuffix /*.hi,$(HS_DIRS)) \
	$(addsuffix /*.o,$(HS_DIRS)) \
215
	$(PYTHON_BOOTSTRAP) \
216
	epydoc.conf \
Iustin Pop's avatar
Iustin Pop committed
217
	$(REPLACE_VARS_SED) \
218
	$(SHELL_ENV_INIT) \
219
	daemons/daemon-util \
220
	daemons/ganeti-cleaner \
221 222
	devel/squeeze-amd64.tar.gz \
	devel/squeeze-amd64.conf \
223 224
	$(mandocrst) \
	doc/manpages-enabled.rst \
225
	$(BUILT_EXAMPLES) \
226
	doc/examples/bash_completion \
227
	doc/examples/bash_completion-debug \
228
	$(userspecs) \
229
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
230 231
	$(man_MANS) \
	$(manhtml) \
232
	tools/kvm-ifup \
233 234
	tools/vif-ganeti \
	tools/net-common \
235
	tools/users-setup \
236
	tools/vcluster-setup \
237
	stamp-directories \
238
	stamp-srclinks \
239
	$(nodist_pkgpython_PYTHON) \
240
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
241
	$(HS_BUILT_TEST_HELPERS) \
Iustin Pop's avatar
Iustin Pop committed
242
	src/ganeti-confd \
Thomas Thrainer's avatar
Thomas Thrainer committed
243
	src/ganeti-luxid \
244
	src/ganeti-mond \
245
	src/hs2py-constants \
246
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
247
	doc/hs-lint.html
248

Iustin Pop's avatar
Iustin Pop committed
249
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
250
	$(built_base_sources) \
251 252 253
	$(BUILT_PYTHON_SOURCES) \
	$(PYTHON_BOOTSTRAP)

254
HS_GENERATED_FILES =
255
if WANT_HTOOLS
256
HS_GENERATED_FILES += $(HS_PROGS)
257
if ENABLE_CONFD
Thomas Thrainer's avatar
Thomas Thrainer committed
258
HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
259
endif
260 261 262 263

if ENABLE_MOND
HS_GENERATED_FILES += src/ganeti-mond
endif
264 265
endif

266
built_base_sources = \
267 268
	stamp-directories \
	stamp-srclinks
269

270
built_python_base_sources = \
271
	lib/_autoconf.py \
272
	lib/_constants.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
273 274
	lib/_vcsversion.py \
	lib/opcodes.py
275 276 277

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
278
	lib/_generated_rpc.py
279

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

284 285 286 287 288
# 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
289
	doc/examples/ganeti.logrotate \
290
	doc/examples/ganeti-master-role.ocf \
291
	doc/examples/ganeti-node-role.ocf \
292 293 294
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

295 296 297
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

298
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
299
	lib/build/__init__.py \
Iustin Pop's avatar
Iustin Pop committed
300 301
	lib/build/shell_example_lexer.py \
	lib/build/sphinx_ext.py
302

303 304
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
305
	lib/asyncnotifier.py \
306 307 308
	lib/backend.py \
	lib/bootstrap.py \
	lib/cli.py \
309
	lib/compat.py \
310 311
	lib/config.py \
	lib/constants.py \
312
	lib/daemon.py \
313
	lib/errors.py \
314
	lib/hooksmaster.py \
315
	lib/ht.py \
316
	lib/jqueue.py \
317
	lib/jstore.py \
318 319 320
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
321
	lib/netutils.py \
322
	lib/objects.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
323
	lib/opcodes_base.py \
324
	lib/outils.py \
325
	lib/ovf.py \
326
	lib/pathutils.py \
327
	lib/qlang.py \
328
	lib/query.py \
329
	lib/rpc.py \
330
	lib/rpc_defs.py \
331
	lib/runtime.py \
332 333 334
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
335
	lib/uidpool.py \
336
	lib/vcluster.py \
337
	lib/network.py \
338
	lib/workerpool.py
339

340
client_PYTHON = \
341
	lib/client/__init__.py \
342
	lib/client/gnt_backup.py \
343
	lib/client/gnt_cluster.py \
344
	lib/client/gnt_debug.py \
345
	lib/client/gnt_group.py \
346
	lib/client/gnt_instance.py \
347
	lib/client/gnt_job.py \
348
	lib/client/gnt_node.py \
349
	lib/client/gnt_network.py \
350 351
	lib/client/gnt_os.py \
	lib/client/gnt_storage.py
352

353
cmdlib_PYTHON = \
354
	lib/cmdlib/__init__.py \
355
	lib/cmdlib/backup.py \
356
	lib/cmdlib/base.py \
357
	lib/cmdlib/cluster.py \
358
	lib/cmdlib/common.py \
359
	lib/cmdlib/group.py \
360
	lib/cmdlib/instance.py \
361
	lib/cmdlib/instance_migration.py \
362
	lib/cmdlib/instance_operation.py \
363
	lib/cmdlib/instance_query.py \
364
	lib/cmdlib/instance_storage.py \
365
	lib/cmdlib/instance_utils.py \
366 367 368
	lib/cmdlib/misc.py \
	lib/cmdlib/network.py \
	lib/cmdlib/node.py \
369
	lib/cmdlib/operating_system.py \
370
	lib/cmdlib/query.py \
371
	lib/cmdlib/tags.py \
372
	lib/cmdlib/test.py
373

374 375 376
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
377
	lib/hypervisor/hv_chroot.py \
378
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
379
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
380
	lib/hypervisor/hv_lxc.py \
381 382
	lib/hypervisor/hv_xen.py

383 384 385 386
storage_PYTHON = \
	lib/storage/__init__.py \
	lib/storage/bdev.py \
	lib/storage/base.py \
387
	lib/storage/container.py \
388 389
	lib/storage/drbd.py \
	lib/storage/drbd_info.py \
390 391
	lib/storage/drbd_cmdgen.py \
	lib/storage/filestorage.py
392

393 394
rapi_PYTHON = \
	lib/rapi/__init__.py \
395
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
396
	lib/rapi/client.py \
397
	lib/rapi/client_utils.py \
398
	lib/rapi/connector.py \
399 400
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
401

402
http_PYTHON = \
403
	lib/http/__init__.py \
404
	lib/http/auth.py \
405 406
	lib/http/client.py \
	lib/http/server.py
407

Guido Trotter's avatar
Guido Trotter committed
408
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
409
	lib/confd/__init__.py \
410
	lib/confd/client.py
411

Michael Hanselmann's avatar
Michael Hanselmann committed
412
masterd_PYTHON = \
413
	lib/masterd/__init__.py \
René Nussbaumer's avatar
René Nussbaumer committed
414
	lib/masterd/iallocator.py \
415
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
416

417 418 419
impexpd_PYTHON = \
	lib/impexpd/__init__.py

420
watcher_PYTHON = \
421
	lib/watcher/__init__.py \
422 423
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
424

425
server_PYTHON = \
426
	lib/server/__init__.py \
427
	lib/server/masterd.py \
428 429
	lib/server/noded.py \
	lib/server/rapi.py
430

431 432
pytools_PYTHON = \
	lib/tools/__init__.py \
433
	lib/tools/burnin.py \
434
	lib/tools/ensure_dirs.py \
Michael Hanselmann's avatar
Michael Hanselmann committed
435
	lib/tools/node_cleanup.py \
436
	lib/tools/node_daemon_setup.py \
437
	lib/tools/prepare_node_join.py
438

439
utils_PYTHON = \
440
	lib/utils/__init__.py \
441
	lib/utils/algo.py \
442
	lib/utils/filelock.py \
443
	lib/utils/hash.py \
444
	lib/utils/io.py \
445
	lib/utils/log.py \
446
	lib/utils/lvm.py \
447
	lib/utils/mlock.py \
448
	lib/utils/nodesetup.py \
449
	lib/utils/process.py \
450
	lib/utils/retry.py \
Helga Velroyen's avatar
Helga Velroyen committed
451
	lib/utils/storage.py \
452
	lib/utils/text.py \
453 454
	lib/utils/wrapper.py \
	lib/utils/x509.py
455

456 457 458
docinput = \
	doc/conf.py \
	doc/css/style.css \
459
	doc/admin.rst \
Iustin Pop's avatar
Iustin Pop committed
460
	doc/cluster-merge.rst \
461
	doc/design-2.0.rst \
462
	doc/design-2.1.rst \
463
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
464
	doc/design-2.3.rst \
465
	doc/design-2.4.rst \
466
	doc/design-2.5.rst \
467
	doc/design-2.6.rst \
468
	doc/design-2.7.rst \
469
	doc/design-2.8.rst \
Klaus Aehlig's avatar
Klaus Aehlig committed
470
	doc/design-2.9.rst \
Iustin Pop's avatar
Iustin Pop committed
471 472 473
	doc/design-autorepair.rst \
	doc/design-bulk-create.rst \
	doc/design-chained-jobs.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
474
	doc/design-cpu-pinning.rst \
475
	doc/design-device-uuid-name.rst \
Iustin Pop's avatar
Iustin Pop committed
476
	doc/design-draft.rst \
Dimitris Aragiorgis's avatar
Dimitris Aragiorgis committed
477
	doc/design-hotplug.rst \
Iustin Pop's avatar
Iustin Pop committed
478
	doc/design-htools-2.3.rst \
479
	doc/design-http-server.rst \
480
	doc/design-impexp2.rst \
481
	doc/design-internal-shutdown.rst \
482
	doc/design-lu-generated-jobs.rst \
483
	doc/design-linuxha.rst \
484
	doc/design-multi-reloc.rst \
485
	doc/design-network.rst \
486
	doc/design-node-add.rst \
Iustin Pop's avatar
Iustin Pop committed
487
	doc/design-oob.rst \
488
	doc/design-ovf-support.rst \
489
	doc/design-opportunistic-locking.rst \
490
	doc/design-optables.rst \
Iustin Pop's avatar
Iustin Pop committed
491 492 493
	doc/design-partitioned.rst \
	doc/design-query-splitting.rst \
	doc/design-query2.rst \
494
	doc/design-reason-trail.rst \
495
	doc/design-resource-model.rst \
496
	doc/design-restricted-commands.rst \
497
	doc/design-shared-storage.rst \
498
	doc/design-monitoring-agent.rst \
499
	doc/design-virtual-clusters.rst \
Iustin Pop's avatar
Iustin Pop committed
500
	doc/design-x509-ca.rst \
501
	doc/design-hroller.rst \
502
	doc/design-storagetypes.rst \
503
        doc/design-upgrade.rst \
504
	doc/devnotes.rst \
505
	doc/glossary.rst \
506
	doc/hooks.rst \
507
	doc/iallocator.rst \
508
	doc/index.rst \
509
	doc/install-quick.rst \
510
	doc/install.rst \
511
	doc/locking.rst \
512
	doc/manpages-disabled.rst \
513
	doc/monitoring-query-format.rst \
514
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
515
	doc/news.rst \
516
	doc/ovfconverter.rst \
517
	doc/rapi.rst \
518
	doc/security.rst \
519
	doc/upgrade.rst \
520
	doc/virtual-cluster.rst \
Iustin Pop's avatar
Iustin Pop committed
521
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
522

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

526 527 528 529
# Haskell programs to be installed in $PREFIX/bin
HS_BIN_PROGS=src/htools

# Haskell programs to be installed in the MYEXECLIB dir
530
if ENABLE_MOND
531
HS_MYEXECLIB_PROGS=src/mon-collector
532 533 534
else
HS_MYEXECLIB_PROGS=
endif
535

536
# Haskell programs to be compiled by "make really-all"
537
HS_COMPILE_PROGS= \
538
	src/ganeti-mond \
539
	src/hconfd \
Thomas Thrainer's avatar
Thomas Thrainer committed
540
	src/hluxid \
Jose A. Lopes's avatar
Jose A. Lopes committed
541
	src/hs2py \
542 543 544 545 546
	src/rpc-test

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

547
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller
548
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
549

550 551
HS_ALL_PROGS = \
	$(HS_PROGS) \
552 553
	test/hs/hpc-htools \
	test/hs/hpc-mon-collector \
Iustin Pop's avatar
Iustin Pop committed
554
	test/hs/htest \
555
	$(HS_COMPILE_PROGS)
556

557
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS)) src/hs2py-constants.hs
558
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
559

560
HFLAGS = \
Iustin Pop's avatar
Iustin Pop committed
561
	-O -Wall -Werror -isrc \
562 563 564 565
	-fwarn-monomorphism-restriction \
	-fwarn-tabs \
	$(GHC_BYVERSION_FLAGS)

566
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
567
HEXTRA =
Iustin Pop's avatar
Iustin Pop committed
568
# internal extra flags (used for test/hs/htest mainly)
569
HEXTRA_INT =
570
# exclude options for coverage reports
571
HPCEXCL = --exclude Main \
572
	--exclude Ganeti.Constants \
573
	--exclude Ganeti.HTools.QC \
Iustin Pop's avatar
Iustin Pop committed
574
	--exclude Ganeti.THH \
575
	--exclude Ganeti.Version \
576
	--exclude Test.Ganeti.Attoparsec \
577
	--exclude Test.Ganeti.TestCommon \
578 579
	--exclude Test.Ganeti.TestHTools \
	--exclude Test.Ganeti.TestHelper \
580
	--exclude Test.Ganeti.TestImports \
Iustin Pop's avatar
Iustin Pop committed
581
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
582

583
HS_LIB_SRCS = \
Iustin Pop's avatar
Iustin Pop committed
584 585 586 587
	src/Ganeti/BasicTypes.hs \
	src/Ganeti/Common.hs \
	src/Ganeti/Compat.hs \
	src/Ganeti/Confd/Client.hs \
588
	src/Ganeti/Confd/ClientFunctions.hs \
Iustin Pop's avatar
Iustin Pop committed
589 590 591 592
	src/Ganeti/Confd/Server.hs \
	src/Ganeti/Confd/Types.hs \
	src/Ganeti/Confd/Utils.hs \
	src/Ganeti/Config.hs \
593
	src/Ganeti/ConfigReader.hs \
594
	src/Ganeti/Constants.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
595
	src/Ganeti/ConstantUtils.hs \
596 597
	src/Ganeti/Cpu/LoadParser.hs \
	src/Ganeti/Cpu/Types.hs \
598
	src/Ganeti/Curl/Multi.hs \
Iustin Pop's avatar
Iustin Pop committed
599 600
	src/Ganeti/Daemon.hs \
	src/Ganeti/DataCollectors/CLI.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
601
	src/Ganeti/DataCollectors/CPUload.hs \
Michele Tartara's avatar
Michele Tartara committed
602
	src/Ganeti/DataCollectors/Diskstats.hs \
Iustin Pop's avatar
Iustin Pop committed
603
	src/Ganeti/DataCollectors/Drbd.hs \
604 605
	src/Ganeti/DataCollectors/InstStatus.hs \
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
Michele Tartara's avatar
Michele Tartara committed
606
	src/Ganeti/DataCollectors/Lv.hs \
Iustin Pop's avatar
Iustin Pop committed
607
	src/Ganeti/DataCollectors/Program.hs \
608
	src/Ganeti/DataCollectors/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
609 610 611 612 613 614 615 616 617 618 619 620 621 622
	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 \
623
	src/Ganeti/HTools/Nic.hs \
Iustin Pop's avatar
Iustin Pop committed
624 625 626
	src/Ganeti/HTools/Node.hs \
	src/Ganeti/HTools/PeerMap.hs \
	src/Ganeti/HTools/Program/Hail.hs \
627
	src/Ganeti/HTools/Program/Harep.hs \
Iustin Pop's avatar
Iustin Pop committed
628 629 630 631 632 633
	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 \
	src/Ganeti/HTools/Program/Hroller.hs \
634
	src/Ganeti/HTools/Program/Main.hs \
Iustin Pop's avatar
Iustin Pop committed
635
	src/Ganeti/HTools/Types.hs \
636
	src/Ganeti/Hypervisor/Xen.hs \
637 638
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
	src/Ganeti/Hypervisor/Xen/Types.hs \
Iustin Pop's avatar
Iustin Pop committed
639
	src/Ganeti/Hash.hs \
640
	src/Ganeti/Hs2Py/GenConstants.hs \
641
	src/Ganeti/Hs2Py/GenOpCodes.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
642
	src/Ganeti/Hs2Py/OpDoc.hs \
643
	src/Ganeti/HsConstants.hs \
Iustin Pop's avatar
Iustin Pop committed
644 645 646 647 648
	src/Ganeti/JQueue.hs \
	src/Ganeti/JSON.hs \
	src/Ganeti/Jobs.hs \
	src/Ganeti/Logging.hs \
	src/Ganeti/Luxi.hs \
649
	src/Ganeti/Monitoring/Server.hs \
Iustin Pop's avatar
Iustin Pop committed
650 651 652 653 654
	src/Ganeti/Network.hs \
	src/Ganeti/Objects.hs \
	src/Ganeti/OpCodes.hs \
	src/Ganeti/OpParams.hs \
	src/Ganeti/Path.hs \
Spyros Trigazis's avatar
Spyros Trigazis committed
655
	src/Ganeti/Parsers.hs \
656
	src/Ganeti/PyValueInstances.hs \
Thomas Thrainer's avatar
Thomas Thrainer committed
657
	src/Ganeti/Query/Cluster.hs \
Iustin Pop's avatar
Iustin Pop committed
658
	src/Ganeti/Query/Common.hs \
659
	src/Ganeti/Query/Export.hs \
Iustin Pop's avatar
Iustin Pop committed
660 661 662 663
	src/Ganeti/Query/Filter.hs \
	src/Ganeti/Query/Group.hs \
	src/Ganeti/Query/Job.hs \
	src/Ganeti/Query/Language.hs \
664
	src/Ganeti/Query/Network.hs \
Iustin Pop's avatar
Iustin Pop committed
665 666 667 668 669 670 671
	src/Ganeti/Query/Node.hs \
	src/Ganeti/Query/Query.hs \
	src/Ganeti/Query/Server.hs \
	src/Ganeti/Query/Types.hs \
	src/Ganeti/Rpc.hs \
	src/Ganeti/Runtime.hs \
	src/Ganeti/Ssconf.hs \
672 673 674 675
	src/Ganeti/Storage/Diskstats/Parser.hs \
	src/Ganeti/Storage/Diskstats/Types.hs \
	src/Ganeti/Storage/Drbd/Parser.hs \
	src/Ganeti/Storage/Drbd/Types.hs \
Michele Tartara's avatar
Michele Tartara committed
676 677
	src/Ganeti/Storage/Lvm/LVParser.hs \
	src/Ganeti/Storage/Lvm/Types.hs \
678
	src/Ganeti/Storage/Utils.hs \
Iustin Pop's avatar
Iustin Pop committed
679 680 681
	src/Ganeti/THH.hs \
	src/Ganeti/Types.hs \
	src/Ganeti/Utils.hs
682 683

HS_TEST_SRCS = \
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701
	test/hs/Test/Ganeti/Attoparsec.hs \
	test/hs/Test/Ganeti/BasicTypes.hs \
	test/hs/Test/Ganeti/Common.hs \
	test/hs/Test/Ganeti/Confd/Types.hs \
	test/hs/Test/Ganeti/Confd/Utils.hs \
	test/hs/Test/Ganeti/Daemon.hs \
	test/hs/Test/Ganeti/Errors.hs \
	test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
	test/hs/Test/Ganeti/HTools/Backend/Text.hs \
	test/hs/Test/Ganeti/HTools/CLI.hs \
	test/hs/Test/Ganeti/HTools/Cluster.hs \
	test/hs/Test/Ganeti/HTools/Container.hs \
	test/hs/Test/Ganeti/HTools/Graph.hs \
	test/hs/Test/Ganeti/HTools/Instance.hs \
	test/hs/Test/Ganeti/HTools/Loader.hs \
	test/hs/Test/Ganeti/HTools/Node.hs \
	test/hs/Test/Ganeti/HTools/PeerMap.hs \
	test/hs/Test/Ganeti/HTools/Types.hs \
702
	test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
703 704 705 706 707 708 709 710 711
	test/hs/Test/Ganeti/JSON.hs \
	test/hs/Test/Ganeti/Jobs.hs \
	test/hs/Test/Ganeti/JQueue.hs \
	test/hs/Test/Ganeti/Luxi.hs \
	test/hs/Test/Ganeti/Network.hs \
	test/hs/Test/Ganeti/Objects.hs \
	test/hs/Test/Ganeti/OpCodes.hs \
	test/hs/Test/Ganeti/Query/Filter.hs \
	test/hs/Test/Ganeti/Query/Language.hs \
712
	test/hs/Test/Ganeti/Query/Network.hs \
713 714
	test/hs/Test/Ganeti/Query/Query.hs \
	test/hs/Test/Ganeti/Rpc.hs \
715
	test/hs/Test/Ganeti/Runtime.hs \
716
	test/hs/Test/Ganeti/Ssconf.hs \
717 718 719
	test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
	test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
	test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
Michele Tartara's avatar
Michele Tartara committed
720
	test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
721 722 723 724 725 726
	test/hs/Test/Ganeti/THH.hs \
	test/hs/Test/Ganeti/TestCommon.hs \
	test/hs/Test/Ganeti/TestHTools.hs \
	test/hs/Test/Ganeti/TestHelper.hs \
	test/hs/Test/Ganeti/Types.hs \
	test/hs/Test/Ganeti/Utils.hs
727

728
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
729

730
HS_BUILT_SRCS = \
731
	test/hs/Test/Ganeti/TestImports.hs \
Jose A. Lopes's avatar
Jose A. Lopes committed
732
	src/AutoConf.hs \
733
	src/Ganeti/Hs2Py/ListConstants.hs \
734
	src/Ganeti/PyConstants.hs \
735
	src/Ganeti/Curl/Internal.hs \
Iustin Pop's avatar
Iustin Pop committed
736
	src/Ganeti/Version.hs
737 738
HS_BUILT_SRCS_IN = \
	$(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
Jose A. Lopes's avatar
Jose A. Lopes committed
739
	src/Ganeti/Curl/Internal.hsc \
740
	lib/_constants.py.in \
Jose A. Lopes's avatar
Jose A. Lopes committed
741 742
	lib/opcodes.py.in_after \
	lib/opcodes.py.in_before
743

744 745
HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)

746
$(RUN_IN_TEMPDIR): | stamp-directories
747

748 749 750 751
doc/html/index.html: ENABLE_MANPAGES =
doc/man-html/index.html: ENABLE_MANPAGES = 1
doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)

Iustin Pop's avatar
Iustin Pop committed
752 753 754 755 756
# Note: we use here an order-only prerequisite, as the contents of
# _autoconf.py are not actually influencing the html build output: it
# has to exist in order for the sphinx module to be loaded
# successfully, but we certainly don't want the docs to be rebuilt if
# it changes
757 758
doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
	configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
Jose A. Lopes's avatar
Jose A. Lopes committed
759
	lib/build/shell_example_lexer.py lib/ht.py \
760
	doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
761
	autotools/sphinx-wrapper | $(BUILT_PYTHON_SOURCES)