Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 549071a0

History | View | Annotate | Download (17.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
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
	doc/examples/gnt-debug \
40
	lib \
41
	lib/build \
42
	lib/confd \
43
	lib/http \
44
	lib/hypervisor \
45
	lib/impexpd \
46
	lib/masterd \
47
	lib/rapi \
48
	man \
49
	qa \
50
	scripts \
51
	test \
52
	test/data \
53
	tools
54

    
55
BUILDTIME_DIRS = \
56
	doc/api \
57
	doc/coverage \
58
	doc/html
59

    
60
DIRCHECK_EXCLUDE = \
61
	$(BUILDTIME_DIRS) \
62
	ganeti-[0-9]*.[0-9]*.[0-9]* \
63
	doc/html/_*
64

    
65
MAINTAINERCLEANFILES = \
66
	$(docpng) \
67
	$(maninput) \
68
	doc/install-quick.rst \
69
	doc/news.rst
70

    
71
maintainer-clean-local:
72
	rm -rf $(BUILDTIME_DIRS)
73

    
74
CLEANFILES = \
75
	$(addsuffix /*.py[co],$(DIRS)) \
76
	autotools/replace_vars.sed \
77
	daemons/daemon-util \
78
	daemons/ensure-dirs \
79
	daemons/ganeti-cleaner \
80
	devel/upload \
81
	doc/examples/bash_completion \
82
	doc/examples/ganeti.initd \
83
	doc/examples/ganeti.cron \
84
	doc/examples/gnt-config-backup \
85
	doc/examples/hooks/ipsec \
86
	$(man_MANS) \
87
	$(manhtml) \
88
	stamp-directories \
89
	stamp-srclinks \
90
	$(nodist_pkgpython_PYTHON)
91

    
92
BUILT_SOURCES = \
93
	ganeti \
94
	stamp-srclinks \
95
	stamp-directories \
96
	lib/_autoconf.py
97

    
98
nodist_pkgpython_PYTHON = \
99
	lib/_autoconf.py
100

    
101
noinst_PYTHON = \
102
	lib/build/__init__.py
103

    
104
pkgpython_PYTHON = \
105
	lib/__init__.py \
106
	lib/asyncnotifier.py \
107
	lib/backend.py \
108
	lib/bdev.py \
109
	lib/bootstrap.py \
110
	lib/cli.py \
111
	lib/cmdlib.py \
112
	lib/compat.py \
113
	lib/config.py \
114
	lib/constants.py \
115
	lib/daemon.py \
116
	lib/errors.py \
117
	lib/jqueue.py \
118
	lib/jstore.py \
119
	lib/locking.py \
120
	lib/luxi.py \
121
	lib/mcpu.py \
122
	lib/objects.py \
123
	lib/opcodes.py \
124
	lib/rpc.py \
125
	lib/serializer.py \
126
	lib/ssconf.py \
127
	lib/ssh.py \
128
	lib/storage.py \
129
	lib/utils.py \
130
	lib/uidpool.py \
131
	lib/workerpool.py
132

    
133
hypervisor_PYTHON = \
134
	lib/hypervisor/__init__.py \
135
	lib/hypervisor/hv_base.py \
136
	lib/hypervisor/hv_chroot.py \
137
	lib/hypervisor/hv_fake.py \
138
	lib/hypervisor/hv_kvm.py \
139
	lib/hypervisor/hv_lxc.py \
140
	lib/hypervisor/hv_xen.py
141

    
142
rapi_PYTHON = \
143
	lib/rapi/__init__.py \
144
	lib/rapi/baserlib.py \
145
	lib/rapi/client.py \
146
	lib/rapi/client_utils.py \
147
	lib/rapi/connector.py \
148
	lib/rapi/rlib2.py
149

    
150
http_PYTHON = \
151
	lib/http/__init__.py \
152
	lib/http/auth.py \
153
	lib/http/client.py \
154
	lib/http/server.py
155

    
156
confd_PYTHON = \
157
	lib/confd/__init__.py \
158
	lib/confd/client.py \
159
	lib/confd/querylib.py \
160
	lib/confd/server.py
161

    
162
masterd_PYTHON = \
163
	lib/masterd/__init__.py \
164
	lib/masterd/instance.py
165

    
166
impexpd_PYTHON = \
167
	lib/impexpd/__init__.py
168

    
169
docrst = \
170
	doc/admin.rst \
171
	doc/design-2.0.rst \
172
	doc/design-2.1.rst \
173
	doc/design-2.2.rst \
174
	doc/cluster-merge.rst \
175
	doc/devnotes.rst \
176
	doc/glossary.rst \
177
	doc/hooks.rst \
178
	doc/iallocator.rst \
179
	doc/index.rst \
180
	doc/install-quick.rst \
181
	doc/install.rst \
182
	doc/locking.rst \
183
	doc/move-instance.rst \
184
	doc/news.rst \
185
	doc/rapi.rst \
186
	doc/security.rst \
187
	doc/walkthrough.rst
188

    
189
doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
190
	@test -n "$(SPHINX)" || \
191
	    { echo 'sphinx-build' not found during configure; exit 1; }
192
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
193
	    -d . \
194
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
195
	    -D release="$(PACKAGE_VERSION)" \
196
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
197
	rm -f doc/html/.buildinfo doc/html/objects.inv
198
	touch $@
199

    
200
doc/html: doc/html/.stamp
201

    
202
doc/news.rst: NEWS
203
	set -e; \
204
	{ echo '.. This file is automatically updated at build time from $<.'; \
205
	  echo '.. Do not edit.'; \
206
	  echo; \
207
	  cat $<; \
208
	} > $@
209

    
210
doc/install-quick.rst: INSTALL
211
	set -e; \
212
	{ echo '.. This file is automatically updated at build time from $<.'; \
213
	  echo '.. Do not edit.'; \
214
	  echo; \
215
	  cat $<; \
216
	} > $@
217

    
218
docdot = \
219
	doc/arch-2.0.dot \
220
	doc/design-2.1-lock-acquire.dot \
221
	doc/design-2.1-lock-release.dot
222

    
223
docpng = $(patsubst %.dot,%.png,$(docdot))
224

    
225
# Things to build but not to install (add it to EXTRA_DIST if it should be
226
# distributed)
227
noinst_DATA = \
228
	devel/upload \
229
	doc/html \
230
	doc/examples/bash_completion \
231
	doc/examples/ganeti.cron \
232
	doc/examples/ganeti.initd \
233
	doc/examples/gnt-config-backup \
234
	doc/examples/hooks/ipsec \
235
	$(manhtml)
236

    
237
gnt_scripts = \
238
	scripts/gnt-backup \
239
	scripts/gnt-cluster \
240
	scripts/gnt-debug \
241
	scripts/gnt-instance \
242
	scripts/gnt-job \
243
	scripts/gnt-node \
244
	scripts/gnt-os
245

    
246
dist_sbin_SCRIPTS = \
247
	daemons/ganeti-noded \
248
	daemons/ganeti-watcher \
249
	daemons/ganeti-masterd \
250
	daemons/ganeti-confd \
251
	daemons/ganeti-rapi \
252
	$(gnt_scripts)
253

    
254
nodist_sbin_SCRIPTS = \
255
	daemons/ganeti-cleaner
256

    
257
dist_tools_SCRIPTS = \
258
	tools/burnin \
259
	tools/cfgshell \
260
	tools/cfgupgrade \
261
	tools/cfgupgrade12 \
262
	tools/cluster-merge \
263
	tools/lvmstrap \
264
	tools/move-instance \
265
	tools/sanitize-config
266

    
267
pkglib_python_scripts = \
268
	daemons/import-export \
269
	tools/check-cert-expired
270

    
271
pkglib_SCRIPTS = \
272
	daemons/daemon-util \
273
	daemons/ensure-dirs \
274
	$(pkglib_python_scripts)
275

    
276
EXTRA_DIST = \
277
	NEWS \
278
	pylintrc \
279
	autotools/build-bash-completion \
280
	autotools/check-python-code \
281
	autotools/check-man \
282
	autotools/docbook-wrapper \
283
	autotools/gen-coverage \
284
	autotools/testrunner \
285
	$(RUN_IN_TEMPDIR) \
286
	daemons/daemon-util.in \
287
	daemons/ensure-dirs.in \
288
	daemons/ganeti-cleaner.in \
289
	$(pkglib_python_scripts) \
290
	devel/upload.in \
291
	$(docdot) \
292
	$(docpng) \
293
	$(docrst) \
294
	doc/conf.py \
295
	doc/html \
296
	doc/examples/ganeti.initd.in \
297
	doc/examples/ganeti.cron.in \
298
	doc/examples/gnt-config-backup.in \
299
	doc/examples/dumb-allocator \
300
	doc/examples/ganeti.default \
301
	doc/examples/ganeti.default-debug \
302
	doc/examples/hooks/ethers \
303
	doc/examples/hooks/ipsec.in \
304
	doc/examples/gnt-debug/README \
305
	doc/examples/gnt-debug/delay0.json \
306
	doc/examples/gnt-debug/delay50.json \
307
	test/testutils.py \
308
	test/mocks.py \
309
	$(dist_TESTS) \
310
	$(TEST_FILES) \
311
	man/footer.sgml \
312
	$(mansgml) \
313
	$(maninput) \
314
	qa/ganeti-qa.py \
315
	qa/qa-sample.json \
316
	qa/qa_cluster.py \
317
	qa/qa_config.py \
318
	qa/qa_daemon.py \
319
	qa/qa_env.py \
320
	qa/qa_error.py \
321
	qa/qa_instance.py \
322
	qa/qa_node.py \
323
	qa/qa_os.py \
324
	qa/qa_rapi.py \
325
	qa/qa_tags.py \
326
	qa/qa_utils.py
327

    
328
man_MANS = \
329
	man/ganeti.7 \
330
	man/ganeti-cleaner.8 \
331
	man/ganeti-confd.8 \
332
	man/ganeti-masterd.8 \
333
	man/ganeti-noded.8 \
334
	man/ganeti-os-interface.7 \
335
	man/ganeti-rapi.8 \
336
	man/ganeti-watcher.8 \
337
	man/gnt-backup.8 \
338
	man/gnt-cluster.8 \
339
	man/gnt-debug.8 \
340
	man/gnt-instance.8 \
341
	man/gnt-job.8 \
342
	man/gnt-node.8 \
343
	man/gnt-os.8
344

    
345
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
346
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
347
maninput = \
348
	$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
349
	$(patsubst %.html,%.html.in,$(manhtml))
350

    
351
TEST_FILES = \
352
	test/data/bdev-drbd-8.0.txt \
353
	test/data/bdev-drbd-8.3.txt \
354
	test/data/bdev-drbd-disk.txt \
355
	test/data/bdev-drbd-net-ip4.txt \
356
	test/data/bdev-drbd-net-ip6.txt \
357
	test/data/cert1.pem \
358
	test/data/proc_drbd8.txt \
359
	test/data/proc_drbd80-emptyline.txt \
360
	test/data/proc_drbd83.txt \
361
	test/data/sys_drbd_usermode_helper.txt \
362
	test/import-export_unittest-helper
363

    
364
python_tests = \
365
	test/ganeti.asyncnotifier_unittest.py \
366
	test/ganeti.backend_unittest.py \
367
	test/ganeti.bdev_unittest.py \
368
	test/ganeti.cli_unittest.py \
369
	test/ganeti.daemon_unittest.py \
370
	test/ganeti.cmdlib_unittest.py \
371
	test/ganeti.compat_unittest.py \
372
	test/ganeti.confd.client_unittest.py \
373
	test/ganeti.config_unittest.py \
374
	test/ganeti.constants_unittest.py \
375
	test/ganeti.errors_unittest.py \
376
	test/ganeti.hooks_unittest.py \
377
	test/ganeti.http_unittest.py \
378
	test/ganeti.impexpd_unittest.py \
379
	test/ganeti.locking_unittest.py \
380
	test/ganeti.luxi_unittest.py \
381
	test/ganeti.masterd.instance_unittest.py \
382
	test/ganeti.mcpu_unittest.py \
383
	test/ganeti.objects_unittest.py \
384
	test/ganeti.opcodes_unittest.py \
385
	test/ganeti.rapi.client_unittest.py \
386
	test/ganeti.rapi.resources_unittest.py \
387
	test/ganeti.rapi.rlib2_unittest.py \
388
	test/ganeti.serializer_unittest.py \
389
	test/ganeti.ssh_unittest.py \
390
	test/ganeti.uidpool_unittest.py \
391
	test/ganeti.utils_unittest.py \
392
	test/ganeti.utils_mlockall_unittest.py \
393
	test/ganeti.workerpool_unittest.py \
394
	test/cfgupgrade_unittest.py \
395
	test/docs_unittest.py \
396
	test/tempfile_fork_unittest.py
397

    
398
dist_TESTS = \
399
	test/check-cert-expired_unittest.bash \
400
	test/daemon-util_unittest.bash \
401
	test/ganeti-cleaner_unittest.bash \
402
	test/import-export_unittest.bash \
403
	$(python_tests)
404

    
405
nodist_TESTS =
406

    
407
TESTS = $(dist_TESTS) $(nodist_TESTS)
408

    
409
# Environment for all tests
410
PLAIN_TESTS_ENVIRONMENT = \
411
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
412

    
413
# Environment for tests run by automake
414
TESTS_ENVIRONMENT = \
415
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
416

    
417
all_python_code = \
418
	$(dist_sbin_SCRIPTS) \
419
	$(dist_tools_SCRIPTS) \
420
	$(pkglib_python_scripts) \
421
	$(python_tests) \
422
	$(pkgpython_PYTHON) \
423
	$(hypervisor_PYTHON) \
424
	$(rapi_PYTHON) \
425
	$(http_PYTHON) \
426
	$(confd_PYTHON) \
427
	$(masterd_PYTHON) \
428
	$(impexpd_PYTHON) \
429
	$(noinst_PYTHON)
430

    
431
srclink_files = \
432
	man/footer.sgml \
433
	test/check-cert-expired_unittest.bash \
434
	test/daemon-util_unittest.bash \
435
	test/ganeti-cleaner_unittest.bash \
436
	test/import-export_unittest.bash \
437
	$(all_python_code)
438

    
439
check_python_code = \
440
	$(BUILD_BASH_COMPLETION) \
441
	$(all_python_code)
442

    
443
lint_python_code = \
444
	ganeti \
445
	$(dist_sbin_SCRIPTS) \
446
	$(dist_tools_SCRIPTS) \
447
	$(pkglib_python_scripts) \
448
	$(BUILD_BASH_COMPLETION)
449

    
450
test/daemon-util_unittest.bash: daemons/daemon-util
451

    
452
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
453

    
454
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
455
	sed -f $(REPLACE_VARS_SED) < $< > $@
456
	chmod u+x $@
457

    
458
daemons/%: daemons/%.in \
459
		$(REPLACE_VARS_SED)
460
	sed -f $(REPLACE_VARS_SED) < $< > $@
461
	chmod +x $@
462

    
463
doc/examples/%: doc/examples/%.in \
464
		$(REPLACE_VARS_SED)
465
	sed -f $(REPLACE_VARS_SED) < $< > $@
466

    
467
doc/examples/hooks/%: doc/examples/hooks/%.in \
468
		$(REPLACE_VARS_SED)
469
	sed -f $(REPLACE_VARS_SED) < $< > $@
470

    
471
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
472
	lib/cli.py $(gnt_scripts) tools/burnin
473
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
474

    
475
doc/%.png: doc/%.dot
476
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
477
	$(DOT) -Tpng -o $@ $<
478

    
479
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
480
	@test -n "$(DOCBOOK2MAN)" || \
481
	  { echo 'docbook2man' not found during configure; exit 1; }
482
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
483
	$(CHECK_MAN) $@
484

    
485
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
486
	@test -n "$(DOCBOOK2HTML)" || \
487
	  { echo 'docbook2html' not found during configure; exit 1; }
488
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
489

    
490
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
491
	sed -f $(REPLACE_VARS_SED) < $< > $@
492

    
493
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
494
	sed -f $(REPLACE_VARS_SED) < $< > $@
495

    
496
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
497
	sed -f $(REPLACE_VARS_SED) < $< > $@
498

    
499
lib/_autoconf.py: Makefile stamp-directories
500
	set -e; \
501
	{ echo '# This file is automatically generated, do not edit!'; \
502
	  echo '#'; \
503
	  echo ''; \
504
	  echo '"""Build-time configuration for Ganeti.'; \
505
	  echo '';\
506
	  echo 'This file is autogenerated by the build process.'; \
507
	  echo 'For any changes you need to re-run ./configure (and'; \
508
	  echo 'not edit by hand).'; \
509
	  echo ''; \
510
	  echo '"""'; \
511
	  echo ''; \
512
	  echo '# pylint: disable-msg=C0301,C0324'; \
513
	  echo '# because this is autogenerated, we do not want'; \
514
	  echo '# style warnings' ; \
515
	  echo ''; \
516
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
517
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
518
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
519
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
520
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
521
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
522
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
523
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
524
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
525
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
526
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
527
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
528
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
529
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
530
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
531
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
532
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
533
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
534
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
535
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
536
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
537
	  echo "TOOLSDIR = '$(toolsdir)'"; \
538
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
539
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
540
	  echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
541
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
542
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
543
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
544
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
545
	} > $@
546

    
547
$(REPLACE_VARS_SED): Makefile
548
	set -e; \
549
	{ echo 's#@PREFIX@#$(prefix)#g'; \
550
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
551
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
552
	  echo 's#@BINDIR@#$(bindir)#g'; \
553
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
554
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
555
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
556
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
557
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
558
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
559
	  echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
560
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
561
	  echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \
562
	  echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \
563
	  echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \
564
	  echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \
565
	  echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
566
	  echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
567
	  echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
568
	  echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
569
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
570
	} > $@
571

    
572
# We need to create symlinks because "make distcheck" will not install Python
573
# files when building.
574
stamp-srclinks: Makefile stamp-directories
575
	set -e; \
576
	for i in $(srclink_files); do \
577
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
578
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
579
		fi; \
580
	done
581
	touch $@
582

    
583
.PHONY: ganeti
584
ganeti:
585
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
586

    
587
.PHONY: check-dirs
588
check-dirs: $(BUILT_SOURCES)
589
	@set -e; \
590
	find . -type d \( \( -name . \) -o \( \
591
		-name .git -o \
592
		-name autom4te.cache \
593
		\) -prune -o -print \) | { \
594
		error=; \
595
		while read dir; do \
596
			case "$$dir" in \
597
				$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
598
				*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
599
			esac; \
600
		done; \
601
		for dir in $(DIRS); do \
602
			if ! test -d "$$dir"; then \
603
				echo "Directory $$dir listed in DIRS does not exist" >&2; \
604
				error=1; \
605
			fi \
606
		done; \
607
		if test -n "$$error"; then exit 1; else exit 0; fi; \
608
	}
609

    
610
check-local: check-dirs
611
	$(CHECK_PYTHON_CODE) $(check_python_code)
612

    
613
.PHONY: lint
614
lint: ganeti $(BUILT_SOURCES)
615
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
616
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
617

    
618
# a dist hook rule for catching revision control directories
619
distcheck-hook:
620
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
621
		echo "Found revision control files in final archive." 1>&2; \
622
		exit 1; \
623
	fi
624
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
625
		echo "Found Python byte code in final archive." 1>&2; \
626
		exit 1; \
627
	fi
628
	if find $(top_distdir) -name '*~' | grep .; then \
629
		echo "Found backup files in final archive." 1>&2; \
630
		exit 1; \
631
	fi
632

    
633
install-exec-local:
634
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
635
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
636
	  "$(DESTDIR)${localstatedir}/run/ganeti"
637

    
638
stamp-directories: Makefile
639
	@mkdir_p@ $(DIRS)
640
	touch $@
641

    
642
.PHONY: apidoc
643
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
644
	test -e doc/api || mkdir doc/api
645
	$(RUN_IN_TEMPDIR) epydoc -v \
646
		--conf $(CURDIR)/epydoc.conf \
647
		--output $(CURDIR)/doc/api
648

    
649
.PHONY: TAGS
650
TAGS: $(BUILT_SOURCES)
651
	rm -f TAGS
652
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
653
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
654
	  etags -
655

    
656
.PHONY: coverage
657
coverage: $(BUILT_SOURCES) $(python_tests)
658
	set -e; \
659
	mkdir -p doc/coverage; \
660
	COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
661
	TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
662
	HTML_COVERAGE=$(CURDIR)/doc/coverage \
663
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
664
	$(python_tests)
665

    
666
commit-check: distcheck lint apidoc
667

    
668
-include ./Makefile.local
669

    
670
# vim: set noet :