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

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

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

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

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
	$(PYTHON_BOOTSTRAP) \
142
	epydoc.conf \
Iustin Pop's avatar
Iustin Pop committed
143
	$(REPLACE_VARS_SED) \
144
	daemons/daemon-util \
145
	daemons/ganeti-cleaner \
146
	devel/upload \
147
	$(BUILT_EXAMPLES) \
148
	doc/examples/bash_completion \
149
	lib/_generated_rpc.py \
Iustin Pop's avatar
Iustin Pop committed
150 151
	$(man_MANS) \
	$(manhtml) \
152
	tools/kvm-ifup \
153
	stamp-directories \
154
	stamp-srclinks \
155
	$(nodist_pkgpython_PYTHON) \
156
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
157
	$(HS_BUILT_TEST_HELPERS) \
158 159
	.hpc/*.mix htools/*.tix \
	doc/hs-lint.html
160

Iustin Pop's avatar
Iustin Pop committed
161
GENERATED_FILES = \
Iustin Pop's avatar
Iustin Pop committed
162
	$(built_base_sources) \
163 164 165 166
	$(BUILT_PYTHON_SOURCES) \
	$(PYTHON_BOOTSTRAP)

built_base_sources = \
167 168
	stamp-directories \
	stamp-srclinks
169

170
built_python_base_sources = \
171
	lib/_autoconf.py \
172 173 174 175
	lib/_vcsversion.py

BUILT_PYTHON_SOURCES = \
	$(built_python_base_sources) \
176
	lib/_generated_rpc.py
177

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

182 183 184 185 186 187 188 189
# 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

190 191 192
nodist_pkgpython_PYTHON = \
	$(BUILT_PYTHON_SOURCES)

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

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

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

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

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

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

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

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

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

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

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

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

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

Michael Hanselmann's avatar
Michael Hanselmann committed
312
docrst = \
313
	doc/admin.rst \
314
	doc/design-2.0.rst \
315
	doc/design-2.1.rst \
316
	doc/design-2.2.rst \
Guido Trotter's avatar
Guido Trotter committed
317
	doc/design-2.3.rst \
318
	doc/design-htools-2.3.rst \
319
	doc/design-2.4.rst \
320
	doc/design-2.5.rst \
321
	doc/design-draft.rst \
322
	doc/design-oob.rst \
Tsachy Shacham's avatar
Tsachy Shacham committed
323
	doc/design-cpu-pinning.rst \
324
	doc/design-query2.rst \
325
	doc/design-x509-ca.rst \
326
	doc/design-http-server.rst \
327
	doc/design-impexp2.rst \
328
	doc/design-lu-generated-jobs.rst \
329
	doc/design-multi-reloc.rst \
330
	doc/design-network.rst \
Michael Hanselmann's avatar
Michael Hanselmann committed
331
	doc/design-chained-jobs.rst \
332
	doc/design-ovf-support.rst \
333
	doc/design-resource-model.rst \
334
	doc/cluster-merge.rst \
335
	doc/design-shared-storage.rst \
336
	doc/design-node-state-cache.rst \
337
	doc/design-virtual-clusters.rst \
338
	doc/design-bulk-create.rst \
339
	doc/design-query-splitting.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/ovfconverter.rst \
351
	doc/rapi.rst \
352
	doc/security.rst \
353
	doc/upgrade.rst \
Iustin Pop's avatar
Iustin Pop committed
354
	doc/walkthrough.rst
Michael Hanselmann's avatar
Michael Hanselmann committed
355

356
HS_PROGS = htools/htools
357
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck
358

359
HS_ALL_PROGS = $(HS_PROGS) htools/test htools/hpc-htools htools/hconfd
360
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
361 362
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail

363 364
HFLAGS = -O -Wall -Werror -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
365
HEXTRA =
366 367
# internal extra flags (used for htools/test mainly)
HEXTRA_INT =
368
# exclude options for coverage reports
369
HPCEXCL = --exclude Main \
370
	--exclude Ganeti.Constants \
371 372 373
	--exclude Ganeti.THH \
	--exclude Ganeti.HTools.QC \
	--exclude Ganeti.HTools.QCHelper \
374
	--exclude Ganeti.HTools.Version
375

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

420
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs
421
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
422

423
$(RUN_IN_TEMPDIR): | stamp-directories
424

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

445
doc/html: doc/html/index.html
Iustin Pop's avatar
Iustin Pop committed
446

447
doc/install-quick.rst: INSTALL
448
doc/news.rst: NEWS
449
doc/upgrade.rst: UPGRADE
450

451
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
452 453 454 455 456 457 458
	set -e; \
	{ echo '.. This file is automatically updated at build time from $<.'; \
	  echo '.. Do not edit.'; \
	  echo; \
	  cat $<; \
	} > $@

459
docdot = \
460 461 462
	doc/arch-2.0.dot \
	doc/design-2.1-lock-acquire.dot \
	doc/design-2.1-lock-release.dot
463

464
docpng = $(patsubst %.dot,%.png,$(docdot))
465

466 467 468 469 470
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
	devel/upload \
	doc/html \
471
	$(BUILT_EXAMPLES) \
472 473
	doc/examples/bash_completion \
	$(manhtml)
474

475
gnt_scripts = \
476 477 478
	scripts/gnt-backup \
	scripts/gnt-cluster \
	scripts/gnt-debug \
479
	scripts/gnt-group \
480 481 482 483 484
	scripts/gnt-instance \
	scripts/gnt-job \
	scripts/gnt-node \
	scripts/gnt-os

485
PYTHON_BOOTSTRAP_SBIN = \
486
	daemons/ganeti-masterd \
487
	daemons/ganeti-noded \
488
	daemons/ganeti-watcher \
489
	daemons/ganeti-rapi \
490
	$(gnt_scripts)
491

492 493 494 495
if PY_CONFD
PYTHON_BOOTSTRAP_SBIN += daemons/ganeti-confd
endif

496 497 498 499
PYTHON_BOOTSTRAP = \
	$(PYTHON_BOOTSTRAP_SBIN) \
	tools/ensure-dirs

500
qa_scripts = \
501
	qa/__init__.py \
502 503 504 505 506 507
	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
508
	qa/qa_group.py \
509
	qa/qa_instance.py \
510
	qa/qa_job.py \
511 512 513 514 515 516
	qa/qa_node.py \
	qa/qa_os.py \
	qa/qa_rapi.py \
	qa/qa_tags.py \
	qa/qa_utils.py

517 518
bin_SCRIPTS =
if WANT_HTOOLS
519
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
520 521
install-exec-hook:
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
522 523
# FIXME: this is a hardcoded logic, instead of auto-resolving
	$(LN_S) -f ../../../bin/htools \
524
		   $(DESTDIR)$(iallocatorsdir)/hail
525
	for role in $(HS_BIN_ROLES); do \
526
		$(LN_S) -f htools \
527 528
			   $(DESTDIR)$(bindir)/$$role ; \
	done
529 530 531
if HS_CONFD
	mv $(DESTDIR)$(sbindir)/hconfd $(DESTDIR)$(sbindir)/ganeti-confd
endif
532 533
endif

534
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
535 536 537 538
	@if [ -z "$(HTOOLS)" ]; then \
	  echo "Error: htools compilation disabled at configure time" 1>&2 ;\
	  exit 1; \
	fi
539 540
	@BINARY=$(@:htools/%=%); \
	if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \
541 542
	  echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \
	  exit 1; \
543
	fi
544
	rm -f $(@:htools/%=%).tix
545
	BINARY=$(@:htools/%=%); $(GHC) --make \
Iustin Pop's avatar
Iustin Pop committed
546
	  $(HFLAGS) \
547
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
Iustin Pop's avatar
Iustin Pop committed
548
	  -osuf $$BINARY.o -hisuf $$BINARY.hi \
549
	  $(HEXTRA) $(HEXTRA_INT) $@
550 551
	@touch "$@"

552
# for the htools/test binary, we need to enable profiling/coverage
553
htools/test: HEXTRA_INT=-fhpc
554

555 556
# we compile the hpc-htools binary with the program coverage
htools/hpc-htools: HEXTRA_INT=-fhpc
557

558
# test dependency
559
htools/offline-tests.sh: htools/hpc-htools
560

561 562 563 564 565 566
# 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:
567 568
	$(MAKE) $(AM_MAKEFLAGS) clean
	$(MAKE) $(AM_MAKEFLAGS) $(HS_ALL_PROGS) HEXTRA="-osuf .o"
569
	rm -f $(HS_ALL_PROGS)
570
	$(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
571 572

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

575 576
dist_sbin_SCRIPTS = \
	tools/ganeti-listrunner
577

578
nodist_sbin_SCRIPTS = \
579
	$(PYTHON_BOOTSTRAP_SBIN) \
580 581
	daemons/ganeti-cleaner

582 583 584 585
if HS_CONFD
nodist_sbin_SCRIPTS += htools/hconfd
endif

586
python_scripts = \
587 588 589
	tools/burnin \
	tools/cfgshell \
	tools/cfgupgrade \
590
	tools/cfgupgrade12 \
591
	tools/cluster-merge \
Iustin Pop's avatar
Iustin Pop committed
592
	tools/confd-client \
593
	tools/fmtjson \
Iustin Pop's avatar
Iustin Pop committed
594
	tools/lvmstrap \
595
	tools/move-instance \
596
	tools/ovfconverter \
597
	tools/setup-ssh \
Iustin Pop's avatar
Iustin Pop committed
598
	tools/sanitize-config
599

600
dist_tools_SCRIPTS = \
601
	$(python_scripts) \
602
	tools/kvm-console-wrapper \
603 604
	tools/xm-console-wrapper \
	tools/master-ip-setup
605

606
pkglib_python_scripts = \
607 608
	daemons/import-export \
	tools/check-cert-expired
609

610 611 612
nodist_pkglib_python_scripts = \
	tools/ensure-dirs

613
myexeclib_SCRIPTS = \
614
	daemons/daemon-util \
615
	tools/kvm-ifup \
616
	$(pkglib_python_scripts)
617

618
nodist_myexeclib_SCRIPTS = \
619 620
	$(nodist_pkglib_python_scripts)

621 622
EXTRA_DIST = \
	NEWS \
623
	UPGRADE \
624
	epydoc.conf.in \
Michael Hanselmann's avatar
Michael Hanselmann committed
625
	pylintrc \
626
	autotools/build-bash-completion \
627
	autotools/build-rpc \
628
	autotools/check-header \
629
	autotools/check-python-code \
630
	autotools/check-imports \
Iustin Pop's avatar
Iustin Pop committed
631
	autotools/check-man-dashes \
632
	autotools/check-man-warnings \
633
	autotools/check-news \
634
	autotools/check-tar \
635
	autotools/check-version \
636
	autotools/convert-constants \
637
	autotools/docpp \
638
	autotools/gen-coverage \
639
	autotools/testrunner \
640
	autotools/wrong-hardcoded-paths \
641
	$(RUN_IN_TEMPDIR) \
642
	daemons/daemon-util.in \
643
	daemons/ganeti-cleaner.in \
644
	$(pkglib_python_scripts) \
645
	devel/upload.in \
646
	tools/kvm-ifup.in \
647
	$(docdot) \
648
	$(docpng) \
649 650 651
	$(docrst) \
	doc/conf.py \
	doc/html \
652
	$(BUILT_EXAMPLES:%=%.in) \
653 654
	doc/examples/ganeti.default \
	doc/examples/ganeti.default-debug \
Guido Trotter's avatar
Guido Trotter committed
655
	doc/examples/hooks/ethers \
656 657 658
	doc/examples/gnt-debug/README \
	doc/examples/gnt-debug/delay0.json \
	doc/examples/gnt-debug/delay50.json \
659
	test/lockperf.py \
660 661 662 663
	test/testutils.py \
	test/mocks.py \
	$(dist_TESTS) \
	$(TEST_FILES) \
Iustin Pop's avatar
Iustin Pop committed
664 665
	man/footer.rst \
	$(manrst) \
666
	$(maninput) \
Michael Hanselmann's avatar
Michael Hanselmann committed
667
	qa/qa-sample.json \
668
	$(qa_scripts) \
669
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
670
	$(HS_PROG_SRCS) \
671 672 673
	htools/lint-hints.hs \
	htools/cli-tests-defs.sh \
	htools/offline-test.sh
674 675 676

man_MANS = \
	man/ganeti.7 \
677
	man/ganeti-cleaner.8 \
Guido Trotter's avatar
Guido Trotter committed
678
	man/ganeti-confd.8 \
679
	man/ganeti-listrunner.8 \
680
	man/ganeti-masterd.8 \
681 682
	man/ganeti-noded.8 \
	man/ganeti-os-interface.7 \
683
	man/ganeti-rapi.8 \
684 685 686
	man/ganeti-watcher.8 \
	man/gnt-backup.8 \
	man/gnt-cluster.8 \
687
	man/gnt-debug.8 \
688
	man/gnt-group.8 \
689
	man/gnt-instance.8 \
690
	man/gnt-job.8 \