Makefile.am 40 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 \
Iustin Pop's avatar
Iustin Pop committed
89
	test/data/htools \
Agata Murawska's avatar
Agata Murawska committed
90
	test/data/ovfdata \
Agata Murawska's avatar
Agata Murawska committed
91
	test/data/ovfdata/other \
92 93
	tools

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

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

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

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

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

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

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

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

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

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

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

181 182 183 184
# 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)

185 186 187 188 189 190 191 192
# 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

193 194 195
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

374
HS_LIB_SRCS = \
375 376
	htools/Ganeti/HTools/CLI.hs \
	htools/Ganeti/HTools/Cluster.hs \
377
	htools/Ganeti/HTools/Compat.hs \
378 379 380 381 382
	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 \
383
	htools/Ganeti/HTools/JSON.hs \
384 385 386 387 388
	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 \
389
	htools/Ganeti/HTools/QCHelper.hs \
390 391 392 393 394
	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 \
395
	htools/Ganeti/HTools/Program.hs \
396
	htools/Ganeti/HTools/Program/Hail.hs \
397
	htools/Ganeti/HTools/Program/Hbal.hs \
398
	htools/Ganeti/HTools/Program/Hinfo.hs \
399
	htools/Ganeti/HTools/Program/Hscan.hs \
400
	htools/Ganeti/HTools/Program/Hspace.hs \
401
	htools/Ganeti/BasicTypes.hs \
402
	htools/Ganeti/Confd.hs \
Iustin Pop's avatar
Iustin Pop committed
403
	htools/Ganeti/Confd/Server.hs \
404
	htools/Ganeti/Config.hs \
405
	htools/Ganeti/Daemon.hs \
406
	htools/Ganeti/Hash.hs \
407
	htools/Ganeti/Jobs.hs \
Iustin Pop's avatar
Iustin Pop committed
408
	htools/Ganeti/Logging.hs \
409
	htools/Ganeti/Luxi.hs \
410
	htools/Ganeti/Objects.hs \
411
	htools/Ganeti/OpCodes.hs \
Iustin Pop's avatar
Iustin Pop committed
412
	htools/Ganeti/Runtime.hs \
413
	htools/Ganeti/THH.hs
414

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

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

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

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

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

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

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

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

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

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

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

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

491 492 493 494 495 496 497
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
498
	qa/qa_group.py \
499 500 501 502 503 504 505
	qa/qa_instance.py \
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

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

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

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

542 543 544
# we compile the htools-hpc binary with the program coverage
htools/htools-hpc: HEXTRA_INT=-fhpc

545
# test dependency
546
htools/offline-tests.sh: htools/htools-hpc
547

548 549 550 551 552 553 554 555 556 557 558 559 560 561
# 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"

562 563
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
564

565
nodist_sbin_SCRIPTS = \
566
	$(PYTHON_BOOTSTRAP_SBIN) \
567 568
	daemons/ganeti-cleaner

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

583
dist_tools_SCRIPTS = \
584
	$(python_scripts) \
585
	tools/kvm-console-wrapper \
586 587
	tools/xm-console-wrapper \
	tools/master-ip-setup
588

589
pkglib_python_scripts = \
590 591
	daemons/import-export \
	tools/check-cert-expired
592

593 594 595
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

596
myexeclib_SCRIPTS = \
597
	daemons/daemon-util \
598
	tools/kvm-ifup \
599
	$(pkglib_python_scripts)
600

601
nodist_myexeclib_SCRIPTS = \
602 603
	$(nodist_pkglib_python_scripts)

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

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

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

TEST_FILES = \
Manuel Franceschini's avatar
Manuel Franceschini committed
691 692 693 694 695
	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 \
696
	test/data/cert1.pem \
697 698 699 700