Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 46a8da3b

History | View | Annotate | Download (16 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
ACLOCAL_AMFLAGS = -I autotools
13
DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
14
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
15
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
16
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
17
CHECK_MAN = $(top_srcdir)/autotools/check-man
18
REPLACE_VARS_SED = autotools/replace_vars.sed
19

    
20
hypervisordir = $(pkgpythondir)/hypervisor
21
httpdir = $(pkgpythondir)/http
22
masterddir = $(pkgpythondir)/masterd
23
confddir = $(pkgpythondir)/confd
24
rapidir = $(pkgpythondir)/rapi
25
impexpddir = $(pkgpythondir)/impexpd
26
toolsdir = $(pkglibdir)/tools
27
docdir = $(datadir)/doc/$(PACKAGE)
28

    
29
# Delete output file if an error occurred while building it
30
.DELETE_ON_ERROR:
31

    
32
DIRS = \
33
	autotools \
34
	daemons \
35
	devel \
36
	doc \
37
	doc/examples \
38
	doc/examples/hooks \
39
	lib \
40
	lib/build \
41
	lib/confd \
42
	lib/http \
43
	lib/hypervisor \
44
	lib/impexpd \
45
	lib/masterd \
46
	lib/rapi \
47
	man \
48
	qa \
49
	scripts \
50
	test \
51
	test/data \
52
	tools
53

    
54
MAINTAINERCLEANFILES = \
55
	$(docpng) \
56
	$(maninput) \
57
	doc/install-quick.rst \
58
	doc/news.rst
59

    
60
maintainer-clean-local:
61
	rm -rf doc/api doc/html doc/coverage
62

    
63
CLEANFILES = \
64
	$(addsuffix /*.py[co],$(DIRS)) \
65
	autotools/replace_vars.sed \
66
	daemons/daemon-util \
67
	daemons/ensure-dirs \
68
	daemons/ganeti-cleaner \
69
	devel/upload \
70
	doc/examples/bash_completion \
71
	doc/examples/ganeti.initd \
72
	doc/examples/ganeti.cron \
73
	doc/examples/gnt-config-backup \
74
	doc/examples/hooks/ipsec \
75
	$(man_MANS) \
76
	$(manhtml) \
77
	stamp-directories \
78
	stamp-srclinks \
79
	$(nodist_pkgpython_PYTHON)
80

    
81
BUILT_SOURCES = \
82
	ganeti \
83
	stamp-srclinks \
84
	stamp-directories \
85
	lib/_autoconf.py
86

    
87
nodist_pkgpython_PYTHON = \
88
	lib/_autoconf.py
89

    
90
noinst_PYTHON = \
91
	lib/build/__init__.py
92

    
93
pkgpython_PYTHON = \
94
	lib/__init__.py \
95
	lib/asyncnotifier.py \
96
	lib/backend.py \
97
	lib/bdev.py \
98
	lib/bootstrap.py \
99
	lib/cli.py \
100
	lib/cmdlib.py \
101
	lib/compat.py \
102
	lib/config.py \
103
	lib/constants.py \
104
	lib/daemon.py \
105
	lib/errors.py \
106
	lib/jqueue.py \
107
	lib/jstore.py \
108
	lib/locking.py \
109
	lib/luxi.py \
110
	lib/mcpu.py \
111
	lib/objects.py \
112
	lib/opcodes.py \
113
	lib/rpc.py \
114
	lib/serializer.py \
115
	lib/ssconf.py \
116
	lib/ssh.py \
117
	lib/storage.py \
118
	lib/utils.py \
119
	lib/uidpool.py \
120
	lib/workerpool.py
121

    
122
hypervisor_PYTHON = \
123
	lib/hypervisor/__init__.py \
124
	lib/hypervisor/hv_base.py \
125
	lib/hypervisor/hv_chroot.py \
126
	lib/hypervisor/hv_fake.py \
127
	lib/hypervisor/hv_kvm.py \
128
	lib/hypervisor/hv_xen.py
129

    
130
rapi_PYTHON = \
131
	lib/rapi/__init__.py \
132
	lib/rapi/baserlib.py \
133
	lib/rapi/client.py \
134
	lib/rapi/client_utils.py \
135
	lib/rapi/connector.py \
136
	lib/rapi/rlib2.py
137

    
138
http_PYTHON = \
139
	lib/http/__init__.py \
140
	lib/http/auth.py \
141
	lib/http/client.py \
142
	lib/http/server.py
143

    
144
confd_PYTHON = \
145
	lib/confd/__init__.py \
146
	lib/confd/client.py \
147
	lib/confd/querylib.py \
148
	lib/confd/server.py
149

    
150
masterd_PYTHON = \
151
	lib/masterd/__init__.py \
152
	lib/masterd/instance.py
153

    
154
impexpd_PYTHON = \
155
	lib/impexpd/__init__.py
156

    
157
docrst = \
158
	doc/admin.rst \
159
	doc/design-2.0.rst \
160
	doc/design-2.1.rst \
161
	doc/design-2.2.rst \
162
	doc/design-cluster-merger.rst \
163
	doc/devnotes.rst \
164
	doc/glossary.rst \
165
	doc/hooks.rst \
166
	doc/iallocator.rst \
167
	doc/index.rst \
168
	doc/install-quick.rst \
169
	doc/install.rst \
170
	doc/locking.rst \
171
	doc/move-instance.rst \
172
	doc/news.rst \
173
	doc/rapi.rst \
174
	doc/security.rst \
175
	doc/walkthrough.rst
176

    
177
doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
178
	@test -n "$(SPHINX)" || \
179
	    { echo 'sphinx-build' not found during configure; exit 1; }
180
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
181
	    -d . \
182
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
183
	    -D release="$(PACKAGE_VERSION)" \
184
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
185
	rm -f doc/html/.buildinfo doc/html/objects.inv
186
	touch $@
187

    
188
doc/html: doc/html/.stamp
189

    
190
doc/news.rst: NEWS
191
	set -e; \
192
	{ echo '.. This file is automatically updated at build time from $<.'; \
193
	  echo '.. Do not edit.'; \
194
	  echo; \
195
	  cat $<; \
196
	} > $@
197

    
198
doc/install-quick.rst: INSTALL
199
	set -e; \
200
	{ echo '.. This file is automatically updated at build time from $<.'; \
201
	  echo '.. Do not edit.'; \
202
	  echo; \
203
	  cat $<; \
204
	} > $@
205

    
206
docdot = \
207
	doc/arch-2.0.dot \
208
	doc/design-2.1-lock-acquire.dot \
209
	doc/design-2.1-lock-release.dot
210

    
211
docpng = $(patsubst %.dot,%.png,$(docdot))
212

    
213
# Things to build but not to install (add it to EXTRA_DIST if it should be
214
# distributed)
215
noinst_DATA = \
216
	devel/upload \
217
	doc/html \
218
	doc/examples/bash_completion \
219
	doc/examples/ganeti.cron \
220
	doc/examples/ganeti.initd \
221
	doc/examples/gnt-config-backup \
222
	doc/examples/hooks/ipsec \
223
	$(manhtml)
224

    
225
gnt_scripts = \
226
	scripts/gnt-backup \
227
	scripts/gnt-cluster \
228
	scripts/gnt-debug \
229
	scripts/gnt-instance \
230
	scripts/gnt-job \
231
	scripts/gnt-node \
232
	scripts/gnt-os
233

    
234
dist_sbin_SCRIPTS = \
235
	daemons/ganeti-noded \
236
	daemons/ganeti-watcher \
237
	daemons/ganeti-masterd \
238
	daemons/ganeti-confd \
239
	daemons/ganeti-rapi \
240
	$(gnt_scripts)
241

    
242
nodist_sbin_SCRIPTS = \
243
	daemons/ganeti-cleaner
244

    
245
dist_tools_SCRIPTS = \
246
	tools/burnin \
247
	tools/cfgshell \
248
	tools/cfgupgrade \
249
	tools/cfgupgrade12 \
250
	tools/cluster-merge \
251
	tools/lvmstrap \
252
	tools/move-instance \
253
	tools/sanitize-config
254

    
255
pkglib_python_scripts = \
256
	daemons/import-export \
257
	tools/check-cert-expired
258

    
259
pkglib_SCRIPTS = \
260
	daemons/daemon-util \
261
	daemons/ensure-dirs \
262
	$(pkglib_python_scripts)
263

    
264
EXTRA_DIST = \
265
	NEWS \
266
	pylintrc \
267
	autotools/build-bash-completion \
268
	autotools/check-python-code \
269
	autotools/check-man \
270
	autotools/docbook-wrapper \
271
	autotools/gen-coverage \
272
	autotools/testrunner \
273
	$(RUN_IN_TEMPDIR) \
274
	daemons/daemon-util.in \
275
	daemons/ensure-dirs.in \
276
	daemons/ganeti-cleaner.in \
277
	$(pkglib_python_scripts) \
278
	devel/upload.in \
279
	$(docdot) \
280
	$(docpng) \
281
	$(docrst) \
282
	doc/conf.py \
283
	doc/html \
284
	doc/examples/ganeti.initd.in \
285
	doc/examples/ganeti.cron.in \
286
	doc/examples/gnt-config-backup.in \
287
	doc/examples/dumb-allocator \
288
	doc/examples/ganeti.default \
289
	doc/examples/ganeti.default-debug \
290
	doc/examples/hooks/ethers \
291
	doc/examples/hooks/ipsec.in \
292
	test/testutils.py \
293
	test/mocks.py \
294
	$(dist_TESTS) \
295
	$(TEST_FILES) \
296
	man/footer.sgml \
297
	$(mansgml) \
298
	$(maninput) \
299
	qa/ganeti-qa.py \
300
	qa/qa-sample.json \
301
	qa/qa_cluster.py \
302
	qa/qa_config.py \
303
	qa/qa_daemon.py \
304
	qa/qa_env.py \
305
	qa/qa_error.py \
306
	qa/qa_instance.py \
307
	qa/qa_node.py \
308
	qa/qa_os.py \
309
	qa/qa_rapi.py \
310
	qa/qa_tags.py \
311
	qa/qa_utils.py
312

    
313
man_MANS = \
314
	man/ganeti.7 \
315
	man/ganeti-cleaner.8 \
316
	man/ganeti-confd.8 \
317
	man/ganeti-masterd.8 \
318
	man/ganeti-noded.8 \
319
	man/ganeti-os-interface.7 \
320
	man/ganeti-rapi.8 \
321
	man/ganeti-watcher.8 \
322
	man/gnt-backup.8 \
323
	man/gnt-cluster.8 \
324
	man/gnt-debug.8 \
325
	man/gnt-instance.8 \
326
	man/gnt-job.8 \
327
	man/gnt-node.8 \
328
	man/gnt-os.8
329

    
330
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
331
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
332
maninput = \
333
	$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
334
	$(patsubst %.html,%.html.in,$(manhtml))
335

    
336
TEST_FILES = \
337
	test/data/bdev-both.txt \
338
	test/data/bdev-8.3-both.txt \
339
	test/data/bdev-disk.txt \
340
	test/data/bdev-net.txt \
341
	test/data/cert1.pem \
342
	test/data/proc_drbd8.txt \
343
	test/data/proc_drbd80-emptyline.txt \
344
	test/data/proc_drbd83.txt \
345
	test/import-export_unittest-helper
346

    
347
python_tests = \
348
	test/ganeti.asyncnotifier_unittest.py \
349
	test/ganeti.backend_unittest.py \
350
	test/ganeti.bdev_unittest.py \
351
	test/ganeti.cli_unittest.py \
352
	test/ganeti.daemon_unittest.py \
353
	test/ganeti.cmdlib_unittest.py \
354
	test/ganeti.compat_unittest.py \
355
	test/ganeti.confd.client_unittest.py \
356
	test/ganeti.config_unittest.py \
357
	test/ganeti.constants_unittest.py \
358
	test/ganeti.errors_unittest.py \
359
	test/ganeti.hooks_unittest.py \
360
	test/ganeti.http_unittest.py \
361
	test/ganeti.impexpd_unittest.py \
362
	test/ganeti.locking_unittest.py \
363
	test/ganeti.luxi_unittest.py \
364
	test/ganeti.masterd.instance_unittest.py \
365
	test/ganeti.mcpu_unittest.py \
366
	test/ganeti.objects_unittest.py \
367
	test/ganeti.opcodes_unittest.py \
368
	test/ganeti.rapi.client_unittest.py \
369
	test/ganeti.rapi.resources_unittest.py \
370
	test/ganeti.rapi.rlib2_unittest.py \
371
	test/ganeti.serializer_unittest.py \
372
	test/ganeti.ssh_unittest.py \
373
	test/ganeti.uidpool_unittest.py \
374
	test/ganeti.utils_unittest.py \
375
	test/ganeti.utils_mlockall_unittest.py \
376
	test/ganeti.workerpool_unittest.py \
377
	test/docs_unittest.py \
378
	test/tempfile_fork_unittest.py
379

    
380
dist_TESTS = \
381
	test/daemon-util_unittest.bash \
382
	test/import-export_unittest.bash \
383
	test/check-cert-expired_unittest.bash \
384
	$(python_tests)
385

    
386
nodist_TESTS =
387

    
388
TESTS = $(dist_TESTS) $(nodist_TESTS)
389

    
390
# Environment for all tests
391
PLAIN_TESTS_ENVIRONMENT = \
392
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
393

    
394
# Environment for tests run by automake
395
TESTS_ENVIRONMENT = \
396
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
397

    
398
all_python_code = \
399
	$(dist_sbin_SCRIPTS) \
400
	$(dist_tools_SCRIPTS) \
401
	$(pkglib_python_scripts) \
402
	$(python_tests) \
403
	$(pkgpython_PYTHON) \
404
	$(hypervisor_PYTHON) \
405
	$(rapi_PYTHON) \
406
	$(http_PYTHON) \
407
	$(confd_PYTHON) \
408
	$(masterd_PYTHON) \
409
	$(impexpd_PYTHON) \
410
	$(noinst_PYTHON)
411

    
412
srclink_files = \
413
	man/footer.sgml \
414
	test/daemon-util_unittest.bash \
415
	test/import-export_unittest.bash \
416
	test/check-cert-expired_unittest.bash \
417
	$(all_python_code)
418

    
419
check_python_code = \
420
	$(BUILD_BASH_COMPLETION) \
421
	$(all_python_code)
422

    
423
lint_python_code = \
424
	ganeti \
425
	$(dist_sbin_SCRIPTS) \
426
	$(dist_tools_SCRIPTS) \
427
	$(pkglib_python_scripts) \
428
	$(BUILD_BASH_COMPLETION)
429

    
430
test/daemon-util_unittest.bash: daemons/daemon-util
431

    
432
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
433
	sed -f $(REPLACE_VARS_SED) < $< > $@
434
	chmod u+x $@
435

    
436
daemons/%: daemons/%.in \
437
		$(REPLACE_VARS_SED)
438
	sed -f $(REPLACE_VARS_SED) < $< > $@
439
	chmod +x $@
440

    
441
doc/examples/%: doc/examples/%.in \
442
		$(REPLACE_VARS_SED)
443
	sed -f $(REPLACE_VARS_SED) < $< > $@
444

    
445
doc/examples/hooks/%: doc/examples/hooks/%.in \
446
		$(REPLACE_VARS_SED)
447
	sed -f $(REPLACE_VARS_SED) < $< > $@
448

    
449
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
450
	lib/cli.py $(gnt_scripts) tools/burnin
451
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
452

    
453
doc/%.png: doc/%.dot
454
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
455
	$(DOT) -Tpng -o $@ $<
456

    
457
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
458
	@test -n "$(DOCBOOK2MAN)" || \
459
	  { echo 'docbook2man' not found during configure; exit 1; }
460
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
461
	$(CHECK_MAN) $@
462

    
463
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
464
	@test -n "$(DOCBOOK2HTML)" || \
465
	  { echo 'docbook2html' not found during configure; exit 1; }
466
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
467

    
468
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
469
	sed -f $(REPLACE_VARS_SED) < $< > $@
470

    
471
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
472
	sed -f $(REPLACE_VARS_SED) < $< > $@
473

    
474
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
475
	sed -f $(REPLACE_VARS_SED) < $< > $@
476

    
477
lib/_autoconf.py: Makefile stamp-directories
478
	set -e; \
479
	{ echo '# This file is automatically generated, do not edit!'; \
480
	  echo '#'; \
481
	  echo ''; \
482
	  echo '"""Build-time configuration for Ganeti.'; \
483
	  echo '';\
484
	  echo 'This file is autogenerated by the build process.'; \
485
	  echo 'For any changes you need to re-run ./configure (and'; \
486
	  echo 'not edit by hand).'; \
487
	  echo ''; \
488
	  echo '"""'; \
489
	  echo ''; \
490
	  echo '# pylint: disable-msg=C0301,C0324'; \
491
	  echo '# because this is autogenerated, we do not want'; \
492
	  echo '# style warnings' ; \
493
	  echo ''; \
494
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
495
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
496
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
497
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
498
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
499
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
500
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
501
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
502
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
503
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
504
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
505
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
506
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
507
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
508
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
509
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
510
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
511
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
512
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
513
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
514
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
515
	  echo "TOOLSDIR = '$(toolsdir)'"; \
516
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
517
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
518
	  echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
519
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
520
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
521
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
522
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
523
	} > $@
524

    
525
$(REPLACE_VARS_SED): Makefile
526
	set -e; \
527
	{ echo 's#@PREFIX@#$(prefix)#g'; \
528
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
529
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
530
	  echo 's#@BINDIR@#$(bindir)#g'; \
531
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
532
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
533
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
534
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
535
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
536
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
537
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
538
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
539
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
540
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
541
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
542
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
543
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
544
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
545
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
546
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
547
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
548
	} > $@
549

    
550
# We need to create symlinks because "make distcheck" will not install Python
551
# files when building.
552
stamp-srclinks: Makefile stamp-directories
553
	set -e; \
554
	for i in $(srclink_files); do \
555
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
556
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
557
		fi; \
558
	done
559
	touch $@
560

    
561
.PHONY: ganeti
562
ganeti:
563
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
564

    
565
check-local:
566
	$(CHECK_PYTHON_CODE) $(check_python_code)
567

    
568
.PHONY: lint
569
lint: ganeti $(BUILT_SOURCES)
570
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
571
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
572

    
573
# a dist hook rule for catching revision control directories
574
distcheck-hook:
575
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
576
		echo "Found revision control files in final archive." 1>&2; \
577
		exit 1; \
578
	fi
579
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
580
		echo "Found Python byte code in final archive." 1>&2; \
581
		exit 1; \
582
	fi
583
	if find $(top_distdir) -name '*~' | grep .; then \
584
		echo "Found backup files in final archive." 1>&2; \
585
		exit 1; \
586
	fi
587

    
588
install-exec-local:
589
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
590
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
591
	  "$(DESTDIR)${localstatedir}/run/ganeti"
592

    
593
stamp-directories: Makefile
594
	@mkdir_p@ $(DIRS)
595
	touch $@
596

    
597
.PHONY: apidoc
598
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
599
	test -e doc/api || mkdir doc/api
600
	$(RUN_IN_TEMPDIR) epydoc -v \
601
		--conf $(CURDIR)/epydoc.conf \
602
		--output $(CURDIR)/doc/api
603

    
604
.PHONY: TAGS
605
TAGS: $(BUILT_SOURCES)
606
	rm -f TAGS
607
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
608
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
609
	  etags -
610

    
611
.PHONY: coverage
612
coverage: $(BUILT_SOURCES) $(python_tests)
613
	set -e; \
614
	mkdir -p doc/coverage; \
615
	COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
616
	TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
617
	HTML_COVERAGE=$(CURDIR)/doc/coverage \
618
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
619
	$(python_tests)
620

    
621
commit-check: distcheck lint apidoc
622

    
623
# vim: set noet :