Makefile.am 39.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

# 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
# Use bash in order to be able to use pipefail
SHELL=/bin/bash

20
ACLOCAL_AMFLAGS = -I autotools
21
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
22
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
23
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
24
CHECK_HEADER = $(top_srcdir)/autotools/check-header
Iustin Pop's avatar
Iustin Pop committed
25
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
26
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
27
CHECK_VERSION = $(top_srcdir)/autotools/check-version
28
CHECK_NEWS = $(top_srcdir)/autotools/check-news
29
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
30
DOCPP = $(top_srcdir)/autotools/docpp
31
REPLACE_VARS_SED = autotools/replace_vars.sed
32
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
33
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
34

35 36
# Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix
37
clientdir = $(pkgpythondir)/client
38
hypervisordir = $(pkgpythondir)/hypervisor
39
httpdir = $(pkgpythondir)/http
Michael Hanselmann's avatar
Michael Hanselmann committed
40
masterddir = $(pkgpythondir)/masterd
Guido Trotter's avatar
Guido Trotter committed
41
confddir = $(pkgpythondir)/confd
42
rapidir = $(pkgpythondir)/rapi
43
serverdir = $(pkgpythondir)/server
44
watcherdir = $(pkgpythondir)/watcher
45
impexpddir = $(pkgpythondir)/impexpd
46
utilsdir = $(pkgpythondir)/utils
47
toolsdir = $(pkglibdir)/tools
48
iallocatorsdir = $(pkglibdir)/iallocators
49
pytoolsdir = $(pkgpythondir)/tools
50
docdir = $(datadir)/doc/$(PACKAGE)
51
myexeclibdir = $(pkglibdir)
52

53 54 55
# Delete output file if an error occurred while building it
.DELETE_ON_ERROR:

56 57 58
HTOOLS_DIRS = \
	htools \
	htools/Ganeti \
Iustin Pop's avatar
Iustin Pop committed
59
	htools/Ganeti/Confd \
60 61
	htools/Ganeti/HTools \
	htools/Ganeti/HTools/Program
62

63 64 65 66 67 68
DIRS = \
	autotools \
	daemons \
	devel \
	doc \
	doc/examples \
Guido Trotter's avatar
Guido Trotter committed
69
	doc/examples/hooks \
70
	doc/examples/gnt-debug \
71
	$(HTOOLS_DIRS) \
72
	lib \
73
	lib/client \
74
	lib/build \
75
	lib/confd \
76
	lib/http \
77
	lib/hypervisor \
78
	lib/impexpd \
Michael Hanselmann's avatar
Michael Hanselmann committed
79
	lib/masterd \
80
	lib/rapi \
81
	lib/server \
82
	lib/tools \
83
	lib/utils \
84
	lib/watcher \
85 86 87 88
	man \
	qa \
	test \
	test/data \
Agata Murawska's avatar
Agata Murawska committed
89
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
90
	test/data/ovfdata/other \
91 92
	tools

93
BUILDTIME_DIR_AUTOCREATE = \
94
	scripts \
95 96 97
	$(APIDOC_DIR) \
	$(APIDOC_PY_DIR) \
	$(APIDOC_HS_DIR) \
Iustin Pop's avatar
Iustin Pop committed
98 99 100
	$(APIDOC_HS_DIR)/Ganeti \
	$(APIDOC_HS_DIR)/Ganeti/Confd \
	$(APIDOC_HS_DIR)/Ganeti/HTools \
101
	$(APIDOC_HS_DIR)/Ganeti/HTools/Program \
102 103 104
	$(COVERAGE_DIR) \
	$(COVERAGE_PY_DIR) \
	$(COVERAGE_HS_DIR) \
105
	.hpc
106 107 108

BUILDTIME_DIRS = \
	$(BUILDTIME_DIR_AUTOCREATE) \
109 110 111 112 113 114 115
	doc/html

DIRCHECK_EXCLUDE = \
	$(BUILDTIME_DIRS) \
	ganeti-[0-9]*.[0-9]*.[0-9]* \
	doc/html/_*

116
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
117

118 119 120 121 122 123 124 125
# 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
126
MAINTAINERCLEANFILES = \
127
	$(docpng) \
128
	$(maninput) \
129
	doc/install-quick.rst \
130
	doc/news.rst \
131
	doc/upgrade.rst \
132
	vcs-version
Iustin Pop's avatar
Iustin Pop committed
133

134
maintainer-clean-local:
135
	rm -rf $(BUILDTIME_DIRS)
136

137
CLEANFILES = \
138
	$(addsuffix /*.py[co],$(DIRS)) \
139 140
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
141
	$(all_dirfiles) \
142
	$(PYTHON_BOOTSTRAP) \
143
	epydoc.conf \
144
	autotools/replace_vars.sed \
145
	daemons/daemon-util \
146
	daemons/ganeti-cleaner \
147
	devel/upload \
148
	$(BUILT_EXAMPLES) \
149
	doc/examples/bash_completion \
150
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
151 152
	$(man_MANS) \
	$(manhtml) \
153
	tools/kvm-ifup \
154
	stamp-srclinks \
155
	$(nodist_pkgpython_PYTHON) \
156
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
157 158
	.hpc/*.mix htools/*.tix \
	doc/hs-lint.html
159

160 161
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise
# it'll cause the target to rebuild every time.
162
BUILT_SOURCES = \
163 164 165 166 167
  $(built_base_sources) \
	$(BUILT_PYTHON_SOURCES) \
	$(PYTHON_BOOTSTRAP)

built_base_sources = \
168
	ganeti \
169
	stamp-srclinks \
170
	$(all_dirfiles)
171

172
built_python_base_sources = \
173
	lib/_autoconf.py \
174 175 176 177
	lib/_vcsversion.py

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
178
	lib/_generated_rpc.py
179

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

184 185 186 187 188 189 190 191
# 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 \
	doc/examples/gnt-config-backup \
	doc/examples/hooks/ipsec

192 193 194
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

195
noinst_PYTHON = \
Michael Hanselmann's avatar
Michael Hanselmann committed
196 197
	lib/build/__init__.py \
	lib/build/sphinx_ext.py
198

199 200
pkgpython_PYTHON = \
	lib/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
201
	lib/asyncnotifier.py \
202 203 204 205 206
	lib/backend.py \
	lib/bdev.py \
	lib/bootstrap.py \
	lib/cli.py \
	lib/cmdlib.py \
207
	lib/compat.py \
208 209
	lib/config.py \
	lib/constants.py \
210
	lib/daemon.py \
211
	lib/errors.py \
212
	lib/ht.py \
213
	lib/jqueue.py \
214
	lib/jstore.py \
215 216 217
	lib/locking.py \
	lib/luxi.py \
	lib/mcpu.py \
218
	lib/netutils.py \
219 220
	lib/objects.py \
	lib/opcodes.py \
221
	lib/ovf.py \
222
	lib/qlang.py \
223
	lib/query.py \
224
	lib/rpc.py \
225
	lib/rpc_defs.py \
226
	lib/runtime.py \
227 228 229
	lib/serializer.py \
	lib/ssconf.py \
	lib/ssh.py \
230
	lib/storage.py \
231
	lib/uidpool.py \
232
	lib/workerpool.py
233

234
client_PYTHON = \
235
	lib/client/__init__.py \
236
	lib/client/gnt_backup.py \
237
	lib/client/gnt_cluster.py \
238
	lib/client/gnt_debug.py \
239
	lib/client/gnt_group.py \
240
	lib/client/gnt_instance.py \
241
	lib/client/gnt_job.py \
242
	lib/client/gnt_node.py \
243
	lib/client/gnt_os.py
244

245 246 247
hypervisor_PYTHON = \
	lib/hypervisor/__init__.py \
	lib/hypervisor/hv_base.py \
248
	lib/hypervisor/hv_chroot.py \
249
	lib/hypervisor/hv_fake.py \
Guido Trotter's avatar
Guido Trotter committed
250
	lib/hypervisor/hv_kvm.py \
Iustin Pop's avatar
Iustin Pop committed
251
	lib/hypervisor/hv_lxc.py \
252 253
	lib/hypervisor/hv_xen.py

254 255
rapi_PYTHON = \
	lib/rapi/__init__.py \
256
	lib/rapi/baserlib.py \
David Knowles's avatar
David Knowles committed
257
	lib/rapi/client.py \
258
	lib/rapi/client_utils.py \
259
	lib/rapi/connector.py \
260 261
	lib/rapi/rlib2.py \
	lib/rapi/testutils.py
262

263
http_PYTHON = \
264
	lib/http/__init__.py \
265
	lib/http/auth.py \
266 267
	lib/http/client.py \
	lib/http/server.py
268

Guido Trotter's avatar
Guido Trotter committed
269
confd_PYTHON = \
Guido Trotter's avatar
Guido Trotter committed
270
	lib/confd/__init__.py \
Guido Trotter's avatar
Guido Trotter committed
271
	lib/confd/client.py \
272 273
	lib/confd/querylib.py \
	lib/confd/server.py
274

Michael Hanselmann's avatar
Michael Hanselmann committed
275
masterd_PYTHON = \
276 277
	lib/masterd/__init__.py \
	lib/masterd/instance.py
Michael Hanselmann's avatar
Michael Hanselmann committed
278

279 280 281
impexpd_PYTHON = \
	lib/impexpd/__init__.py

282
watcher_PYTHON = \
283
	lib/watcher/__init__.py \
284 285
	lib/watcher/nodemaint.py \
	lib/watcher/state.py
286

287
server_PYTHON = \
288
	lib/server/__init__.py \
289
	lib/server/confd.py \
290
	lib/server/masterd.py \
291 292
	lib/server/noded.py \
	lib/server/rapi.py
293

294 295 296 297
pytools_PYTHON = \
	lib/tools/__init__.py \
	lib/tools/ensure_dirs.py

298
utils_PYTHON = \
299
	lib/utils/__init__.py \
300
	lib/utils/algo.py \
301
	lib/utils/filelock.py \
302
	lib/utils/hash.py \
303
	lib/utils/io.py \
304
	lib/utils/log.py \
305
	lib/utils/mlock.py \
306
	lib/utils/nodesetup.py \
307
	lib/utils/process.py \
308
	lib/utils/retry.py \
309
	lib/utils/text.py \
310 311
	lib/utils/wrapper.py \
	lib/utils/x509.py
312

Michael Hanselmann's avatar
Michael Hanselmann committed
313
docrst = \
314
	doc/admin.rst \
315
	doc/design-2.0.rst \
316
	doc/design-2.1.rst \
317
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
318
	doc/design-2.3.rst \
319
	doc/design-htools-2.3.rst \
320
	doc/design-2.4.rst \
321
	doc/design-2.5.rst \
322
	doc/design-draft.rst \
323
	doc/design-oob.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
324
	doc/design-cpu-pinning.rst \
325
	doc/design-query2.rst \
326
	doc/design-x509-ca.rst \
327
	doc/design-http-server.rst \
328
	doc/design-impexp2.rst \
329
	doc/design-lu-generated-jobs.rst \
330
	doc/design-multi-reloc.rst \
331
	doc/design-network.rst \
Michael Hanselmann's avatar
Michael Hanselmann committed
332
	doc/design-chained-jobs.rst \
333
	doc/design-ovf-support.rst \
334
	doc/design-resource-model.rst \
335
	doc/cluster-merge.rst \
336
	doc/design-shared-storage.rst \
337
	doc/design-node-state-cache.rst \
338
	doc/design-virtual-clusters.rst \
339
	doc/devnotes.rst \
340
	doc/glossary.rst \
341
	doc/hooks.rst \
342
	doc/iallocator.rst \
343
	doc/index.rst \
344
	doc/install-quick.rst \
345
	doc/install.rst \
346
	doc/locking.rst \
347
	doc/move-instance.rst \
Iustin Pop's avatar
Iustin Pop committed
348
	doc/news.rst \
349
	doc/rapi.rst \
350
	doc/security.rst \
351
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
352
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
353

Iustin Pop's avatar
Iustin Pop committed
354
HS_PROGS = htools/htools htools/hconfd
355
HS_BIN_ROLES = hbal hscan hspace hinfo
356

357 358
HS_ALL_PROGS = $(HS_PROGS) htools/test
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
359
# we don't add -Werror by default
360
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
361
# extra flags that can be overriden on the command line
362
HEXTRA =
363 364
# internal extra flags (used for htools/test mainly)
HEXTRA_INT =
365
# exclude options for coverage reports
366
HPCEXCL = --exclude Main \
367
	--exclude Ganeti.Constants \
368 369 370
	--exclude Ganeti.THH \
	--exclude Ganeti.HTools.QC \
	--exclude Ganeti.HTools.QCHelper \
371
	--exclude Ganeti.HTools.Version
372

373
HS_LIB_SRCS = \
374 375
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
376
	htools/Ganeti/HTools/Compat.hs \
377 378 379 380 381
	htools/Ganeti/HTools/Container.hs \
	htools/Ganeti/HTools/ExtLoader.hs \
	htools/Ganeti/HTools/Group.hs \
	htools/Ganeti/HTools/IAlloc.hs \
	htools/Ganeti/HTools/Instance.hs \
382
	htools/Ganeti/HTools/JSON.hs \
383 384 385 386 387
	htools/Ganeti/HTools/Loader.hs \
	htools/Ganeti/HTools/Luxi.hs \
	htools/Ganeti/HTools/Node.hs \
	htools/Ganeti/HTools/PeerMap.hs \
	htools/Ganeti/HTools/QC.hs \
388
	htools/Ganeti/HTools/QCHelper.hs \
389 390 391 392 393
	htools/Ganeti/HTools/Rapi.hs \
	htools/Ganeti/HTools/Simu.hs \
	htools/Ganeti/HTools/Text.hs \
	htools/Ganeti/HTools/Types.hs \
	htools/Ganeti/HTools/Utils.hs \
394
	htools/Ganeti/HTools/Program.hs \
395
	htools/Ganeti/HTools/Program/Hail.hs \
396
	htools/Ganeti/HTools/Program/Hbal.hs \
397
	htools/Ganeti/HTools/Program/Hinfo.hs \
398
	htools/Ganeti/HTools/Program/Hscan.hs \
399
	htools/Ganeti/HTools/Program/Hspace.hs \
400
	htools/Ganeti/BasicTypes.hs \
401
	htools/Ganeti/Confd.hs \
Iustin Pop's avatar
Iustin Pop committed
402
	htools/Ganeti/Confd/Server.hs \
403
	htools/Ganeti/Config.hs \
404
	htools/Ganeti/Daemon.hs \
405
	htools/Ganeti/Hash.hs \
406
	htools/Ganeti/Jobs.hs \
Iustin Pop's avatar
Iustin Pop committed
407
	htools/Ganeti/Logging.hs \
408
	htools/Ganeti/Luxi.hs \
409
	htools/Ganeti/Objects.hs \
410
	htools/Ganeti/OpCodes.hs \
Iustin Pop's avatar
Iustin Pop committed
411
	htools/Ganeti/Runtime.hs \
412
	htools/Ganeti/THH.hs
413

414
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
415
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
416

417 418
$(RUN_IN_TEMPDIR): | $(all_dirfiles)

Iustin Pop's avatar
Iustin Pop committed
419 420 421 422 423
# 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
424
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
Iustin Pop's avatar
Iustin Pop committed
425
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
426
	| $(BUILT_PYTHON_SOURCES)
427 428
	@test -n "$(SPHINX)" || \
	    { echo 'sphinx-build' not found during configure; exit 1; }
429
	@mkdir_p@ $(dir $@)
430
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
431
	    -d . \
432 433
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
	    -D release="$(PACKAGE_VERSION)" \
434 435 436 437
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
	rm -f doc/html/.buildinfo doc/html/objects.inv
	touch $@

438
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
439

440
doc/install-quick.rst: INSTALL
441
doc/news.rst: NEWS
442
doc/upgrade.rst: UPGRADE
443

444
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
445 446 447 448 449 450 451
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

452
docdot = \
453 454 455
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
456

457
docpng = $(patsubst %.dot,%.png,$(docdot))
458

459 460 461 462 463
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
	devel/upload \
	doc/html \
464
	$(BUILT_EXAMPLES) \
465 466
	doc/examples/bash_completion \
	$(manhtml)
467

468
gnt_scripts = \
469 470 471
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
472
	scripts/gnt-group \
473 474 475 476 477
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

478
PYTHON_BOOTSTRAP_SBIN = \
479
	daemons/ganeti-confd \
480
	daemons/ganeti-masterd \
481
	daemons/ganeti-noded \
482
	daemons/ganeti-watcher \
483
	daemons/ganeti-rapi \
484
	$(gnt_scripts)
485

486 487 488 489
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

490 491 492 493 494 495 496
qa_scripts = \
	qa/ganeti-qa.py \
	qa/qa_cluster.py \
	qa/qa_config.py \
	qa/qa_daemon.py \
	qa/qa_env.py \
	qa/qa_error.py \
Andrea Spadaccini's avatar
Andrea Spadaccini committed
497
	qa/qa_group.py \
498 499 500 501 502 503 504
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

505 506
bin_SCRIPTS =
if WANT_HTOOLS
507
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
508 509
install-exec-hook:
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
510 511
# FIXME: this is a hardcoded logic, instead of auto-resolving
	$(LN_S) -f ../../../bin/htools \
512
		   $(DESTDIR)$(iallocatorsdir)/hail
513
	for role in $(HS_BIN_ROLES); do \
514
		$(LN_S) -f htools \
515 516
			   $(DESTDIR)$(bindir)/$$role ; \
	done
517 518
endif

519
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
520 521 522 523
	@if [ -z "$(HTOOLS)" ]; then \
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
	  exit 1; \
	fi
524 525
	@BINARY=$(@:htools/%=%); \
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
526 527
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
	  exit 1; \
528
	fi
529
	rm -f $(@:htools/%=%).tix
530
	BINARY=$(@:htools/%=%); $(GHC) --make \
Iustin Pop's avatar
Iustin Pop committed
531
	  $(HFLAGS) \
532
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
Iustin Pop's avatar
Iustin Pop committed
533
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
534
	  $(HEXTRA) $(HEXTRA_INT) $@
535

536
# for the htools/test binary, we need to enable profiling/coverage
537
htools/test: HEXTRA_INT=-fhpc -Wwarn -fno-warn-missing-signatures \
538 539 540
	-fno-warn-monomorphism-restriction -fno-warn-orphans \
	-fno-warn-missing-methods -fno-warn-unused-imports

541 542 543
# test dependency
htools/offline-tests.sh: htools/htools

544 545 546 547 548 549 550 551 552 553 554 555 556 557
# rules for building profiling-enabled versions of the haskell
# programs: hs-prof does the full two-step build, whereas
# hs-prof-quick does only the final rebuild (hs-prof must have been
# run before)
.PHONY: hs-prof hs-prof-quick
hs-prof:
	$(MAKE) clean
	$(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
	rm -f $(HS_ALL_PROGS)
	$(MAKE) hs-prof-quick

hs-prof-quick:
	$(MAKE) $(HS_ALL_PROGS) HEXTRA="-osuf .prof_o -prof -auto-all"

558 559
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
560

561
nodist_sbin_SCRIPTS = \
562
	$(PYTHON_BOOTSTRAP_SBIN) \
563 564
	daemons/ganeti-cleaner

565
python_scripts = \
566 567 568
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
569
	tools/cfgupgrade12 \
570
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
571
	tools/confd-client \
572
	tools/fmtjson \
Iustin Pop's avatar
Iustin Pop committed
573
	tools/lvmstrap \
574
	tools/move-instance \
575
	tools/ovfconverter \
576
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
577
	tools/sanitize-config
578

579
dist_tools_SCRIPTS = \
580
	$(python_scripts) \
581
	tools/kvm-console-wrapper \
582 583
	tools/xm-console-wrapper \
	tools/master-ip-setup
584

585
pkglib_python_scripts = \
586 587
	daemons/import-export \
	tools/check-cert-expired
588

589 590 591
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

592
myexeclib_SCRIPTS = \
593
	daemons/daemon-util \
594
	tools/kvm-ifup \
595
	$(pkglib_python_scripts)
596

597
nodist_myexeclib_SCRIPTS = \
598 599
	$(nodist_pkglib_python_scripts)

600 601
EXTRA_DIST = \
	NEWS \
602
	UPGRADE \
603
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
604
	pylintrc \
605
	autotools/build-bash-completion \
606
	autotools/build-rpc \
607
	autotools/check-header \
608
	autotools/check-python-code \
609
	autotools/check-imports \
Iustin Pop's avatar
Iustin Pop committed
610
	autotools/check-man-dashes \
611
	autotools/check-man-warnings \
612
	autotools/check-news \
613
	autotools/check-tar \
614
	autotools/check-version \
615
	autotools/convert-constants \
616
	autotools/docpp \
617
	autotools/gen-coverage \
618
	autotools/testrunner \
619
	$(RUN_IN_TEMPDIR) \
620
	daemons/daemon-util.in \
621
	daemons/ganeti-cleaner.in \
622
	$(pkglib_python_scripts) \
623
	devel/upload.in \
624
	tools/kvm-ifup.in \
625
	$(docdot) \
626
	$(docpng) \
627 628 629
	$(docrst) \
	doc/conf.py \
	doc/html \
630
	$(BUILT_EXAMPLES:%=%.in) \
631 632
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
633
	doc/examples/hooks/ethers \
634 635 636
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
637
	test/lockperf.py \
638 639 640 641
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
642 643
	man/footer.rst \
	$(manrst) \
644
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
645
	qa/qa-sample.json \
646
	$(qa_scripts) \
647
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
648
	$(HS_PROG_SRCS) \
649 650 651
	htools/lint-hints.hs \
	htools/cli-tests-defs.sh \
	htools/offline-test.sh
652 653 654

man_MANS = \
	man/ganeti.7 \
655
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
656
	man/ganeti-confd.8 \
657
	man/ganeti-listrunner.8 \
658
	man/ganeti-masterd.8 \
659 660
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
661
	man/ganeti-rapi.8 \
662 663 664
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
665
	man/gnt-debug.8 \
666
	man/gnt-group.8 \
667
	man/gnt-instance.8 \
668
	man/gnt-job.8 \
669
	man/gnt-node.8 \
670 671 672
	man/gnt-os.8 \
	man/hail.1 \
	man/hbal.1 \
René Nussbaumer's avatar
René Nussbaumer committed
673
	man/hinfo.1 \
674
	man/hscan.1 \
Iustin Pop's avatar
Iustin Pop committed
675 676
	man/hspace.1 \
	man/htools.1
677

678
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS))))
Iustin Pop's avatar
Iustin Pop committed
679
manhtml = $(patsubst %.rst,%.html,$(manrst))
680
mangen = $(patsubst %.rst,%.gen,$(manrst))
681
maninput = \
682
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
Iustin Pop's avatar
Iustin Pop committed
683
	$(patsubst %.html,%.html.in,$(manhtml)) \
684
	man/footer.man man/footer.html $(mangen)
685 686

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
687 688 689 690 691
	test/data/bdev-drbd-8.0.txt \
	test/data/bdev-drbd-8.3.txt \
	test/data/bdev-drbd-disk.txt \
	test/data/bdev-drbd-net-ip4.txt \
	test/data/bdev-drbd-net-ip6.txt \
692
	test/data/cert1.pem \
693 694 695 696 697 698 699
	test/data/ip-addr-show-dummy0.txt \
	test/data/ip-addr-show-lo-ipv4.txt \
	test/data/ip-addr-show-lo-ipv6.txt \
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
	test/data/ip-addr-show-lo-oneline.txt \
	test/data/ip-addr-show-lo.txt \
700
	test/data/proc_drbd8.txt \
701
	test/data/proc_drbd80-emptyline.txt \
702
	test/data/proc_drbd83.txt \
703 704
	test/data/proc_drbd83_sync.txt \
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
705 706 707 708
	test/data/kvm_1.0_help.txt \
	test/data/kvm_0.15.90_help.txt \
	test/data/kvm_0.12.5_help.txt \
	test/data/kvm_0.9.1_help.txt \
709
	test/data/sys_drbd_usermode_helper.txt \
Agata Murawska's avatar
Agata Murawska committed
710
	test/data/ovfdata/compr_disk.vmdk.gz \
Agata Murawska's avatar
Agata Murawska committed
711
	test/data/ovfdata/config.ini \
Agata Murawska's avatar
Agata Murawska committed
712
	test/data/ovfdata/corrupted_resources.ovf \
Agata Murawska's avatar
Agata Murawska committed
713
	test/data/ovfdata/empty.ini \
Agata Murawska's avatar
Agata Murawska committed
714 715 716 717 718
	test/data/ovfdata/empty.ovf \
	test/data/ovfdata/ganeti.mf \
	test/data/ovfdata/ganeti.ovf \
	test/data/ovfdata/gzip_disk.ovf \
	test/data/ovfdata/new_disk.vmdk \
Agata Murawska's avatar
Agata Murawska committed
719
	test/data/ovfdata/no_disk.ini \
Agata Murawska's avatar
Agata Murawska committed
720
	test/data/ovfdata/no_disk_in_ref.ovf \
Agata Murawska's avatar
Agata Murawska committed
721
	test/data/ovfdata/no_os.ini \
Agata Murawska's avatar
Agata Murawska committed
722 723 724
	test/data/ovfdata/no_ovf.ova \
	test/data/ovfdata/ova.ova \
	test/data/ovfdata/second_disk.vmdk \
Agata Murawska's avatar
Agata Murawska committed
725 726
	test/data/ovfdata/rawdisk.raw \
	test/data/ovfdata/unsafe_path.ini \
Agata Murawska's avatar
Agata Murawska committed
727 728
	test/data/ovfdata/virtualbox.ovf \
	test/data/ovfdata/wrong_extension.ovd \
Agata Murawska's avatar
Agata Murawska committed
729
	test/data/ovfdata/wrong_config.ini \
Agata Murawska's avatar
Agata Murawska committed
730 731 732 733
	test/data/ovfdata/wrong_manifest.mf \
	test/data/ovfdata/wrong_manifest.ovf \
	test/data/ovfdata/wrong_ova.ova \
	test/data/ovfdata/wrong_xml.ovf \
Agata Murawska's avatar
Agata Murawska committed
734
	test/data/ovfdata/other/rawdisk.raw \
735 736 737 738 739
	test/data/vgreduce-removemissing-2.02.02.txt \
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
	test/data/vgs-missing-pvs-2.02.02.txt \
	test/data/vgs-missing-pvs-2.02.66.txt \
740
	test/import-export_unittest-helper
741

742
python_tests = \
Guido Trotter's avatar
Guido Trotter committed
743
	test/ganeti.asyncnotifier_unittest.py \
744
	test/ganeti.backend_unittest.py \
745 746
	test/ganeti.bdev_unittest.py \
	test/ganeti.cli_unittest.py \
René Nussbaumer's avatar
René Nussbaumer committed
747
	test/ganeti.client.gnt_cluster_unittest.py \
748
	test/ganeti.client.gnt_instance_unittest.py \
Guido Trotter's avatar
Guido Trotter committed
749
	test/ganeti.daemon_unittest.py \
750
	test/ganeti.cmdlib_unittest.py \
751
	test/ganeti.compat_unittest.py \
752
	test/ganeti.confd.client_unittest.py \
753
	test/ganeti.config_unittest.py \