Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 711897ae

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-ovf-support.rst \
548
	doc/design-partitioned.rst \
549
	doc/design-query2.rst \
550
	doc/design-query-splitting.rst \
551
	doc/design-reason-trail.rst \
552
	doc/design-resource-model.rst \
553
	doc/design-restricted-commands.rst \
554
	doc/design-shared-storage.rst \
555
	doc/design-ssh-ports.rst \
556
	doc/design-storagetypes.rst \
557
	doc/design-upgrade.rst \
558
	doc/design-virtual-clusters.rst \
559
	doc/design-x509-ca.rst \
560
	doc/dev-codestyle.rst \
561
	doc/devnotes.rst \
562
	doc/glossary.rst \
563
	doc/hooks.rst \
564
	doc/iallocator.rst \
565
	doc/index.rst \
566
	doc/install-quick.rst \
567
	doc/install.rst \
568
	doc/locking.rst \
569
	doc/manpages-disabled.rst \
570
	doc/monitoring-query-format.rst \
571
	doc/move-instance.rst \
572
	doc/news.rst \
573
	doc/ovfconverter.rst \
574
	doc/rapi.rst \
575
	doc/security.rst \
576
	doc/upgrade.rst \
577
	doc/virtual-cluster.rst \
578
	doc/walkthrough.rst
579

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

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

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

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

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

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

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

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

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

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

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

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

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

    
801
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
802

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

    
816
HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
817

    
818
$(RUN_IN_TEMPDIR): | stamp-directories
819

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

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

    
861
doc/html: doc/html/index.html
862

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

    
865
doc/install-quick.rst: INSTALL
866
doc/news.rst: NEWS
867
doc/upgrade.rst: UPGRADE
868

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

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

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

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

    
908
userspecs = \
909
	doc/users/users \
910
	doc/users/groups \
911
	doc/users/groupmemberships
912

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

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

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

    
942
gnt_scripts_basenames = \
943
	$(patsubst scripts/%,%,$(patsubst daemons/%,%,$(gnt_scripts) $(gnt_python_sbin_SCRIPTS)))
944

    
945
gnt_python_sbin_SCRIPTS = \
946
	$(PYTHON_BOOTSTRAP_SBIN)
947

    
948
gntpython_SCRIPTS = $(gnt_scripts)
949

    
950
PYTHON_BOOTSTRAP_SBIN = \
951
	daemons/ganeti-masterd \
952
	daemons/ganeti-noded \
953
	daemons/ganeti-rapi \
954
	daemons/ganeti-watcher
955

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

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

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

    
996
HNORMAL_SUFFIX = .o
997
HPROFILE_SUFFIX = .prof.o
998
HCOVERAGE_SUFFIX = .hpc.o
999
HTEST_SUFFIX = .test.o
1000

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

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

    
1010
HS_SRCS = $(HS_LIBTESTBUILT_SRCS)
1011

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

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

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

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

    
1038
# test dependency
1039
test/hs/offline-test.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
1040

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

    
1050
dist_sbin_SCRIPTS = \
1051
	tools/ganeti-listrunner
1052

    
1053
nodist_sbin_SCRIPTS = \
1054
	daemons/ganeti-cleaner
1055

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

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

    
1065
src/ganeti-luxid: src/hluxid
1066
	cp -f $< $@
1067

    
1068
nodist_sbin_SCRIPTS += src/ganeti-confd
1069
nodist_sbin_SCRIPTS += src/ganeti-luxid
1070
nodist_sbin_SCRIPTS += src/ganeti-kvmd
1071
endif
1072

    
1073
if ENABLE_MOND
1074
nodist_sbin_SCRIPTS += src/ganeti-mond
1075
endif
1076

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

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

    
1095
dist_tools_python_SCRIPTS = \
1096
	$(python_scripts) \
1097
	tools/burnin
1098

    
1099
nodist_tools_python_SCRIPTS = \
1100
	tools/node-cleanup
1101

    
1102
tools_python_basenames = $(patsubst tools/%,%,\
1103
	$(dist_tools_python_SCRIPTS) $(nodist_tools_python_SCRIPTS))
1104

    
1105
nodist_tools_SCRIPTS = \
1106
	tools/users-setup \
1107
	tools/vcluster-setup
1108

    
1109
tools_basenames = $(patsubst tools/%,%,$(nodist_tools_SCRIPTS) $(dist_tools_SCRIPTS))
1110

    
1111
pkglib_python_scripts = \
1112
	daemons/import-export \
1113
	tools/check-cert-expired
1114

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

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

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

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

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

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

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

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

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

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

    
1401

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

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

    
1518
haskell_tests = test/hs/htest
1519

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

    
1528
if PY_UNIT
1529
dist_TESTS += $(python_tests)
1530
endif
1531

    
1532
nodist_TESTS =
1533
check_SCRIPTS =
1534

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

    
1544
TESTS = $(dist_TESTS) $(nodist_TESTS)
1545

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

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

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

    
1581
if PY_UNIT
1582
all_python_code += $(python_tests)
1583
all_python_code += $(python_test_support)
1584
endif
1585

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

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

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

    
1620
standalone_python_modules = \
1621
	lib/rapi/client.py \
1622
	tools/ganeti-listrunner
1623

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

    
1638
test/py/daemon-util_unittest.bash: daemons/daemon-util
1639

    
1640
test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1641

    
1642
test/py/bash_completion.bash: doc/examples/bash_completion-debug
1643

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

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

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

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

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

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

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

    
1689
doc/examples/bash_completion: BC_ARGS = --compact
1690
doc/examples/bash_completion-debug: BC_ARGS =
1691

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

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

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

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

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

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

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

    
1745
.PHONY: clean-vcs-version
1746
clean-vcs-version:
1747
	rm -f vcs-version
1748

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

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

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

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

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

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

    
1801
lib/constants.py: lib/_constants.py
1802

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
2117
.PHONY: hs-check
2118
hs-check: hs-tests hs-shell
2119

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

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

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

    
2147
.PHONY: lint
2148
lint: $(LINT_TARGETS)
2149

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

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

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

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

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

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

    
2227
# Backwards compatible distcheck-release target
2228
distcheck-release: distcheck
2229

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

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

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

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

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

    
2306
.PHONY: hs-apidoc
2307
hs-apidoc: $(APIDOC_HS_DIR)/index.html
2308

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

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

    
2356
.PHONY: coverage
2357

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

    
2366
coverage: $(COVERAGE_TESTS)
2367

    
2368
test/py/docs_unittest.py: $(gnt_scripts)
2369

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

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

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

    
2410
commit-check: autotools-check distcheck lint apidoc
2411

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

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

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

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

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

    
2441
-include ./Makefile.local
2442

    
2443
# vim: set noet :