Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 2cb36124

History | View | Annotate | Download (73.1 kB)

1
# Ganeti makefile
2
# - Indent with tabs only.
3
# - Keep files sorted; one line per file.
4
# - Directories in lib/ must have their own *dir variable (see hypervisor).
5
# - All directories must be listed DIRS.
6
# - Use autogen.sh to generate Makefile.in and configure script.
7

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

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

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

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

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

    
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
31
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
32
CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
33
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
34
CHECK_VERSION = $(top_srcdir)/autotools/check-version
35
CHECK_NEWS = $(top_srcdir)/autotools/check-news
36
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
37
DOCPP = $(top_srcdir)/autotools/docpp
38
REPLACE_VARS_SED = autotools/replace_vars.sed
39
PRINT_PY_CONSTANTS = $(top_srcdir)/autotools/print-py-constants
40
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
41
SHELL_ENV_INIT = autotools/shell-env-init
42

    
43
# starting as of Ganeti 2.10, all files are stored in two directories,
44
# with only symbolic links added at other places.
45
#
46
# $(versiondir) contains most of Ganeti and all architecture-dependent files
47
# $(versionedsharedir) contains only architecture-independent files; all python
48
# executables need to go directly to $(versionedsharedir), as all ganeti python
49
# mdules are installed outside the usual python path, i.e., as private modules.
50
#
51
# $(defaultversiondir) and $(defaultversionedsharedir) are the corresponding
52
# directories for "the currently running" version of Ganeti. We never install
53
# there, but all symbolic links go there, rather than directory to $(versiondir)
54
# or $(versionedsharedir). Note that all links to $(default*dir) need to be stable;
55
# so, if some currently architecture-independent executable is replaced by an
56
# architecture-dependent one (and hence has to go under $(versiondir)), add a link
57
# under $(versionedsharedir) but do not change the external links.
58
if USE_VERSION_FULL
59
DIRVERSION=$(VERSION_FULL)
60
else
61
DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
62
endif
63
versiondir = $(libdir)/ganeti/$(DIRVERSION)
64
defaultversiondir = $(libdir)/ganeti/default
65
versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
66
defaultversionedsharedir = $(prefix)/share/ganeti/default
67

    
68

    
69
# Note: these are automake-specific variables, and must be named after
70
# the directory + 'dir' suffix
71
pkglibdir = $(versiondir)$(libdir)/ganeti
72
myexeclibdir = $(pkglibdir)
73
bindir = $(versiondir)$(exec_prefix)/bin
74
sbindir = $(versiondir)$(exec_prefix)/sbin
75
mandir = $(versionedsharedir)$(datarootdir)/man
76
pkgpythondir = $(versionedsharedir)/ganeti
77
gntpythondir = $(versionedsharedir)
78
pkgpython_bindir = $(versionedsharedir)
79
gnt_python_sbindir = $(versionedsharedir)
80
tools_pythondir = $(versionedsharedir)
81

    
82
clientdir = $(pkgpythondir)/client
83
cmdlibdir = $(pkgpythondir)/cmdlib
84
hypervisordir = $(pkgpythondir)/hypervisor
85
storagedir = $(pkgpythondir)/storage
86
httpdir = $(pkgpythondir)/http
87
masterddir = $(pkgpythondir)/masterd
88
confddir = $(pkgpythondir)/confd
89
rapidir = $(pkgpythondir)/rapi
90
rpcdir = $(pkgpythondir)/rpc
91
serverdir = $(pkgpythondir)/server
92
watcherdir = $(pkgpythondir)/watcher
93
impexpddir = $(pkgpythondir)/impexpd
94
utilsdir = $(pkgpythondir)/utils
95
toolsdir = $(pkglibdir)/tools
96
iallocatorsdir = $(pkglibdir)/iallocators
97
pytoolsdir = $(pkgpythondir)/tools
98
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
99

    
100
SYMLINK_TARGET_DIRS = \
101
	$(sysconfdir)/ganeti \
102
	$(libdir)/ganeti/iallocators \
103
	$(libdir)/ganeti/tools \
104
	$(prefix)/share/ganeti \
105
	$(exec_prefix)/bin \
106
	$(exec_prefix)/sbin \
107
	$(datarootdir)/man/man1 \
108
	$(datarootdir)/man/man7 \
109
	$(datarootdir)/man/man8
110

    
111
# Delete output file if an error occurred while building it
112
.DELETE_ON_ERROR:
113

    
114
HS_DIRS = \
115
	src \
116
	src/Ganeti \
117
	src/Ganeti/Confd \
118
	src/Ganeti/Curl \
119
	src/Ganeti/Cpu \
120
	src/Ganeti/DataCollectors \
121
	src/Ganeti/Hs2Py \
122
	src/Ganeti/HTools \
123
	src/Ganeti/HTools/Backend \
124
	src/Ganeti/HTools/Program \
125
	src/Ganeti/Hypervisor \
126
	src/Ganeti/Hypervisor/Xen \
127
	src/Ganeti/Monitoring \
128
	src/Ganeti/Query \
129
	src/Ganeti/Storage \
130
	src/Ganeti/Storage/Diskstats \
131
	src/Ganeti/Storage/Drbd \
132
	src/Ganeti/Storage/Lvm \
133
	src/Ganeti/THH \
134
	test/hs \
135
	test/hs/Test \
136
	test/hs/Test/Ganeti \
137
	test/hs/Test/Ganeti/Storage \
138
	test/hs/Test/Ganeti/Storage/Diskstats \
139
	test/hs/Test/Ganeti/Storage/Drbd \
140
	test/hs/Test/Ganeti/Storage/Lvm \
141
	test/hs/Test/Ganeti/Confd \
142
	test/hs/Test/Ganeti/HTools \
143
	test/hs/Test/Ganeti/HTools/Backend \
144
	test/hs/Test/Ganeti/Hypervisor \
145
	test/hs/Test/Ganeti/Hypervisor/Xen \
146
	test/hs/Test/Ganeti/Query
147

    
148
# Haskell directories without the roots (src, test/hs)
149
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
150

    
151
DIRS = \
152
	$(HS_DIRS) \
153
	autotools \
154
	daemons \
155
	devel \
156
	devel/data \
157
	doc \
158
	doc/css \
159
	doc/examples \
160
	doc/examples/gnt-debug \
161
	doc/examples/hooks \
162
	doc/users \
163
	test/data/htools \
164
	test/data/htools/rapi \
165
	test/hs/shelltests \
166
	test/autotools \
167
	lib \
168
	lib/build \
169
	lib/client \
170
	lib/cmdlib \
171
	lib/confd \
172
	lib/http \
173
	lib/hypervisor \
174
	lib/impexpd \
175
	lib/masterd \
176
	lib/rapi \
177
	lib/rpc \
178
	lib/server \
179
	lib/storage \
180
	lib/tools \
181
	lib/utils \
182
	lib/watcher \
183
	man \
184
	qa \
185
	test \
186
	test/data \
187
	test/data/bdev-rbd \
188
	test/data/ovfdata \
189
	test/data/ovfdata/other \
190
	test/py \
191
	test/py/cmdlib \
192
	test/py/cmdlib/testsupport \
193
	tools
194

    
195
ALL_APIDOC_HS_DIRS = \
196
	$(APIDOC_HS_DIR) \
197
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
198

    
199
BUILDTIME_DIR_AUTOCREATE = \
200
	scripts \
201
	$(APIDOC_DIR) \
202
	$(ALL_APIDOC_HS_DIRS) \
203
	$(APIDOC_PY_DIR) \
204
	$(COVERAGE_DIR) \
205
	$(COVERAGE_HS_DIR) \
206
	$(COVERAGE_PY_DIR) \
207
	.hpc
208

    
209
BUILDTIME_DIRS = \
210
	$(BUILDTIME_DIR_AUTOCREATE) \
211
	doc/html \
212
	doc/man-html
213

    
214
DIRCHECK_EXCLUDE = \
215
	$(BUILDTIME_DIRS) \
216
	ganeti-[0-9]*.[0-9]*.[0-9]* \
217
	doc/html/_* \
218
	doc/man-html/_* \
219
	autom4te.cache
220

    
221
# some helper vars
222
COVERAGE_DIR = doc/coverage
223
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
224
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
225
APIDOC_DIR = doc/api
226
APIDOC_PY_DIR = $(APIDOC_DIR)/py
227
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
228

    
229
MAINTAINERCLEANFILES = \
230
	$(maninput) \
231
	doc/install-quick.rst \
232
	doc/news.rst \
233
	doc/upgrade.rst \
234
	vcs-version
235

    
236
maintainer-clean-local:
237
	rm -rf $(BUILDTIME_DIRS)
238

    
239
CLEANFILES = \
240
	$(addsuffix /*.py[co],$(DIRS)) \
241
	$(addsuffix /*.hi,$(HS_DIRS)) \
242
	$(addsuffix /*.o,$(HS_DIRS)) \
243
	$(PYTHON_BOOTSTRAP) \
244
	$(gnt_python_sbin_SCRIPTS) \
245
	epydoc.conf \
246
	$(REPLACE_VARS_SED) \
247
	$(SHELL_ENV_INIT) \
248
	daemons/daemon-util \
249
	daemons/ganeti-cleaner \
250
	devel/squeeze-amd64.tar.gz \
251
	devel/squeeze-amd64.conf \
252
	$(mandocrst) \
253
	doc/manpages-enabled.rst \
254
	$(BUILT_EXAMPLES) \
255
	doc/examples/bash_completion \
256
	doc/examples/bash_completion-debug \
257
	$(userspecs) \
258
	lib/_generated_rpc.py \
259
	$(man_MANS) \
260
	$(manhtml) \
261
	tools/kvm-ifup \
262
	tools/vif-ganeti \
263
	tools/net-common \
264
	tools/users-setup \
265
	tools/vcluster-setup \
266
	stamp-directories \
267
	stamp-srclinks \
268
	$(nodist_pkgpython_PYTHON) \
269
	$(gnt_scripts) \
270
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
271
	$(HS_BUILT_TEST_HELPERS) \
272
	src/ganeti-confd \
273
	src/ganeti-luxid \
274
	src/ganeti-mond \
275
	.hpc/*.mix src/*.tix test/hs/*.tix *.tix \
276
	doc/hs-lint.html
277

    
278
GENERATED_FILES = \
279
	$(built_base_sources) \
280
	$(BUILT_PYTHON_SOURCES) \
281
	$(PYTHON_BOOTSTRAP) \
282
	$(gnt_python_sbin_SCRIPTS)
283

    
284
HS_GENERATED_FILES =
285
if WANT_HTOOLS
286
HS_GENERATED_FILES += $(HS_PROGS)
287
if ENABLE_CONFD
288
HS_GENERATED_FILES += src/hconfd src/ganeti-confd src/hluxid src/ganeti-luxid
289
endif
290

    
291
if ENABLE_MOND
292
HS_GENERATED_FILES += src/ganeti-mond
293
endif
294
endif
295

    
296
built_base_sources = \
297
	stamp-directories \
298
	stamp-srclinks
299

    
300
built_python_base_sources = \
301
	lib/_constants.py \
302
	lib/_vcsversion.py \
303
	lib/opcodes.py
304

    
305
BUILT_PYTHON_SOURCES = \
306
	$(built_python_base_sources) \
307
	lib/_generated_rpc.py
308

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

    
313
# these are all built from the underlying %.in sources
314
BUILT_EXAMPLES = \
315
	doc/examples/ganeti-kvm-poweroff.initd \
316
	doc/examples/ganeti.cron \
317
	doc/examples/ganeti.initd \
318
	doc/examples/ganeti.logrotate \
319
	doc/examples/ganeti-master-role.ocf \
320
	doc/examples/ganeti-node-role.ocf \
321
	doc/examples/gnt-config-backup \
322
	doc/examples/hooks/ipsec
323

    
324
nodist_pkgpython_PYTHON = \
325
	$(BUILT_PYTHON_SOURCES)
326

    
327
nodist_pkgpython_bin_SCRIPTS = \
328
	$(nodist_pkglib_python_scripts)
329

    
330
pkgpython_bin_SCRIPTS = \
331
	$(pkglib_python_scripts)
332

    
333
noinst_PYTHON = \
334
	lib/build/__init__.py \
335
	lib/build/shell_example_lexer.py \
336
	lib/build/sphinx_ext.py
337

    
338
pkgpython_PYTHON = \
339
	lib/__init__.py \
340
	lib/asyncnotifier.py \
341
	lib/backend.py \
342
	lib/bootstrap.py \
343
	lib/cli.py \
344
	lib/compat.py \
345
	lib/config.py \
346
	lib/constants.py \
347
	lib/daemon.py \
348
	lib/errors.py \
349
	lib/hooksmaster.py \
350
	lib/ht.py \
351
	lib/jqueue.py \
352
	lib/jstore.py \
353
	lib/locking.py \
354
	lib/luxi.py \
355
	lib/mcpu.py \
356
	lib/netutils.py \
357
	lib/objects.py \
358
	lib/opcodes_base.py \
359
	lib/outils.py \
360
	lib/ovf.py \
361
	lib/pathutils.py \
362
	lib/qlang.py \
363
	lib/query.py \
364
	lib/rpc_defs.py \
365
	lib/runtime.py \
366
	lib/serializer.py \
367
	lib/ssconf.py \
368
	lib/ssh.py \
369
	lib/uidpool.py \
370
	lib/vcluster.py \
371
	lib/network.py \
372
	lib/workerpool.py
373

    
374
client_PYTHON = \
375
	lib/client/__init__.py \
376
	lib/client/gnt_backup.py \
377
	lib/client/gnt_cluster.py \
378
	lib/client/gnt_debug.py \
379
	lib/client/gnt_group.py \
380
	lib/client/gnt_instance.py \
381
	lib/client/gnt_job.py \
382
	lib/client/gnt_node.py \
383
	lib/client/gnt_network.py \
384
	lib/client/gnt_os.py \
385
	lib/client/gnt_storage.py
386

    
387
cmdlib_PYTHON = \
388
	lib/cmdlib/__init__.py \
389
	lib/cmdlib/backup.py \
390
	lib/cmdlib/base.py \
391
	lib/cmdlib/cluster.py \
392
	lib/cmdlib/common.py \
393
	lib/cmdlib/group.py \
394
	lib/cmdlib/instance.py \
395
	lib/cmdlib/instance_migration.py \
396
	lib/cmdlib/instance_operation.py \
397
	lib/cmdlib/instance_query.py \
398
	lib/cmdlib/instance_storage.py \
399
	lib/cmdlib/instance_utils.py \
400
	lib/cmdlib/misc.py \
401
	lib/cmdlib/network.py \
402
	lib/cmdlib/node.py \
403
	lib/cmdlib/operating_system.py \
404
	lib/cmdlib/query.py \
405
	lib/cmdlib/tags.py \
406
	lib/cmdlib/test.py
407

    
408
hypervisor_PYTHON = \
409
	lib/hypervisor/__init__.py \
410
	lib/hypervisor/hv_base.py \
411
	lib/hypervisor/hv_chroot.py \
412
	lib/hypervisor/hv_fake.py \
413
	lib/hypervisor/hv_kvm.py \
414
	lib/hypervisor/hv_lxc.py \
415
	lib/hypervisor/hv_xen.py
416

    
417
storage_PYTHON = \
418
	lib/storage/__init__.py \
419
	lib/storage/bdev.py \
420
	lib/storage/base.py \
421
	lib/storage/container.py \
422
	lib/storage/drbd.py \
423
	lib/storage/drbd_info.py \
424
	lib/storage/drbd_cmdgen.py \
425
	lib/storage/filestorage.py \
426
	lib/storage/gluster.py
427

    
428
rapi_PYTHON = \
429
	lib/rapi/__init__.py \
430
	lib/rapi/baserlib.py \
431
	lib/rapi/client.py \
432
	lib/rapi/client_utils.py \
433
	lib/rapi/connector.py \
434
	lib/rapi/rlib2.py \
435
	lib/rapi/testutils.py
436

    
437
http_PYTHON = \
438
	lib/http/__init__.py \
439
	lib/http/auth.py \
440
	lib/http/client.py \
441
	lib/http/server.py
442

    
443
confd_PYTHON = \
444
	lib/confd/__init__.py \
445
	lib/confd/client.py
446

    
447
masterd_PYTHON = \
448
	lib/masterd/__init__.py \
449
	lib/masterd/iallocator.py \
450
	lib/masterd/instance.py
451

    
452
impexpd_PYTHON = \
453
	lib/impexpd/__init__.py
454

    
455
watcher_PYTHON = \
456
	lib/watcher/__init__.py \
457
	lib/watcher/nodemaint.py \
458
	lib/watcher/state.py
459

    
460
server_PYTHON = \
461
	lib/server/__init__.py \
462
	lib/server/masterd.py \
463
	lib/server/noded.py \
464
	lib/server/rapi.py
465

    
466
rpc_PYTHON = \
467
	lib/rpc/__init__.py \
468
	lib/rpc/client.py \
469
	lib/rpc/errors.py \
470
	lib/rpc/node.py \
471
	lib/rpc/transport.py
472

    
473
pytools_PYTHON = \
474
	lib/tools/__init__.py \
475
	lib/tools/burnin.py \
476
	lib/tools/ensure_dirs.py \
477
	lib/tools/node_cleanup.py \
478
	lib/tools/node_daemon_setup.py \
479
	lib/tools/prepare_node_join.py
480

    
481
utils_PYTHON = \
482
	lib/utils/__init__.py \
483
	lib/utils/algo.py \
484
	lib/utils/filelock.py \
485
	lib/utils/hash.py \
486
	lib/utils/io.py \
487
	lib/utils/log.py \
488
	lib/utils/lvm.py \
489
	lib/utils/mlock.py \
490
	lib/utils/nodesetup.py \
491
	lib/utils/process.py \
492
	lib/utils/retry.py \
493
	lib/utils/security.py \
494
	lib/utils/storage.py \
495
	lib/utils/text.py \
496
	lib/utils/version.py \
497
	lib/utils/wrapper.py \
498
	lib/utils/x509.py
499

    
500
docinput = \
501
	doc/admin.rst \
502
	doc/cluster-merge.rst \
503
	doc/conf.py \
504
	doc/css/style.css \
505
	doc/design-2.0.rst \
506
	doc/design-2.1.rst \
507
	doc/design-2.2.rst \
508
	doc/design-2.3.rst \
509
	doc/design-2.4.rst \
510
	doc/design-2.5.rst \
511
	doc/design-2.6.rst \
512
	doc/design-2.7.rst \
513
	doc/design-2.8.rst \
514
	doc/design-2.9.rst \
515
	doc/design-2.10.rst \
516
	doc/design-2.11.rst \
517
	doc/design-autorepair.rst \
518
	doc/design-bulk-create.rst \
519
	doc/design-ceph-ganeti-support.rst \
520
	doc/design-chained-jobs.rst \
521
	doc/design-cmdlib-unittests.rst \
522
	doc/design-cpu-pinning.rst \
523
	doc/design-daemons.rst \
524
	doc/design-device-uuid-name.rst \
525
	doc/design-draft.rst \
526
	doc/design-glusterfs-ganeti-support.rst \
527
	doc/design-hotplug.rst \
528
	doc/design-hroller.rst \
529
	doc/design-hsqueeze.rst \
530
	doc/design-htools-2.3.rst \
531
	doc/design-http-server.rst \
532
	doc/design-hugepages-support.rst \
533
	doc/design-impexp2.rst \
534
	doc/design-internal-shutdown.rst \
535
	doc/design-kvmd.rst \
536
	doc/design-linuxha.rst \
537
	doc/design-lu-generated-jobs.rst \
538
	doc/design-monitoring-agent.rst \
539
	doc/design-multi-reloc.rst \
540
	doc/design-multi-version-tests.rst \
541
	doc/design-network.rst \
542
	doc/design-node-add.rst \
543
	doc/design-oob.rst \
544
	doc/design-openvswitch.rst \
545
	doc/design-opportunistic-locking.rst \
546
	doc/design-optables.rst \
547
	doc/design-os.rst \
548
	doc/design-ovf-support.rst \
549
	doc/design-partitioned.rst \
550
	doc/design-query2.rst \
551
	doc/design-query-splitting.rst \
552
	doc/design-reason-trail.rst \
553
	doc/design-resource-model.rst \
554
	doc/design-restricted-commands.rst \
555
	doc/design-shared-storage.rst \
556
	doc/design-ssh-ports.rst \
557
	doc/design-storagetypes.rst \
558
	doc/design-upgrade.rst \
559
	doc/design-virtual-clusters.rst \
560
	doc/design-x509-ca.rst \
561
	doc/dev-codestyle.rst \
562
	doc/devnotes.rst \
563
	doc/glossary.rst \
564
	doc/hooks.rst \
565
	doc/iallocator.rst \
566
	doc/index.rst \
567
	doc/install-quick.rst \
568
	doc/install.rst \
569
	doc/locking.rst \
570
	doc/manpages-disabled.rst \
571
	doc/monitoring-query-format.rst \
572
	doc/move-instance.rst \
573
	doc/news.rst \
574
	doc/ovfconverter.rst \
575
	doc/rapi.rst \
576
	doc/security.rst \
577
	doc/upgrade.rst \
578
	doc/virtual-cluster.rst \
579
	doc/walkthrough.rst
580

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

    
584
# Haskell programs to be installed in $PREFIX/bin
585
HS_BIN_PROGS=src/htools
586

    
587
# Haskell programs to be installed in the MYEXECLIB dir
588
if ENABLE_MOND
589
HS_MYEXECLIB_PROGS=src/mon-collector
590
else
591
HS_MYEXECLIB_PROGS=
592
endif
593

    
594
# Haskell programs to be compiled by "make really-all"
595
HS_COMPILE_PROGS= \
596
	src/ganeti-kvmd \
597
	src/ganeti-mond \
598
	src/hconfd \
599
	src/hluxid \
600
	src/hs2py \
601
	src/rpc-test
602

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

    
606
HS_BIN_ROLES = harep hbal hscan hspace hinfo hcheck hroller hsqueeze
607
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
608

    
609
# Haskell programs that cannot be disabled at configure (e.g., unlike
610
# 'mon-collector')
611
HS_DEFAULT_PROGS = \
612
	$(HS_BIN_PROGS) \
613
	test/hs/hpc-htools \
614
	test/hs/hpc-mon-collector \
615
	test/hs/htest \
616
	$(HS_COMPILE_PROGS)
617

    
618
HS_ALL_PROGS = $(HS_DEFAULT_PROGS) $(HS_MYEXECLIB_PROGS)
619

    
620
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_DEFAULT_PROGS)) src/mon-collector.hs
621
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
622

    
623
HFLAGS = \
624
	-O -Wall -Werror -isrc \
625
	-fwarn-monomorphism-restriction \
626
	-fwarn-tabs \
627
	$(GHC_BYVERSION_FLAGS)
628

    
629
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
630
HEXTRA =
631
# internal extra flags (used for test/hs/htest mainly)
632
HEXTRA_INT =
633
# exclude options for coverage reports
634
HPCEXCL = --exclude Main \
635
	--exclude Ganeti.Constants \
636
	--exclude Ganeti.HTools.QC \
637
	--exclude Ganeti.THH \
638
	--exclude Ganeti.Version \
639
	--exclude Test.Ganeti.Attoparsec \
640
	--exclude Test.Ganeti.TestCommon \
641
	--exclude Test.Ganeti.TestHTools \
642
	--exclude Test.Ganeti.TestHelper \
643
	--exclude Test.Ganeti.TestImports \
644
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
645

    
646
HS_LIB_SRCS = \
647
	src/Ganeti/BasicTypes.hs \
648
	src/Ganeti/Common.hs \
649
	src/Ganeti/Compat.hs \
650
	src/Ganeti/Confd/Client.hs \
651
	src/Ganeti/Confd/ClientFunctions.hs \
652
	src/Ganeti/Confd/Server.hs \
653
	src/Ganeti/Confd/Types.hs \
654
	src/Ganeti/Confd/Utils.hs \
655
	src/Ganeti/Config.hs \
656
	src/Ganeti/ConfigReader.hs \
657
	src/Ganeti/Constants.hs \
658
	src/Ganeti/ConstantUtils.hs \
659
	src/Ganeti/Cpu/LoadParser.hs \
660
	src/Ganeti/Cpu/Types.hs \
661
	src/Ganeti/Curl/Multi.hs \
662
	src/Ganeti/Daemon.hs \
663
	src/Ganeti/DataCollectors/CLI.hs \
664
	src/Ganeti/DataCollectors/CPUload.hs \
665
	src/Ganeti/DataCollectors/Diskstats.hs \
666
	src/Ganeti/DataCollectors/Drbd.hs \
667
	src/Ganeti/DataCollectors/InstStatus.hs \
668
	src/Ganeti/DataCollectors/InstStatusTypes.hs \
669
	src/Ganeti/DataCollectors/Lv.hs \
670
	src/Ganeti/DataCollectors/Program.hs \
671
	src/Ganeti/DataCollectors/Types.hs \
672
	src/Ganeti/Errors.hs \
673
	src/Ganeti/HTools/Backend/IAlloc.hs \
674
	src/Ganeti/HTools/Backend/Luxi.hs \
675
	src/Ganeti/HTools/Backend/Rapi.hs \
676
	src/Ganeti/HTools/Backend/Simu.hs \
677
	src/Ganeti/HTools/Backend/Text.hs \
678
	src/Ganeti/HTools/CLI.hs \
679
	src/Ganeti/HTools/Cluster.hs \
680
	src/Ganeti/HTools/Container.hs \
681
	src/Ganeti/HTools/ExtLoader.hs \
682
	src/Ganeti/HTools/Graph.hs \
683
	src/Ganeti/HTools/Group.hs \
684
	src/Ganeti/HTools/Instance.hs \
685
	src/Ganeti/HTools/Loader.hs \
686
	src/Ganeti/HTools/Nic.hs \
687
	src/Ganeti/HTools/Node.hs \
688
	src/Ganeti/HTools/PeerMap.hs \
689
	src/Ganeti/HTools/Program/Hail.hs \
690
	src/Ganeti/HTools/Program/Harep.hs \
691
	src/Ganeti/HTools/Program/Hbal.hs \
692
	src/Ganeti/HTools/Program/Hcheck.hs \
693
	src/Ganeti/HTools/Program/Hinfo.hs \
694
	src/Ganeti/HTools/Program/Hscan.hs \
695
	src/Ganeti/HTools/Program/Hspace.hs \
696
	src/Ganeti/HTools/Program/Hsqueeze.hs \
697
	src/Ganeti/HTools/Program/Hroller.hs \
698
	src/Ganeti/HTools/Program/Main.hs \
699
	src/Ganeti/HTools/Types.hs \
700
	src/Ganeti/Hypervisor/Xen.hs \
701
	src/Ganeti/Hypervisor/Xen/XmParser.hs \
702
	src/Ganeti/Hypervisor/Xen/Types.hs \
703
	src/Ganeti/Hash.hs \
704
	src/Ganeti/Hs2Py/GenConstants.hs \
705
	src/Ganeti/Hs2Py/GenOpCodes.hs \
706
	src/Ganeti/Hs2Py/OpDoc.hs \
707
	src/Ganeti/JQueue.hs \
708
	src/Ganeti/JQScheduler.hs \
709
	src/Ganeti/JSON.hs \
710
	src/Ganeti/Jobs.hs \
711
	src/Ganeti/Kvmd.hs \
712
	src/Ganeti/Logging.hs \
713
	src/Ganeti/Luxi.hs \
714
	src/Ganeti/Monitoring/Server.hs \
715
	src/Ganeti/Network.hs \
716
	src/Ganeti/Objects.hs \
717
	src/Ganeti/OpCodes.hs \
718
	src/Ganeti/OpParams.hs \
719
	src/Ganeti/Path.hs \
720
	src/Ganeti/Parsers.hs \
721
	src/Ganeti/PyValue.hs \
722
	src/Ganeti/Query/Cluster.hs \
723
	src/Ganeti/Query/Common.hs \
724
	src/Ganeti/Query/Export.hs \
725
	src/Ganeti/Query/Filter.hs \
726
	src/Ganeti/Query/Group.hs \
727
	src/Ganeti/Query/Instance.hs \
728
	src/Ganeti/Query/Job.hs \
729
	src/Ganeti/Query/Language.hs \
730
	src/Ganeti/Query/Network.hs \
731
	src/Ganeti/Query/Node.hs \
732
	src/Ganeti/Query/Query.hs \
733
	src/Ganeti/Query/Server.hs \
734
	src/Ganeti/Query/Types.hs \
735
	src/Ganeti/Rpc.hs \
736
	src/Ganeti/Runtime.hs \
737
	src/Ganeti/Ssconf.hs \
738
	src/Ganeti/Storage/Diskstats/Parser.hs \
739
	src/Ganeti/Storage/Diskstats/Types.hs \
740
	src/Ganeti/Storage/Drbd/Parser.hs \
741
	src/Ganeti/Storage/Drbd/Types.hs \
742
	src/Ganeti/Storage/Lvm/LVParser.hs \
743
	src/Ganeti/Storage/Lvm/Types.hs \
744
	src/Ganeti/Storage/Utils.hs \
745
	src/Ganeti/THH.hs \
746
	src/Ganeti/THH/PyType.hs \
747
	src/Ganeti/Types.hs \
748
	src/Ganeti/UDSServer.hs \
749
	src/Ganeti/Utils.hs\
750
	src/Ganeti/VCluster.hs
751

    
752
HS_TEST_SRCS = \
753
	test/hs/Test/AutoConf.hs \
754
	test/hs/Test/Ganeti/Attoparsec.hs \
755
	test/hs/Test/Ganeti/BasicTypes.hs \
756
	test/hs/Test/Ganeti/Common.hs \
757
	test/hs/Test/Ganeti/Confd/Types.hs \
758
	test/hs/Test/Ganeti/Confd/Utils.hs \
759
	test/hs/Test/Ganeti/Constants.hs \
760
	test/hs/Test/Ganeti/Daemon.hs \
761
	test/hs/Test/Ganeti/Errors.hs \
762
	test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
763
	test/hs/Test/Ganeti/HTools/Backend/Text.hs \
764
	test/hs/Test/Ganeti/HTools/CLI.hs \
765
	test/hs/Test/Ganeti/HTools/Cluster.hs \
766
	test/hs/Test/Ganeti/HTools/Container.hs \
767
	test/hs/Test/Ganeti/HTools/ExtLoader.hs \
768
	test/hs/Test/Ganeti/HTools/Graph.hs \
769
	test/hs/Test/Ganeti/HTools/Instance.hs \
770
	test/hs/Test/Ganeti/HTools/Loader.hs \
771
	test/hs/Test/Ganeti/HTools/Node.hs \
772
	test/hs/Test/Ganeti/HTools/PeerMap.hs \
773
	test/hs/Test/Ganeti/HTools/Types.hs \
774
	test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs \
775
	test/hs/Test/Ganeti/JSON.hs \
776
	test/hs/Test/Ganeti/Jobs.hs \
777
	test/hs/Test/Ganeti/JQueue.hs \
778
	test/hs/Test/Ganeti/Kvmd.hs \
779
	test/hs/Test/Ganeti/Luxi.hs \
780
	test/hs/Test/Ganeti/Network.hs \
781
	test/hs/Test/Ganeti/Objects.hs \
782
	test/hs/Test/Ganeti/OpCodes.hs \
783
	test/hs/Test/Ganeti/Query/Aliases.hs \
784
	test/hs/Test/Ganeti/Query/Filter.hs \
785
	test/hs/Test/Ganeti/Query/Instance.hs \
786
	test/hs/Test/Ganeti/Query/Language.hs \
787
	test/hs/Test/Ganeti/Query/Network.hs \
788
	test/hs/Test/Ganeti/Query/Query.hs \
789
	test/hs/Test/Ganeti/Rpc.hs \
790
	test/hs/Test/Ganeti/Runtime.hs \
791
	test/hs/Test/Ganeti/Ssconf.hs \
792
	test/hs/Test/Ganeti/Storage/Diskstats/Parser.hs \
793
	test/hs/Test/Ganeti/Storage/Drbd/Parser.hs \
794
	test/hs/Test/Ganeti/Storage/Drbd/Types.hs \
795
	test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs \
796
	test/hs/Test/Ganeti/THH.hs \
797
	test/hs/Test/Ganeti/TestCommon.hs \
798
	test/hs/Test/Ganeti/TestHTools.hs \
799
	test/hs/Test/Ganeti/TestHelper.hs \
800
	test/hs/Test/Ganeti/Types.hs \
801
	test/hs/Test/Ganeti/Utils.hs
802

    
803
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
804

    
805
HS_BUILT_SRCS = \
806
	test/hs/Test/Ganeti/TestImports.hs \
807
	src/AutoConf.hs \
808
	src/Ganeti/Hs2Py/ListConstants.hs \
809
	src/Ganeti/Curl/Internal.hs \
810
	src/Ganeti/Version.hs
811
HS_BUILT_SRCS_IN = \
812
	$(patsubst %,%.in,$(filter-out src/Ganeti/Curl/Internal.hs,$(HS_BUILT_SRCS))) \
813
	src/Ganeti/Curl/Internal.hsc \
814
	lib/_constants.py.in \
815
	lib/opcodes.py.in_after \
816
	lib/opcodes.py.in_before
817

    
818
HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
819

    
820
$(RUN_IN_TEMPDIR): | stamp-directories
821

    
822
doc/html/index.html: ENABLE_MANPAGES =
823
doc/man-html/index.html: ENABLE_MANPAGES = 1
824
doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
825

    
826
# Note: we use here an order-only prerequisite, as the contents of
827
# _constants.py are not actually influencing the html build output: it
828
# has to exist in order for the sphinx module to be loaded
829
# successfully, but we certainly don't want the docs to be rebuilt if
830
# it changes
831
doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
832
	configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
833
	lib/build/shell_example_lexer.py lib/ht.py \
834
	doc/css/style.css lib/rapi/connector.py lib/rapi/rlib2.py \
835
	autotools/sphinx-wrapper | $(BUILT_PYTHON_SOURCES)
836
	@test -n "$(SPHINX)" || \
837
	    { echo 'sphinx-build' not found during configure; exit 1; }
838
if !MANPAGES_IN_DOC
839
	if test -n '$(ENABLE_MANPAGES)'; then \
840
	  echo 'Man pages in documentation were disabled at configure time' >&2; \
841
	  exit 1; \
842
	fi
843
endif
844
## Sphinx provides little control over what content should be included. Some
845
## mechanisms exist, but they all have drawbacks or actual issues. Since we
846
## build two different versions of the documentation--once without man pages and
847
## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
848
## us with this, but requires running in a temporary directory. It moves the
849
## correct files into place depending on environment variables.
850
	dir=$(dir $@) && \
851
	@mkdir_p@ $$dir && \
852
	PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
853
	$(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
854
	    -d . \
855
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
856
	    -D release="$(PACKAGE_VERSION)" \
857
	    -D graphviz_dot="$(DOT)" \
858
	    -D enable_manpages="$(ENABLE_MANPAGES)" \
859
	    doc $(CURDIR)/$$dir && \
860
	rm -f $$dir/.buildinfo $$dir/objects.inv
861
	touch $@
862

    
863
doc/html: doc/html/index.html
864

    
865
doc/man-html: doc/man-html/index.html
866

    
867
doc/install-quick.rst: INSTALL
868
doc/news.rst: NEWS
869
doc/upgrade.rst: UPGRADE
870

    
871
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
872
	set -e; \
873
	{ echo '.. This file is automatically updated at build time from $<.'; \
874
	  echo '.. Do not edit.'; \
875
	  echo; \
876
	  cat $<; \
877
	} > $@
878

    
879
doc/manpages-enabled.rst: Makefile | $(built_base_sources)
880
	{ echo '.. This file is automatically generated, do not edit!'; \
881
	  echo ''; \
882
	  echo 'Man pages'; \
883
	  echo '========='; \
884
	  echo; \
885
	  echo '.. toctree::'; \
886
	  echo '   :maxdepth: 1'; \
887
	  echo; \
888
	  for i in $(notdir $(mandocrst)); do \
889
	    echo "   $$i"; \
890
	  done | LC_ALL=C sort; \
891
	} > $@
892

    
893
doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
894
if MANPAGES_IN_DOC
895
	{ echo '.. This file is automatically updated at build time from $<.'; \
896
	  echo '.. Do not edit.'; \
897
	  echo; \
898
	  echo "$*"; \
899
	  echo '=========================================='; \
900
	  tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
901
	} > $@
902
else
903
	echo 'Man pages in documentation were disabled at configure time' >&2; \
904
	exit 1;
905
endif
906

    
907
doc/users/%: doc/users/%.in Makefile $(REPLACE_VARS_SED)
908
	cat $< | sed -f $(REPLACE_VARS_SED) | LC_ALL=C sort | uniq | (grep -v '^root' || true) > $@
909

    
910
userspecs = \
911
	doc/users/users \
912
	doc/users/groups \
913
	doc/users/groupmemberships
914

    
915
# Things to build but not to install (add it to EXTRA_DIST if it should be
916
# distributed)
917
noinst_DATA = \
918
	$(BUILT_EXAMPLES) \
919
	doc/examples/bash_completion \
920
	doc/examples/bash_completion-debug \
921
	$(userspecs) \
922
	$(manhtml)
923

    
924
if HAS_SPHINX
925
if MANPAGES_IN_DOC
926
noinst_DATA += doc/man-html
927
else
928
noinst_DATA += doc/html
929
endif
930
endif
931

    
932
gnt_scripts = \
933
	scripts/gnt-backup \
934
	scripts/gnt-cluster \
935
	scripts/gnt-debug \
936
	scripts/gnt-group \
937
	scripts/gnt-instance \
938
	scripts/gnt-job \
939
	scripts/gnt-network \
940
	scripts/gnt-node \
941
	scripts/gnt-os \
942
	scripts/gnt-storage
943

    
944
gnt_scripts_basenames = \
945
	$(patsubst scripts/%,%,$(patsubst daemons/%,%,$(gnt_scripts) $(gnt_python_sbin_SCRIPTS)))
946

    
947
gnt_python_sbin_SCRIPTS = \
948
	$(PYTHON_BOOTSTRAP_SBIN)
949

    
950
gntpython_SCRIPTS = $(gnt_scripts)
951

    
952
PYTHON_BOOTSTRAP_SBIN = \
953
	daemons/ganeti-masterd \
954
	daemons/ganeti-noded \
955
	daemons/ganeti-rapi \
956
	daemons/ganeti-watcher
957

    
958
PYTHON_BOOTSTRAP = \
959
	tools/burnin \
960
	tools/ensure-dirs \
961
	tools/node-cleanup \
962
	tools/node-daemon-setup \
963
	tools/prepare-node-join
964

    
965
qa_scripts = \
966
	qa/__init__.py \
967
	qa/ganeti-qa.py \
968
	qa/qa_cluster.py \
969
	qa/qa_config.py \
970
	qa/qa_daemon.py \
971
	qa/qa_env.py \
972
	qa/qa_error.py \
973
	qa/qa_group.py \
974
	qa/qa_instance.py \
975
	qa/qa_instance_utils.py \
976
	qa/qa_job.py \
977
	qa/qa_monitoring.py \
978
	qa/qa_node.py \
979
	qa/qa_os.py \
980
	qa/qa_rapi.py \
981
	qa/qa_tags.py \
982
	qa/qa_utils.py \
983
        qa/rapi-workload.py
984

    
985
bin_SCRIPTS =
986
if WANT_HTOOLS
987
bin_SCRIPTS += $(HS_BIN_PROGS)
988
install-exec-hook:
989
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
990
# FIXME: this is a hardcoded logic, instead of auto-resolving
991
	$(LN_S) -f ../../../bin/htools \
992
	  $(DESTDIR)$(iallocatorsdir)/hail
993
	for role in $(HS_BIN_ROLES); do \
994
	  $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
995
	done
996
endif
997

    
998
HNORMAL_SUFFIX = .o
999
HPROFILE_SUFFIX = .prof.o
1000
HCOVERAGE_SUFFIX = .hpc.o
1001
HTEST_SUFFIX = .test.o
1002

    
1003
HSUFFIX = $(if $(HPROFILE),$(HPROFILE_SUFFIX), \
1004
	  $(if $(HCOVERAGE),$(HCOVERAGE_SUFFIX), \
1005
	  $(if $(HTEST),$(HTEST_SUFFIX), \
1006
	  $(HNORMAL_SUFFIX))))
1007

    
1008
HFLAGS += $(if $(HPROFILE),-prof -auto-all,)
1009
HFLAGS += $(if $(HCOVERAGE),-fhpc,)
1010
HFLAGS += $(if $(HTEST),-DTEST,)
1011

    
1012
HS_SRCS = $(HS_LIBTESTBUILT_SRCS)
1013

    
1014
.NOTPARALLEL: $(HS_ALL_PROGS)
1015
.PHONY: $(HS_ALL_PROGS)
1016
$(HS_ALL_PROGS): %: %.hs $(HS_SRCS) Makefile
1017
	@if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
1018
	  echo "Error: cannot run unittests without the development" \
1019
	       " libraries (see devnotes.rst)" 1>&2; \
1020
	  exit 1; \
1021
	fi
1022
	@rm -f $(notdir $@).tix
1023
	$(GHC) --make $(HFLAGS) \
1024
		-osuf $(HSUFFIX) \
1025
		-hisuf $(patsubst %.o,%.hi,$(HSUFFIX)) \
1026
		$(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA) $@
1027
	@touch "$@"
1028

    
1029
# for the test/hs/htest binary, we need to enable profiling/coverage
1030
test/hs/htest: HCOVERAGE = true
1031
test/hs/htest: HFLAGS += -itest/hs
1032
test/hs/htest: | $(BUILT_PYTHON_SOURCES)
1033

    
1034
# we compile the hpc-htools binary with the program coverage
1035
test/hs/hpc-htools: HCOVERAGE = true
1036

    
1037
# we compile the hpc-mon-collector binary with the program coverage
1038
test/hs/hpc-mon-collector: HCOVERAGE = true
1039

    
1040
# test dependency
1041
test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
1042

    
1043
# rule for building profiling-enabled versions of the haskell programs
1044
.PHONY: hs-prof
1045
hs-prof:
1046
	@if [ -z "$(TARGET)" ]; then \
1047
	  echo "You need to define TARGET when running this rule" 1>&2; \
1048
	  exit 1; \
1049
	fi
1050
	$(MAKE) $(AM_MAKEFLAGS) HPROFILE=y $(TARGET)
1051

    
1052
dist_sbin_SCRIPTS = \
1053
	tools/ganeti-listrunner
1054

    
1055
nodist_sbin_SCRIPTS = \
1056
	daemons/ganeti-cleaner
1057

    
1058
# strip path prefixes off the sbin scripts
1059
all_sbin_scripts = \
1060
	$(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
1061
	$(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
1062

    
1063
if ENABLE_CONFD
1064
src/ganeti-confd: src/hconfd
1065
	cp -f $< $@
1066

    
1067
src/ganeti-luxid: src/hluxid
1068
	cp -f $< $@
1069

    
1070
nodist_sbin_SCRIPTS += src/ganeti-confd
1071
nodist_sbin_SCRIPTS += src/ganeti-luxid
1072
nodist_sbin_SCRIPTS += src/ganeti-kvmd
1073
endif
1074

    
1075
if ENABLE_MOND
1076
nodist_sbin_SCRIPTS += src/ganeti-mond
1077
endif
1078

    
1079
python_scripts = \
1080
	tools/cfgshell \
1081
	tools/cfgupgrade \
1082
	tools/cfgupgrade12 \
1083
	tools/cluster-merge \
1084
	tools/confd-client \
1085
	tools/fmtjson \
1086
	tools/lvmstrap \
1087
	tools/move-instance \
1088
	tools/ovfconverter \
1089
	tools/post-upgrade \
1090
	tools/sanitize-config
1091

    
1092
dist_tools_SCRIPTS = \
1093
	tools/kvm-console-wrapper \
1094
	tools/master-ip-setup \
1095
	tools/xen-console-wrapper
1096

    
1097
dist_tools_python_SCRIPTS = \
1098
	$(python_scripts) \
1099
	tools/burnin
1100

    
1101
nodist_tools_python_SCRIPTS = \
1102
	tools/node-cleanup
1103

    
1104
tools_python_basenames = $(patsubst tools/%,%,\
1105
	$(dist_tools_python_SCRIPTS) $(nodist_tools_python_SCRIPTS))
1106

    
1107
nodist_tools_SCRIPTS = \
1108
	tools/users-setup \
1109
	tools/vcluster-setup
1110

    
1111
tools_basenames = $(patsubst tools/%,%,$(nodist_tools_SCRIPTS) $(dist_tools_SCRIPTS))
1112

    
1113
pkglib_python_scripts = \
1114
	daemons/import-export \
1115
	tools/check-cert-expired
1116

    
1117
nodist_pkglib_python_scripts = \
1118
	tools/ensure-dirs \
1119
	tools/node-daemon-setup \
1120
	tools/prepare-node-join
1121

    
1122
pkglib_python_basenames = \
1123
	$(patsubst daemons/%,%,$(patsubst tools/%,%,\
1124
	$(pkglib_python_scripts) $(nodist_pkglib_python_scripts)))
1125

    
1126
myexeclib_SCRIPTS = \
1127
	daemons/daemon-util \
1128
	tools/kvm-ifup \
1129
	tools/vif-ganeti \
1130
	tools/net-common \
1131
	$(HS_MYEXECLIB_PROGS)
1132

    
1133
# compute the basenames of the myexeclib_scripts
1134
myexeclib_scripts_basenames = \
1135
	$(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst src/%,%,$(myexeclib_SCRIPTS))))
1136

    
1137
EXTRA_DIST = \
1138
	NEWS \
1139
	UPGRADE \
1140
	epydoc.conf.in \
1141
	pylintrc \
1142
	pylintrc-test \
1143
	autotools/build-bash-completion \
1144
	autotools/build-rpc \
1145
	autotools/check-header \
1146
	autotools/check-imports \
1147
	autotools/check-man-dashes \
1148
	autotools/check-man-references \
1149
	autotools/check-man-warnings \
1150
	autotools/check-news \
1151
	autotools/check-python-code \
1152
	autotools/check-tar \
1153
	autotools/check-version \
1154
	autotools/docpp \
1155
	autotools/gen-py-coverage \
1156
	autotools/print-py-constants \
1157
	autotools/sphinx-wrapper \
1158
	autotools/testrunner \
1159
	autotools/wrong-hardcoded-paths \
1160
	$(RUN_IN_TEMPDIR) \
1161
	daemons/daemon-util.in \
1162
	daemons/ganeti-cleaner.in \
1163
	$(pkglib_python_scripts) \
1164
	devel/upload \
1165
	devel/webserver \
1166
	tools/kvm-ifup.in \
1167
	tools/vif-ganeti.in \
1168
	tools/net-common.in \
1169
	tools/vcluster-setup.in \
1170
	$(docinput) \
1171
	doc/html \
1172
	$(BUILT_EXAMPLES:%=%.in) \
1173
	doc/examples/ganeti.default \
1174
	doc/examples/ganeti.default-debug \
1175
	doc/examples/hooks/ethers \
1176
	doc/examples/gnt-debug/README \
1177
	doc/examples/gnt-debug/delay0.json \
1178
	doc/examples/gnt-debug/delay50.json \
1179
	doc/users/groupmemberships.in \
1180
	doc/users/groups.in \
1181
	doc/users/users.in \
1182
	$(dist_TESTS) \
1183
	$(TEST_FILES) \
1184
	$(python_test_support) \
1185
	man/footer.rst \
1186
	$(manrst) \
1187
	$(maninput) \
1188
	qa/qa-sample.json \
1189
	$(qa_scripts) \
1190
	$(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
1191
	$(HS_PROG_SRCS) \
1192
	src/lint-hints.hs \
1193
	test/hs/cli-tests-defs.sh \
1194
	test/hs/offline-test.sh \
1195
	.ghci
1196

    
1197
man_MANS = \
1198
	man/ganeti-cleaner.8 \
1199
	man/ganeti-confd.8 \
1200
	man/ganeti-luxid.8 \
1201
	man/ganeti-listrunner.8 \
1202
	man/ganeti-kvmd.8 \
1203
	man/ganeti-masterd.8 \
1204
	man/ganeti-mond.8 \
1205
	man/ganeti-noded.8 \
1206
	man/ganeti-os-interface.7 \
1207
	man/ganeti-extstorage-interface.7 \
1208
	man/ganeti-rapi.8 \
1209
	man/ganeti-watcher.8 \
1210
	man/ganeti.7 \
1211
	man/gnt-backup.8 \
1212
	man/gnt-cluster.8 \
1213
	man/gnt-debug.8 \
1214
	man/gnt-group.8 \
1215
	man/gnt-network.8 \
1216
	man/gnt-instance.8 \
1217
	man/gnt-job.8 \
1218
	man/gnt-node.8 \
1219
	man/gnt-os.8 \
1220
	man/gnt-storage.8 \
1221
	man/hail.1 \
1222
	man/harep.1 \
1223
	man/hbal.1 \
1224
	man/hcheck.1 \
1225
	man/hinfo.1 \
1226
	man/hscan.1 \
1227
	man/hspace.1 \
1228
	man/hsqueeze.1 \
1229
	man/hroller.1 \
1230
	man/htools.1 \
1231
	man/mon-collector.7
1232

    
1233
# Remove extensions from all filenames in man_MANS
1234
mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
1235

    
1236
manrst = $(patsubst %,%.rst,$(mannoext))
1237
manhtml = $(patsubst %.rst,%.html,$(manrst))
1238
mangen = $(patsubst %.rst,%.gen,$(manrst))
1239
maninput = \
1240
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
1241
	$(patsubst %.html,%.html.in,$(manhtml)) \
1242
	$(mangen)
1243

    
1244
manfullpath = $(patsubst man/%.1,man1/%.1,\
1245
	$(patsubst man/%.7,man7/%.7,\
1246
	$(patsubst man/%.8,man8/%.8,$(man_MANS))))
1247

    
1248
TEST_FILES = \
1249
	test/autotools/autotools-check-news.test \
1250
	test/data/htools/clean-nonzero-score.data \
1251
	test/data/htools/common-suffix.data \
1252
	test/data/htools/empty-cluster.data \
1253
	test/data/htools/hail-alloc-drbd.json \
1254
	test/data/htools/hail-alloc-invalid-network.json \
1255
	test/data/htools/hail-alloc-invalid-twodisks.json \
1256
	test/data/htools/hail-alloc-restricted-network.json \
1257
	test/data/htools/hail-alloc-spindles.json \
1258
	test/data/htools/hail-alloc-twodisks.json \
1259
	test/data/htools/hail-change-group.json \
1260
	test/data/htools/hail-invalid-reloc.json \
1261
	test/data/htools/hail-node-evac.json \
1262
	test/data/htools/hail-reloc-drbd.json \
1263
	test/data/htools/hbal-dyn.data \
1264
	test/data/htools/hbal-excl-tags.data \
1265
	test/data/htools/hbal-split-insts.data \
1266
	test/data/htools/hspace-tiered-dualspec-exclusive.data \
1267
	test/data/htools/hspace-tiered-dualspec.data \
1268
	test/data/htools/hspace-tiered-exclusive.data \
1269
	test/data/htools/hspace-tiered-ipolicy.data \
1270
	test/data/htools/hspace-tiered-mixed.data \
1271
	test/data/htools/hspace-tiered-resourcetypes.data \
1272
	test/data/htools/hspace-tiered-vcpu.data \
1273
	test/data/htools/hspace-tiered.data \
1274
	test/data/htools/invalid-node.data \
1275
	test/data/htools/missing-resources.data \
1276
	test/data/htools/multiple-master.data \
1277
	test/data/htools/multiple-tags.data \
1278
	test/data/htools/n1-failure.data \
1279
	test/data/htools/rapi/groups.json \
1280
	test/data/htools/rapi/info.json \
1281
	test/data/htools/rapi/instances.json \
1282
	test/data/htools/rapi/nodes.json \
1283
	test/data/htools/hroller-full.data \
1284
	test/data/htools/hroller-nodegroups.data \
1285
	test/data/htools/hroller-nonredundant.data \
1286
	test/data/htools/hroller-online.data \
1287
	test/data/htools/hsqueeze-mixed-instances.data \
1288
	test/data/htools/hsqueeze-overutilized.data \
1289
	test/data/htools/hsqueeze-underutilized.data \
1290
	test/data/htools/unique-reboot-order.data \
1291
	test/hs/shelltests/htools-balancing.test \
1292
	test/hs/shelltests/htools-basic.test \
1293
	test/hs/shelltests/htools-dynutil.test \
1294
	test/hs/shelltests/htools-excl.test \
1295
	test/hs/shelltests/htools-hail.test \
1296
	test/hs/shelltests/htools-hroller.test \
1297
	test/hs/shelltests/htools-hspace.test \
1298
	test/hs/shelltests/htools-hsqueeze.test \
1299
	test/hs/shelltests/htools-invalid.test \
1300
	test/hs/shelltests/htools-multi-group.test \
1301
	test/hs/shelltests/htools-no-backend.test \
1302
	test/hs/shelltests/htools-rapi.test \
1303
	test/hs/shelltests/htools-single-group.test \
1304
	test/hs/shelltests/htools-text-backend.test \
1305
	test/hs/shelltests/htools-mon-collector.test \
1306
	test/data/bdev-drbd-8.0.txt \
1307
	test/data/bdev-drbd-8.3.txt \
1308
	test/data/bdev-drbd-8.4.txt \
1309
	test/data/bdev-drbd-8.4-no-disk-params.txt \
1310
	test/data/bdev-drbd-disk.txt \
1311
	test/data/bdev-drbd-net-ip4.txt \
1312
	test/data/bdev-drbd-net-ip6.txt \
1313
	test/data/bdev-rbd/json_output_empty.txt \
1314
	test/data/bdev-rbd/json_output_extra_matches.txt \
1315
	test/data/bdev-rbd/json_output_no_matches.txt \
1316
	test/data/bdev-rbd/json_output_ok.txt \
1317
	test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1318
	test/data/bdev-rbd/plain_output_new_no_matches.txt \
1319
	test/data/bdev-rbd/plain_output_new_ok.txt \
1320
	test/data/bdev-rbd/plain_output_old_empty.txt \
1321
	test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1322
	test/data/bdev-rbd/plain_output_old_no_matches.txt \
1323
	test/data/bdev-rbd/plain_output_old_ok.txt \
1324
	test/data/bdev-rbd/output_invalid.txt \
1325
	test/data/cert1.pem \
1326
	test/data/cert2.pem \
1327
	test/data/cluster_config_2.7.json \
1328
	test/data/cluster_config_2.8.json \
1329
	test/data/cluster_config_2.9.json \
1330
	test/data/cluster_config_2.10.json \
1331
	test/data/instance-minor-pairing.txt \
1332
	test/data/instance-prim-sec.txt \
1333
	test/data/ip-addr-show-dummy0.txt \
1334
	test/data/ip-addr-show-lo-ipv4.txt \
1335
	test/data/ip-addr-show-lo-ipv6.txt \
1336
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
1337
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
1338
	test/data/ip-addr-show-lo-oneline.txt \
1339
	test/data/ip-addr-show-lo.txt \
1340
	test/data/kvm_0.12.5_help.txt \
1341
	test/data/kvm_0.15.90_help.txt \
1342
	test/data/kvm_0.9.1_help.txt \
1343
	test/data/kvm_0.9.1_help_boot_test.txt \
1344
	test/data/kvm_1.0_help.txt \
1345
	test/data/kvm_1.1.2_help.txt \
1346
	test/data/kvm_runtime.json \
1347
	test/data/lvs_lv.txt \
1348
	test/data/NEWS_OK.txt \
1349
	test/data/NEWS_previous_unreleased.txt \
1350
	test/data/ovfdata/compr_disk.vmdk.gz \
1351
	test/data/ovfdata/config.ini \
1352
	test/data/ovfdata/corrupted_resources.ovf \
1353
	test/data/ovfdata/empty.ini \
1354
	test/data/ovfdata/empty.ovf \
1355
	test/data/ovfdata/ganeti.mf \
1356
	test/data/ovfdata/ganeti.ovf \
1357
	test/data/ovfdata/gzip_disk.ovf \
1358
	test/data/ovfdata/new_disk.vmdk \
1359
	test/data/ovfdata/no_disk.ini \
1360
	test/data/ovfdata/no_disk_in_ref.ovf \
1361
	test/data/ovfdata/no_os.ini \
1362
	test/data/ovfdata/no_ovf.ova \
1363
	test/data/ovfdata/other/rawdisk.raw \
1364
	test/data/ovfdata/ova.ova \
1365
	test/data/ovfdata/rawdisk.raw \
1366
	test/data/ovfdata/second_disk.vmdk \
1367
	test/data/ovfdata/unsafe_path.ini \
1368
	test/data/ovfdata/virtualbox.ovf \
1369
	test/data/ovfdata/wrong_config.ini \
1370
	test/data/ovfdata/wrong_extension.ovd \
1371
	test/data/ovfdata/wrong_manifest.mf \
1372
	test/data/ovfdata/wrong_manifest.ovf \
1373
	test/data/ovfdata/wrong_ova.ova \
1374
	test/data/ovfdata/wrong_xml.ovf \
1375
	test/data/proc_diskstats.txt \
1376
	test/data/proc_drbd8.txt \
1377
	test/data/proc_drbd80-emptyline.txt \
1378
	test/data/proc_drbd80-emptyversion.txt \
1379
	test/data/proc_drbd83.txt \
1380
	test/data/proc_drbd83_sync.txt \
1381
	test/data/proc_drbd83_sync_want.txt \
1382
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
1383
	test/data/proc_drbd84.txt \
1384
	test/data/proc_drbd84_sync.txt \
1385
	test/data/proc_meminfo.txt \
1386
	test/data/proc_cpuinfo.txt \
1387
	test/data/qa-minimal-nodes-instances-only.json \
1388
	test/data/sys_drbd_usermode_helper.txt \
1389
	test/data/vgreduce-removemissing-2.02.02.txt \
1390
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
1391
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
1392
	test/data/vgs-missing-pvs-2.02.02.txt \
1393
	test/data/vgs-missing-pvs-2.02.66.txt \
1394
	test/data/xen-xm-info-4.0.1.txt \
1395
	test/data/xen-xm-list-4.0.1-dom0-only.txt \
1396
	test/data/xen-xm-list-4.0.1-four-instances.txt \
1397
	test/data/xen-xm-list-long-4.0.1.txt \
1398
	test/data/xen-xm-uptime-4.0.1.txt \
1399
	test/py/ganeti-cli.test \
1400
	test/py/gnt-cli.test \
1401
	test/py/import-export_unittest-helper
1402

    
1403

    
1404
python_tests = \
1405
	doc/examples/rapi_testutils.py \
1406
	test/py/cmdlib/backup_unittest.py \
1407
	test/py/cmdlib/cluster_unittest.py \
1408
	test/py/cmdlib/cmdlib_unittest.py \
1409
	test/py/cmdlib/group_unittest.py \
1410
	test/py/cmdlib/instance_unittest.py \
1411
	test/py/cmdlib/instance_migration_unittest.py \
1412
	test/py/cmdlib/instance_query_unittest.py \
1413
	test/py/cmdlib/instance_storage_unittest.py \
1414
	test/py/cmdlib/node_unittest.py \
1415
	test/py/cmdlib/test_unittest.py \
1416
	test/py/cfgupgrade_unittest.py \
1417
	test/py/docs_unittest.py \
1418
	test/py/ganeti.asyncnotifier_unittest.py \
1419
	test/py/ganeti.backend_unittest-runasroot.py \
1420
	test/py/ganeti.backend_unittest.py \
1421
	test/py/ganeti.bootstrap_unittest.py \
1422
	test/py/ganeti.cli_unittest.py \
1423
	test/py/ganeti.client.gnt_cluster_unittest.py \
1424
	test/py/ganeti.client.gnt_instance_unittest.py \
1425
	test/py/ganeti.client.gnt_job_unittest.py \
1426
	test/py/ganeti.compat_unittest.py \
1427
	test/py/ganeti.confd.client_unittest.py \
1428
	test/py/ganeti.config_unittest.py \
1429
	test/py/ganeti.constants_unittest.py \
1430
	test/py/ganeti.daemon_unittest.py \
1431
	test/py/ganeti.errors_unittest.py \
1432
	test/py/ganeti.hooks_unittest.py \
1433
	test/py/ganeti.ht_unittest.py \
1434
	test/py/ganeti.http_unittest.py \
1435
	test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1436
	test/py/ganeti.hypervisor.hv_fake_unittest.py \
1437
	test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1438
	test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1439
	test/py/ganeti.hypervisor.hv_xen_unittest.py \
1440
	test/py/ganeti.hypervisor_unittest.py \
1441
	test/py/ganeti.impexpd_unittest.py \
1442
	test/py/ganeti.jqueue_unittest.py \
1443
	test/py/ganeti.jstore_unittest.py \
1444
	test/py/ganeti.locking_unittest.py \
1445
	test/py/ganeti.luxi_unittest.py \
1446
	test/py/ganeti.masterd.iallocator_unittest.py \
1447
	test/py/ganeti.masterd.instance_unittest.py \
1448
	test/py/ganeti.mcpu_unittest.py \
1449
	test/py/ganeti.netutils_unittest.py \
1450
	test/py/ganeti.objects_unittest.py \
1451
	test/py/ganeti.opcodes_unittest.py \
1452
	test/py/ganeti.outils_unittest.py \
1453
	test/py/ganeti.ovf_unittest.py \
1454
	test/py/ganeti.qlang_unittest.py \
1455
	test/py/ganeti.query_unittest.py \
1456
	test/py/ganeti.rapi.baserlib_unittest.py \
1457
	test/py/ganeti.rapi.client_unittest.py \
1458
	test/py/ganeti.rapi.resources_unittest.py \
1459
	test/py/ganeti.rapi.rlib2_unittest.py \
1460
	test/py/ganeti.rapi.testutils_unittest.py \
1461
	test/py/ganeti.rpc_unittest.py \
1462
	test/py/ganeti.rpc.client_unittest.py \
1463
	test/py/ganeti.runtime_unittest.py \
1464
	test/py/ganeti.serializer_unittest.py \
1465
	test/py/ganeti.server.rapi_unittest.py \
1466
	test/py/ganeti.ssconf_unittest.py \
1467
	test/py/ganeti.ssh_unittest.py \
1468
	test/py/ganeti.storage.bdev_unittest.py \
1469
	test/py/ganeti.storage.container_unittest.py \
1470
	test/py/ganeti.storage.drbd_unittest.py \
1471
	test/py/ganeti.storage.filestorage_unittest.py \
1472
	test/py/ganeti.storage.gluster_unittest.py \
1473
	test/py/ganeti.tools.burnin_unittest.py \
1474
	test/py/ganeti.tools.ensure_dirs_unittest.py \
1475
	test/py/ganeti.tools.node_daemon_setup_unittest.py \
1476
	test/py/ganeti.tools.prepare_node_join_unittest.py \
1477
	test/py/ganeti.uidpool_unittest.py \
1478
	test/py/ganeti.utils.algo_unittest.py \
1479
	test/py/ganeti.utils.filelock_unittest.py \
1480
	test/py/ganeti.utils.hash_unittest.py \
1481
	test/py/ganeti.utils.io_unittest-runasroot.py \
1482
	test/py/ganeti.utils.io_unittest.py \
1483
	test/py/ganeti.utils.log_unittest.py \
1484
	test/py/ganeti.utils.lvm_unittest.py \
1485
	test/py/ganeti.utils.mlock_unittest.py \
1486
	test/py/ganeti.utils.nodesetup_unittest.py \
1487
	test/py/ganeti.utils.process_unittest.py \
1488
	test/py/ganeti.utils.retry_unittest.py \
1489
	test/py/ganeti.utils.security_unittest.py \
1490
	test/py/ganeti.utils.storage_unittest.py \
1491
	test/py/ganeti.utils.text_unittest.py \
1492
	test/py/ganeti.utils.version_unittest.py \
1493
	test/py/ganeti.utils.wrapper_unittest.py \
1494
	test/py/ganeti.utils.x509_unittest.py \
1495
	test/py/ganeti.utils_unittest.py \
1496
	test/py/ganeti.vcluster_unittest.py \
1497
	test/py/ganeti.workerpool_unittest.py \
1498
	test/py/pycurl_reset_unittest.py \
1499
	test/py/qa.qa_config_unittest.py \
1500
	test/py/tempfile_fork_unittest.py
1501

    
1502
python_test_support = \
1503
	test/py/__init__.py \
1504
	test/py/lockperf.py \
1505
	test/py/testutils.py \
1506
	test/py/mocks.py \
1507
	test/py/cmdlib/__init__.py \
1508
	test/py/cmdlib/testsupport/__init__.py \
1509
	test/py/cmdlib/testsupport/cmdlib_testcase.py \
1510
	test/py/cmdlib/testsupport/config_mock.py \
1511
	test/py/cmdlib/testsupport/iallocator_mock.py \
1512
	test/py/cmdlib/testsupport/lock_manager_mock.py \
1513
	test/py/cmdlib/testsupport/netutils_mock.py \
1514
	test/py/cmdlib/testsupport/processor_mock.py \
1515
	test/py/cmdlib/testsupport/rpc_runner_mock.py \
1516
	test/py/cmdlib/testsupport/ssh_mock.py \
1517
	test/py/cmdlib/testsupport/utils_mock.py \
1518
	test/py/cmdlib/testsupport/util.py
1519

    
1520
haskell_tests = test/hs/htest
1521

    
1522
dist_TESTS = \
1523
	test/py/check-cert-expired_unittest.bash \
1524
	test/py/daemon-util_unittest.bash \
1525
	test/py/ganeti-cleaner_unittest.bash \
1526
	test/py/import-export_unittest.bash \
1527
	test/py/cli-test.bash \
1528
	test/py/bash_completion.bash
1529

    
1530
if PY_UNIT
1531
dist_TESTS += $(python_tests)
1532
endif
1533

    
1534
nodist_TESTS =
1535
check_SCRIPTS =
1536

    
1537
if WANT_HSTESTS
1538
nodist_TESTS += $(haskell_tests)
1539
dist_TESTS += test/hs/offline-test.sh
1540
check_SCRIPTS += \
1541
	test/hs/hpc-htools \
1542
	test/hs/hpc-mon-collector \
1543
	$(HS_BUILT_TEST_HELPERS)
1544
endif
1545

    
1546
TESTS = $(dist_TESTS) $(nodist_TESTS)
1547

    
1548
# Environment for all tests
1549
PLAIN_TESTS_ENVIRONMENT = \
1550
	PYTHONPATH=.:./test/py \
1551
	TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1552
	PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1553
	$(RUN_IN_TEMPDIR)
1554

    
1555
# Environment for tests run by automake
1556
TESTS_ENVIRONMENT = \
1557
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1558

    
1559
all_python_code = \
1560
	$(dist_sbin_SCRIPTS) \
1561
	$(python_scripts) \
1562
	$(pkglib_python_scripts) \
1563
	$(nodist_pkglib_python_scripts) \
1564
	$(nodist_tools_python_scripts) \
1565
	$(pkgpython_PYTHON) \
1566
	$(client_PYTHON) \
1567
	$(cmdlib_PYTHON) \
1568
	$(hypervisor_PYTHON) \
1569
	$(storage_PYTHON) \
1570
	$(rapi_PYTHON) \
1571
	$(server_PYTHON) \
1572
	$(rpc_PYTHON) \
1573
	$(pytools_PYTHON) \
1574
	$(http_PYTHON) \
1575
	$(confd_PYTHON) \
1576
	$(masterd_PYTHON) \
1577
	$(impexpd_PYTHON) \
1578
	$(utils_PYTHON) \
1579
	$(watcher_PYTHON) \
1580
	$(noinst_PYTHON) \
1581
	$(qa_scripts)
1582

    
1583
if PY_UNIT
1584
all_python_code += $(python_tests)
1585
all_python_code += $(python_test_support)
1586
endif
1587

    
1588
srclink_files = \
1589
	man/footer.rst \
1590
	test/py/check-cert-expired_unittest.bash \
1591
	test/py/daemon-util_unittest.bash \
1592
	test/py/ganeti-cleaner_unittest.bash \
1593
	test/py/import-export_unittest.bash \
1594
	test/py/cli-test.bash \
1595
	test/py/bash_completion.bash \
1596
	test/hs/offline-test.sh \
1597
	test/hs/cli-tests-defs.sh \
1598
	$(all_python_code) \
1599
	$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1600
	$(docinput)
1601

    
1602
check_python_code = \
1603
	$(BUILD_BASH_COMPLETION) \
1604
	$(CHECK_IMPORTS) \
1605
	$(CHECK_HEADER) \
1606
	$(DOCPP) \
1607
	$(all_python_code)
1608

    
1609
lint_python_code = \
1610
	ganeti \
1611
	ganeti/http/server.py \
1612
	$(dist_sbin_SCRIPTS) \
1613
	$(python_scripts) \
1614
	$(pkglib_python_scripts) \
1615
	$(BUILD_BASH_COMPLETION) \
1616
	$(CHECK_IMPORTS) \
1617
	$(CHECK_HEADER) \
1618
	$(DOCPP) \
1619
	$(gnt_python_sbin_SCRIPTS) \
1620
	$(PYTHON_BOOTSTRAP)
1621

    
1622
standalone_python_modules = \
1623
	lib/rapi/client.py \
1624
	tools/ganeti-listrunner
1625

    
1626
pep8_python_code = \
1627
	ganeti \
1628
	ganeti/http/server.py \
1629
	$(dist_sbin_SCRIPTS) \
1630
	$(python_scripts) \
1631
	$(pkglib_python_scripts) \
1632
	$(BUILD_BASH_COMPLETION) \
1633
	$(CHECK_HEADER) \
1634
	$(DOCPP) \
1635
	$(PYTHON_BOOTSTRAP) \
1636
	$(gnt_python_sbin_SCRIPTS) \
1637
	qa \
1638
	$(python_test_support)
1639

    
1640
test/py/daemon-util_unittest.bash: daemons/daemon-util
1641

    
1642
test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1643

    
1644
test/py/bash_completion.bash: doc/examples/bash_completion-debug
1645

    
1646
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1647
	sed -f $(REPLACE_VARS_SED) < $< > $@
1648
	chmod +x $@
1649

    
1650
tools/vif-ganeti: tools/vif-ganeti.in $(REPLACE_VARS_SED)
1651
	sed -f $(REPLACE_VARS_SED) < $< > $@
1652
	chmod +x $@
1653

    
1654
tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
1655
	sed -f $(REPLACE_VARS_SED) < $< > $@
1656
	chmod +x $@
1657

    
1658
tools/users-setup: Makefile $(userspecs)
1659
	set -e; \
1660
	{ echo '#!/bin/sh'; \
1661
	  echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
1662
	  echo 'then echo "This will do the following changes"'; \
1663
	  $(AWK) -- '{print "echo + Will add group ",$$1; count++}\
1664
	             END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \
1665
	  $(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \
1666
	                          else {print "echo + Will add user",$$1}; count++}\
1667
	             END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \
1668
	  $(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \
1669
	  echo 'echo'; \
1670
	  echo 'echo "OK? (y/n)"'; \
1671
	  echo 'read confirm'; \
1672
	  echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
1673
	  echo 'fi'; \
1674
	  $(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
1675
	  $(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
1676
	  $(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
1677
	} > $@
1678
	chmod +x $@
1679

    
1680
tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1681
	sed -f $(REPLACE_VARS_SED) < $< > $@
1682
	chmod +x $@
1683

    
1684
daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1685
	sed -f $(REPLACE_VARS_SED) < $< > $@
1686
	chmod +x $@
1687

    
1688
doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1689
	sed -f $(REPLACE_VARS_SED) < $< > $@
1690

    
1691
doc/examples/bash_completion: BC_ARGS = --compact
1692
doc/examples/bash_completion-debug: BC_ARGS =
1693

    
1694
doc/examples/bash_completion doc/examples/bash_completion-debug: \
1695
	$(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1696
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1697
	daemons/ganeti-cleaner \
1698
	$(GENERATED_FILES) $(HS_GENERATED_FILES)
1699
	PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1700
	  $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1701

    
1702
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1703
	lib/build/shell_example_lexer.py \
1704
	| $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1705
	@echo "Checking $< for hardcoded paths..."
1706
	@if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1707
	  echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1708
	  exit 1; \
1709
	fi
1710
	set -e ; \
1711
	trap 'echo auto-removing $@; rm $@' EXIT; \
1712
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1713
	$(CHECK_MAN_REFERENCES) $@; \
1714
	trap - EXIT
1715

    
1716
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1717
	@test -n "$(PANDOC)" || \
1718
	  { echo 'pandoc' not found during configure; exit 1; }
1719
	set -o pipefail -e; \
1720
	trap 'echo auto-removing $@; rm $@' EXIT; \
1721
	$(PANDOC) -s -f rst -t man $< man/footer.rst | \
1722
	  sed -e 's/\\@/@/g' > $@; \
1723
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1724
	$(CHECK_MAN_DASHES) $@; \
1725
	trap - EXIT
1726

    
1727
man/%.html.in: man/%.gen man/footer.rst
1728
	@test -n "$(PANDOC)" || \
1729
	  { echo 'pandoc' not found during configure; exit 1; }
1730
	set -o pipefail ; \
1731
	$(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1732
	  sed -e 's/\\@/@/g' > $@
1733

    
1734
man/%: man/%.in  $(REPLACE_VARS_SED)
1735
	sed -f $(REPLACE_VARS_SED) < $< > $@
1736

    
1737
epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1738
	sed -f $(REPLACE_VARS_SED) < $< > $@
1739

    
1740
vcs-version:
1741
	if test -d .git; then \
1742
	  git describe > $@; \
1743
	elif test ! -f $@ ; then \
1744
	  echo "Cannot auto-generate $@ file"; exit 1; \
1745
	fi
1746

    
1747
.PHONY: clean-vcs-version
1748
clean-vcs-version:
1749
	rm -f vcs-version
1750

    
1751
.PHONY: regen-vcs-version
1752
regen-vcs-version:
1753
	@set -e; \
1754
	cd $(srcdir); \
1755
	if test -d .git; then \
1756
	  T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1757
	  git describe > $$T; \
1758
	  if ! cmp --quiet $$T vcs-version; then \
1759
	    mv $$T vcs-version; \
1760
	  fi; \
1761
	fi
1762

    
1763
src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1764
	vcs-version $(built_base_sources)
1765
	set -e; \
1766
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1767
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
1768

    
1769
src/Ganeti/Hs2Py/ListConstants.hs: src/Ganeti/Hs2Py/ListConstants.hs.in \
1770
				   src/Ganeti/Constants.hs \
1771
			         | stamp-directories
1772
	@echo Generating $@
1773
	@set -e; \
1774
## Extract constant names from 'Constants.hs' by extracting the left
1775
## side of all lines containing an equal sign (i.e., '=') and
1776
## prepending the apostrophe sign (i.e., "'").
1777
##
1778
## For example, the constant
1779
##   adminstDown = ...
1780
## becomes
1781
##   'adminstDown
1782
	NAMES=$$(sed -e "/^--/ d" $(abs_top_srcdir)/src/Ganeti/Constants.hs |\
1783
		 sed -n -e "/=/ s/\(.*\) =.*/    '\1:/g p"); \
1784
	m4 -DPY_CONSTANT_NAMES="$$NAMES" $(abs_top_srcdir)/$< > $@
1785

    
1786
src/Ganeti/Curl/Internal.hs: src/Ganeti/Curl/Internal.hsc | stamp-directories
1787
	hsc2hs -o $@ $<
1788

    
1789
test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1790
	$(built_base_sources)
1791
	set -e; \
1792
	{ cat $< ; \
1793
	  echo ; \
1794
	  for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1795
	    echo "import $$name ()" ; \
1796
	  done ; \
1797
	} > $@
1798

    
1799
lib/_constants.py: Makefile src/hs2py lib/_constants.py.in | stamp-directories
1800
	cat $(abs_top_srcdir)/lib/_constants.py.in > $@
1801
	src/hs2py --constants >> $@
1802

    
1803
lib/constants.py: lib/_constants.py
1804

    
1805
src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
1806
	       | $(built_base_sources)
1807
	@echo "m4 ... >" $@
1808
	@m4 -DPACKAGE_VERSION="$(PACKAGE_VERSION)" \
1809
	    -DVERSION_MAJOR="$(VERSION_MAJOR)" \
1810
	    -DVERSION_MINOR="$(VERSION_MINOR)" \
1811
	    -DVERSION_REVISION="$(VERSION_REVISION)" \
1812
	    -DVERSION_SUFFIX="$(VERSION_SUFFIX)" \
1813
	    -DVERSION_FULL="$(VERSION_FULL)" \
1814
	    -DDIRVERSION="$(DIRVERSION)" \
1815
	    -DLOCALSTATEDIR="$(localstatedir)" \
1816
	    -DSYSCONFDIR="$(sysconfdir)" \
1817
	    -DSSH_CONFIG_DIR="$(SSH_CONFIG_DIR)" \
1818
	    -DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \
1819
	    -DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \
1820
	    -DEXPORT_DIR="$(EXPORT_DIR)" \
1821
	    -DOS_SEARCH_PATH="\"$(OS_SEARCH_PATH)\"" \
1822
	    -DES_SEARCH_PATH="\"$(ES_SEARCH_PATH)\"" \
1823
	    -DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \
1824
	    -DXEN_CONFIG_DIR="$(XEN_CONFIG_DIR)" \
1825
	    -DXEN_KERNEL="$(XEN_KERNEL)" \
1826
	    -DXEN_INITRD="$(XEN_INITRD)" \
1827
	    -DKVM_KERNEL="$(KVM_KERNEL)" \
1828
	    -DSHARED_FILE_STORAGE_DIR="$(SHARED_FILE_STORAGE_DIR)" \
1829
	    -DIALLOCATOR_SEARCH_PATH="\"$(IALLOCATOR_SEARCH_PATH)\"" \
1830
	    -DKVM_PATH="$(KVM_PATH)" \
1831
	    -DIP_PATH="$(IP_PATH)" \
1832
	    -DSOCAT_PATH="$(SOCAT)" \
1833
	    -DSOCAT_USE_ESCAPE="$(SOCAT_USE_ESCAPE)" \
1834
	    -DSOCAT_USE_COMPRESS="$(SOCAT_USE_COMPRESS)" \
1835
	    -DLVM_STRIPECOUNT="$(LVM_STRIPECOUNT)" \
1836
	    -DTOOLSDIR="$(libdir)/ganeti/tools" \
1837
	    -DGNT_SCRIPTS="$(foreach i,$(notdir $(gnt_scripts)),\"$(i)\":)" \
1838
	    -DHS_HTOOLS_PROGS="$(foreach i,$(HS_HTOOLS_PROGS),\"$(i)\":)" \
1839
	    -DPKGLIBDIR="$(libdir)/ganeti" \
1840
	    -DSHAREDIR="$(prefix)/share/ganeti" \
1841
	    -DVERSIONEDSHAREDIR="$(versionedsharedir)" \
1842
	    -DDRBD_BARRIERS="$(DRBD_BARRIERS)" \
1843
	    -DDRBD_NO_META_FLUSH="$(DRBD_NO_META_FLUSH)" \
1844
	    -DSYSLOG_USAGE="$(SYSLOG_USAGE)" \
1845
	    -DDAEMONS_GROUP="$(DAEMONS_GROUP)" \
1846
	    -DADMIN_GROUP="$(ADMIN_GROUP)" \
1847
	    -DMASTERD_USER="$(MASTERD_USER)" \
1848
	    -DMASTERD_GROUP="$(MASTERD_GROUP)" \
1849
	    -DRAPI_USER="$(RAPI_USER)" \
1850
	    -DRAPI_GROUP="$(RAPI_GROUP)" \
1851
	    -DCONFD_USER="$(CONFD_USER)" \
1852
	    -DCONFD_GROUP="$(CONFD_GROUP)" \
1853
	    -DKVMD_USER="$(KVMD_USER)" \
1854
	    -DKVMD_GROUP="$(KVMD_GROUP)" \
1855
	    -DLUXID_USER="$(LUXID_USER)" \
1856
	    -DLUXID_GROUP="$(LUXID_GROUP)" \
1857
	    -DNODED_USER="$(NODED_USER)" \
1858
	    -DNODED_GROUP="$(NODED_GROUP)" \
1859
	    -DMOND_USER="$(MOND_USER)" \
1860
	    -DMOND_GROUP="$(MOND_GROUP)" \
1861
	    -DDISK_SEPARATOR="$(DISK_SEPARATOR)" \
1862
	    -DQEMUIMG_PATH="$(QEMUIMG_PATH)" \
1863
	    -DHTOOLS="True" \
1864
	    -DENABLE_CONFD="$(ENABLE_CONFD)" \
1865
	    -DXEN_CMD="$(XEN_CMD)" \
1866
	    -DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
1867
	    -DENABLE_MOND="$(ENABLE_MOND)" \
1868
	    -DHAS_GNU_LN="$(HAS_GNU_LN)" \
1869
	    -DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \
1870
	                    echo -n "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/("\1",\2):/g'; \
1871
	                    done)" \
1872
	    -DAF_INET4="$$(PYTHONPATH=. python $(PRINT_PY_CONSTANTS) AF_INET4)" \
1873
	    -DAF_INET6="$$(PYTHONPATH=. python $(PRINT_PY_CONSTANTS) AF_INET6)" \
1874
	$(abs_top_srcdir)/src/AutoConf.hs.in > $@
1875

    
1876
lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1877
	set -e; \
1878
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1879
	{ echo '# This file is automatically generated, do not edit!'; \
1880
	  echo '#'; \
1881
	  echo ''; \
1882
	  echo '"""Build-time VCS version number for Ganeti.'; \
1883
	  echo '';\
1884
	  echo 'This file is autogenerated by the build process.'; \
1885
	  echo 'For any changes you need to re-run ./configure (and'; \
1886
	  echo 'not edit by hand).'; \
1887
	  echo ''; \
1888
	  echo '"""'; \
1889
	  echo ''; \
1890
	  echo '# pylint: disable=C0301,C0324'; \
1891
	  echo '# because this is autogenerated, we do not want'; \
1892
	  echo '# style warnings' ; \
1893
	  echo ''; \
1894
	  echo "VCS_VERSION = '$$VCSVER'"; \
1895
	} > $@
1896

    
1897
lib/opcodes.py: Makefile src/hs2py lib/opcodes.py.in_before \
1898
		lib/opcodes.py.in_after | stamp-directories
1899
	cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
1900
	src/hs2py --opcodes >> $@
1901
	cat $(abs_top_srcdir)/lib/opcodes.py.in_after >> $@
1902

    
1903
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1904
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1905

    
1906
$(SHELL_ENV_INIT): Makefile stamp-directories
1907
	set -e; \
1908
	{ echo '# Allow overriding for tests'; \
1909
	  echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1910
	  echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1911
	  echo; \
1912
	  echo 'readonly PKGLIBDIR=$(libdir)/ganeti'; \
1913
	  echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1914
	  echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1915
	  echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1916
	  echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1917
	} > $@
1918

    
1919
## Writes sed script to replace placeholders with build-time values. The
1920
## additional quotes after the first @ sign are necessary to stop configure
1921
## from replacing those values as well.
1922
$(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1923
	set -e; \
1924
	{ echo 's#@''PREFIX@#$(prefix)#g'; \
1925
	  echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1926
	  echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1927
	  echo 's#@''BINDIR@#$(execprefix)/bin#g'; \
1928
	  echo 's#@''SBINDIR@#$(execprefix)/sbin#g'; \
1929
	  echo 's#@''LIBDIR@#$(libdir)#g'; \
1930
	  echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1931
	  echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1932
	  echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1933
	  echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1934
	  echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1935
	  echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1936
	  echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1937
	  echo 's#@''PKGLIBDIR@#$(libdir)/ganeti#g'; \
1938
	  echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1939
	  echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1940
	  echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1941
	  echo 's#@''GNTLUXIDUSER@#$(LUXID_USER)#g'; \
1942
	  echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1943
	  echo 's#@''GNTMONDUSER@#$(MOND_USER)#g'; \
1944
	  echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1945
	  echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1946
	  echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1947
	  echo 's#@''GNTLUXIDGROUP@#$(LUXID_GROUP)#g'; \
1948
	  echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1949
	  echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
1950
	  echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1951
	  echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1952
	  echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
1953
	  echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1954
	  echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1955
	  echo; \
1956
	  echo '/^@SHELL_ENV_INIT@$$/ {'; \
1957
	  echo '  r $(SHELL_ENV_INIT)'; \
1958
	  echo '  d'; \
1959
	  echo '}'; \
1960
	} > $@
1961

    
1962
# Using deferred evaluation
1963
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1964
daemons/ganeti-watcher: MODULE = ganeti.watcher
1965
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1966
tools/burnin: MODULE = ganeti.tools.burnin
1967
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1968
tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1969
tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1970
tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1971
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1972

    
1973
$(PYTHON_BOOTSTRAP) $(gnt_scripts) $(gnt_python_sbin_SCRIPTS): Makefile | stamp-directories
1974
	test -n "$(MODULE)" || { echo Missing module; exit 1; }
1975
	set -e; \
1976
	{ echo '#!/usr/bin/python'; \
1977
	  echo '# This file is automatically generated, do not edit!'; \
1978
	  echo "# Edit $(MODULE) instead."; \
1979
	  echo; \
1980
	  echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1981
	  echo; \
1982
	  echo '# pylint: disable=C0103'; \
1983
	  echo '# C0103: Invalid name'; \
1984
	  echo; \
1985
	  echo 'import sys'; \
1986
	  echo 'import $(MODULE) as main'; \
1987
	  echo; \
1988
	  echo '# Temporarily alias commands until bash completion'; \
1989
	  echo '# generator is changed'; \
1990
	  echo 'if hasattr(main, "commands"):'; \
1991
	  echo '  commands = main.commands # pylint: disable=E1101'; \
1992
	  echo 'if hasattr(main, "aliases"):'; \
1993
	  echo '  aliases = main.aliases # pylint: disable=E1101'; \
1994
	  echo; \
1995
	  echo 'if __name__ == "__main__":'; \
1996
	  echo '  sys.exit(main.Main())'; \
1997
	} > $@
1998
	chmod u+x $@
1999

    
2000
$(HS_BUILT_TEST_HELPERS): Makefile
2001
	@test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
2002
	set -e; \
2003
	{ echo '#!/bin/sh'; \
2004
	  echo '# This file is automatically generated, do not edit!'; \
2005
	  echo "# Edit Makefile.am instead."; \
2006
	  echo; \
2007
	  echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
2008
	} > $@
2009
	chmod u+x $@
2010

    
2011
stamp-directories: Makefile
2012
	$(MAKE) $(AM_MAKEFLAGS) ganeti
2013
	@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
2014
	touch $@
2015

    
2016
# We need to create symlinks because "make distcheck" will not install Python
2017
# files when building.
2018
stamp-srclinks: Makefile | stamp-directories
2019
	set -e; \
2020
	for i in $(srclink_files); do \
2021
	  if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
2022
	    $(LN_S) $(abs_top_srcdir)/$$i $$i; \
2023
	  fi; \
2024
	done
2025
	touch $@
2026

    
2027
.PHONY: ganeti
2028
ganeti:
2029
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
2030

    
2031
.PHONY: check-dirs
2032
check-dirs: $(GENERATED_FILES)
2033
	@set -e; \
2034
	find . -type d \( -name . -o -name .git -prune -o -print \) | { \
2035
	  error=; \
2036
	  while read dir; do \
2037
	    case "$$dir" in \
2038
	      $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
2039
	      *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
2040
	    esac; \
2041
	  done; \
2042
	  for dir in $(DIRS); do \
2043
	    if ! test -d "$$dir"; then \
2044
	      echo "Directory $$dir listed in DIRS does not exist" >&2; \
2045
	      error=1; \
2046
	    fi \
2047
	  done; \
2048
	  test -z "$$error"; \
2049
	}
2050

    
2051
.PHONY: check-news
2052
check-news:
2053
	RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
2054

    
2055
.PHONY: check-local
2056
check-local: check-dirs check-news $(GENERATED_FILES)
2057
	$(CHECK_PYTHON_CODE) $(check_python_code)
2058
	PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
2059
	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
2060
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
2061
	error= ; \
2062
	if [ "x`echo $(VERSION_SUFFIX)|grep 'alpha'`" == "x" ]; then \
2063
	  expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
2064
	  if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
2065
	    echo "Incorrect version in README, expected $$expver" >&2; \
2066
	    error=1; \
2067
	  fi; \
2068
	  for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
2069
	      doc/security.rst; do \
2070
	    if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
2071
	      "Documents Ganeti version $$expver"; then \
2072
	      echo "Incorrect version in $$file, expected $$expver" >&2; \
2073
	      error=1; \
2074
	    fi; \
2075
	  done; \
2076
	  if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
2077
	    echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
2078
	    error=1; \
2079
	  fi; \
2080
	  if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
2081
	    ".. Last updated for Ganeti $$expver"; then \
2082
	    echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
2083
	    error=1; \
2084
	  fi; \
2085
	fi; \
2086
	for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
2087
	  if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
2088
	    echo "Longest line in $$file is longer than 80 characters" >&2; \
2089
	    error=1; \
2090
	  fi; \
2091
	done; \
2092
	test -z "$$error"
2093

    
2094
.PHONY: hs-test-%
2095
hs-test-%: test/hs/htest
2096
	@rm -f htest.tix
2097
	test/hs/htest -t $*
2098

    
2099
.PHONY: hs-tests
2100
hs-tests: test/hs/htest
2101
	@rm -f htest.tix
2102
	./test/hs/htest
2103

    
2104
.PHONY: hs-shell-%
2105
hs-shell-%: test/hs/hpc-htools test/hs/hpc-mon-collector \
2106
            $(HS_BUILT_TEST_HELPERS)
2107
	@rm -f hpc-htools.tix hpc-mon-collector.tix
2108
	HBINARY="./test/hs/hpc-htools" \
2109
	SHELLTESTARGS=$(SHELLTESTARGS) \
2110
	./test/hs/offline-test.sh $*
2111

    
2112
.PHONY: hs-shell
2113
hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
2114
	@rm -f hpc-htools.tix hpc-mon-collector.tix
2115
	HBINARY="./test/hs/hpc-htools" \
2116
	SHELLTESTARGS=$(SHELLTESTARGS) \
2117
	./test/hs/offline-test.sh
2118

    
2119
.PHONY: hs-check
2120
hs-check: hs-tests hs-shell
2121

    
2122
# E111: indentation is not a multiple of four
2123
# E121: continuation line indentation is not a multiple of four
2124
#       (since our indent level is not 4)
2125
# E125: continuation line does not distinguish itself from next logical line
2126
#       (since our indent level is not 4)
2127
# E123: closing bracket does not match indentation of opening bracket's line
2128
# E127: continuation line over-indented for visual indent
2129
#       (since our indent level is not 4)
2130
# note: do NOT add E128 here; it's a valid style error in most cases!
2131
# I've seen real errors, but also some cases were we indent wrongly
2132
# due to line length; try to rework the cases where it is triggered,
2133
# instead of silencing it
2134
# E261: at least two spaces before inline comment
2135
# E501: line too long (80 characters)
2136
PEP8_IGNORE = E111,E121,E123,E125,E127,E261,E501
2137

    
2138
# For excluding pep8 expects filenames only, not whole paths
2139
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
2140

    
2141
LINT_TARGETS = pylint pylint-qa pylint-test
2142
if HAS_PEP8
2143
LINT_TARGETS += pep8
2144
endif
2145
if HAS_HLINT
2146
LINT_TARGETS += hlint
2147
endif
2148

    
2149
.PHONY: lint
2150
lint: $(LINT_TARGETS)
2151

    
2152
.PHONY: pylint
2153
pylint: $(GENERATED_FILES)
2154
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2155
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
2156

    
2157
.PHONY: pylint-qa
2158
pylint-qa: $(GENERATED_FILES)
2159
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2160
	cd $(top_srcdir)/qa && \
2161
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
2162
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
2163
# FIXME: lint all test code, not just the newly added test support
2164
pylint-test: $(GENERATED_FILES)
2165
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
2166
	cd $(top_srcdir) && \
2167
		PYTHONPATH=.:./test/py $(PYLINT) $(LINT_OPTS) \
2168
		--rcfile=pylintrc-test  $(python_test_support)
2169

    
2170
.PHONY: pep8
2171
pep8: $(GENERATED_FILES)
2172
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
2173
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
2174
	  --repeat $(pep8_python_code)
2175

    
2176
# FIXME: remove ignore "Use void" when GHC 6.x is deprecated
2177
HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
2178
.PHONY: hlint
2179
hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
2180
	@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
2181
	@rm -f doc/hs-lint.html
2182
	if tty -s; then C="-c"; else C=""; fi; \
2183
	$(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
2184
	  --ignore "Use first" \
2185
	  --ignore "Use &&&" \
2186
	  --ignore "Use void" \
2187
	  --ignore "Reduce duplication" \
2188
	  --hint src/lint-hints \
2189
	  $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
2190
	@if [ ! -f doc/hs-lint.html ]; then \
2191
	  echo "All good" > doc/hs-lint.html; \
2192
	fi
2193

    
2194
# a dist hook rule for updating the vcs-version file; this is
2195
# hardcoded due to where it needs to build the file...
2196
dist-hook:
2197
	$(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
2198
	rm -f $(top_distdir)/vcs-version
2199
	cp -p $(srcdir)/vcs-version $(top_distdir)
2200

    
2201
# a distcheck hook rule for catching revision control directories
2202
distcheck-hook:
2203
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
2204
	  echo "Found revision control files in final archive." 1>&2; \
2205
	  exit 1; \
2206
	fi
2207
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
2208
	  echo "Found Python byte code in final archive." 1>&2; \
2209
	  exit 1; \
2210
	fi
2211
	if find $(top_distdir) -name '*~' | grep .; then \
2212
	  echo "Found backup files in final archive." 1>&2; \
2213
	  exit 1; \
2214
	fi
2215
# Empty files or directories should not be distributed. They can cause
2216
# unnecessary warnings for packagers. Directories used by automake during
2217
# distcheck must be excluded.
2218
	if find $(top_distdir) -empty -and -not \( \
2219
	    -path $(top_distdir)/_build -or \
2220
	    -path $(top_distdir)/_inst \) | grep .; then \
2221
	  echo "Found empty files or directories in final archive." 1>&2; \
2222
	  exit 1; \
2223
	fi
2224
	if test -e $(top_distdir)/doc/man-html; then \
2225
	  echo "Found documentation including man pages in final archive" >&2; \
2226
	  exit 1; \
2227
	fi
2228

    
2229
# Backwards compatible distcheck-release target
2230
distcheck-release: distcheck
2231

    
2232
distrebuildcheck: dist
2233
	set -e; \
2234
	builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
2235
	trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
2236
	cd $$builddir; \
2237
	tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
2238
	cd $(distdir); \
2239
	./configure; \
2240
	$(MAKE) maintainer-clean; \
2241
	cp $(abs_srcdir)/vcs-version .; \
2242
	./configure; \
2243
	$(MAKE) $(AM_MAKEFLAGS)
2244

    
2245
dist-release: dist
2246
	set -e; \
2247
	for i in $(DIST_ARCHIVES); do \
2248
	  echo -n "Checking $$i ... "; \
2249
	  autotools/check-tar < $$i; \
2250
	  echo OK; \
2251
	done
2252

    
2253
install-exec-local:
2254
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
2255
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
2256
	  "$(DESTDIR)${localstatedir}/run/ganeti"
2257
	for dir in $(SYMLINK_TARGET_DIRS); do \
2258
	  @mkdir_p@  $(DESTDIR)$$dir; \
2259
	done
2260
	$(LN_S) -f $(sysconfdir)/ganeti/lib $(DESTDIR)$(defaultversiondir)
2261
	$(LN_S) -f $(sysconfdir)/ganeti/share $(DESTDIR)$(defaultversionedsharedir)
2262
	for prog in $(HS_BIN_ROLES); do \
2263
	  $(LN_S) -f $(defaultversiondir)$(exec_prefix)/bin/$$prog $(DESTDIR)$(exec_prefix)/bin/$$prog; \
2264
	done
2265
	$(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
2266
	for prog in $(all_sbin_scripts); do \
2267
	  $(LN_S) -f $(defaultversiondir)$(exec_prefix)/sbin/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
2268
	done
2269
	for prog in $(gnt_scripts_basenames); do \
2270
	  $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
2271
	done
2272
	for prog in $(pkglib_python_basenames); do \
2273
	  $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2274
	done
2275
	for prog in $(tools_python_basenames); do \
2276
	  $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2277
	done
2278
	for prog in $(tools_basenames); do \
2279
	  $(LN_S) -f $(defaultversiondir)/$(libdir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
2280
	done
2281
	if ! test -n '$(ENABLE_MANPAGES)'; then \
2282
	  for man in $(manfullpath); do \
2283
	    $(LN_S) -f $(defaultversionedsharedir)$(datarootdir)/man/$$man $(DESTDIR)$(datarootdir)/man/$$man; \
2284
	  done; \
2285
	fi
2286
	for prog in $(myexeclib_scripts_basenames); do \
2287
	  $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
2288
	done
2289
if INSTALL_SYMLINKS
2290
	$(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share
2291
	$(LN_S) -f $(versiondir) $(DESTDIR)$(sysconfdir)/ganeti/lib
2292
endif
2293

    
2294
.PHONY: apidoc
2295
if WANT_HSAPIDOC
2296
apidoc: py-apidoc hs-apidoc
2297
else
2298
apidoc: py-apidoc
2299
endif
2300

    
2301
.PHONY: py-apidoc
2302
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
2303
	env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
2304
	$(RUN_IN_TEMPDIR) epydoc -v \
2305
	  --conf $(CURDIR)/epydoc.conf \
2306
	  --output $(CURDIR)/$(APIDOC_PY_DIR)
2307

    
2308
.PHONY: hs-apidoc
2309
hs-apidoc: $(APIDOC_HS_DIR)/index.html
2310

    
2311
$(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
2312
	@test -n "$(HSCOLOUR)" || \
2313
	    { echo 'HsColour' not found during configure; exit 1; }
2314
	@test -n "$(HADDOCK)" || \
2315
	    { echo 'haddock' not found during configure; exit 1; }
2316
	rm -rf $(APIDOC_HS_DIR)/*
2317
	for i in $(ALL_APIDOC_HS_DIRS); do \
2318
	  @mkdir_p@ $$i; \
2319
	  $(HSCOLOUR) -print-css > $$i/hscolour.css; \
2320
	done
2321
	set -e ; \
2322
	export LC_ALL=en_US.UTF-8; \
2323
	OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
2324
	if [ "$(HS_PARALLEL3)" ]; \
2325
	then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
2326
	fi; \
2327
	if [ "$(HS_REGEX_PCRE)" ]; \
2328
	then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
2329
	fi; \
2330
	for file in $(HS_LIBTESTBUILT_SRCS); do \
2331
	  f_nosrc=$${file##src/}; \
2332
	  f_notst=$${f_nosrc##test/hs/}; \
2333
	  f_html=$${f_notst%%.hs}.html; \
2334
	  $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
2335
	done ; \
2336
	$(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
2337
	  -t ganeti -p src/haddock-prologue \
2338
	  --source-module="%{MODULE/.//}.html" \
2339
	  --source-entity="%{MODULE/.//}.html#%{NAME}" \
2340
	  $$OPTGHC \
2341
	  $(HS_LIBTESTBUILT_SRCS)
2342

    
2343
.PHONY: TAGS
2344
TAGS: $(GENERATED_FILES)
2345
	rm -f TAGS
2346
	$(GHC) -e ":etags TAGS_hs" -v0 \
2347
	  $(filter-out -O -Werror,$(HFLAGS)) \
2348
		-osuf tags.o \
2349
		-hisuf tags.hi \
2350
    -lcurl \
2351
	  $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
2352
	  $(HS_LIBTEST_SRCS)
2353
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
2354
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
2355
	  -path './qa/*.py' | \
2356
	  etags --etags-include=TAGS_hs -L -
2357

    
2358
.PHONY: coverage
2359

    
2360
COVERAGE_TESTS=
2361
if WANT_HTOOLS
2362
COVERAGE_TESTS += hs-coverage
2363
endif
2364
if PY_UNIT
2365
COVERAGE_TESTS += py-coverage
2366
endif
2367

    
2368
coverage: $(COVERAGE_TESTS)
2369

    
2370
test/py/docs_unittest.py: $(gnt_scripts)
2371

    
2372
.PHONY: py-coverage
2373
py-coverage: $(GENERATED_FILES) $(python_tests)
2374
	@test -n "$(PYCOVERAGE)" || \
2375
	    { echo 'python-coverage' not found during configure; exit 1; }
2376
	set -e; \
2377
	COVERAGE=$(PYCOVERAGE) \
2378
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
2379
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
2380
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
2381
	$(PLAIN_TESTS_ENVIRONMENT) \
2382
	$(abs_top_srcdir)/autotools/gen-py-coverage \
2383
	$(python_tests)
2384

    
2385
.PHONY: hs-coverage
2386
hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
2387
	rm -f *.tix
2388
	$(MAKE) $(AM_MAKEFLAGS) hs-check
2389
	@mkdir_p@ $(COVERAGE_HS_DIR)
2390
	hpc sum --union $(HPCEXCL) \
2391
	  htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
2392
	hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
2393
	hpc report coverage-hs.tix | tee $(COVERAGE_HS_DIR)/report.txt
2394
	$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
2395

    
2396
# Special "kind-of-QA" target for htools, needs special setup (all
2397
# tools compiled with -fhpc)
2398
.PHONY: live-test
2399
live-test: all
2400
	set -e ; \
2401
	cd src; \
2402
	rm -f .hpc; $(LN_S) ../.hpc .hpc; \
2403
	rm -f *.tix *.mix; \
2404
	./live-test.sh; \
2405
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
2406
	  --output=live-test.tix ; \
2407
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
2408
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
2409
	  --srcdir=.. $(HPCEXCL) ; \
2410
	hpc report --srcdir=.. live-test $(HPCEXCL)
2411

    
2412
commit-check: autotools-check distcheck lint apidoc
2413

    
2414
autotools-check:
2415
	TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
2416
  $(abs_top_srcdir)/test/autotools/*-*.test \
2417
  -- --hide-successes
2418

    
2419
.PHONY: gitignore-check
2420
gitignore-check:
2421
	@if [ -n "`git status --short`" ]; then \
2422
	  echo "Git status is not clean!" 1>&2 ; \
2423
	  git status --short; \
2424
	  exit 1; \
2425
	fi
2426

    
2427
# target to rebuild all man pages (both groff and html output)
2428
.PHONY: man
2429
man: $(man_MANS) $(manhtml)
2430

    
2431
# Target that builds all binaries (including those that are not
2432
# rebuilt except when running the tests)
2433
.PHONY: really-all
2434
really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
2435

    
2436
# we don't need the ancient implicit rules:
2437
%: %,v
2438
%: RCS/%,v
2439
%: RCS/%
2440
%: s.%
2441
%: SCCS/s.%
2442

    
2443
-include ./Makefile.local
2444

    
2445
# vim: set noet :