Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ c71a1a3d

History | View | Annotate | Download (11.7 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
REPLACE_VARS_SED = autotools/replace_vars.sed
18

    
19
hypervisordir = $(pkgpythondir)/hypervisor
20
httpdir = $(pkgpythondir)/http
21
confddir = $(pkgpythondir)/confd
22
rapidir = $(pkgpythondir)/rapi
23
toolsdir = $(pkglibdir)/tools
24
docdir = $(datadir)/doc/$(PACKAGE)
25

    
26
DIRS = \
27
	autotools \
28
	daemons \
29
	devel \
30
	doc \
31
	doc/examples \
32
	doc/examples/hooks \
33
	lib \
34
	lib/build \
35
	lib/http \
36
	lib/hypervisor \
37
	lib/rapi \
38
	lib/confd \
39
	man \
40
	qa \
41
	scripts \
42
	test \
43
	test/data \
44
	tools
45

    
46
MAINTAINERCLEANFILES = \
47
	$(docpng) \
48
	$(maninput) \
49
	doc/news.rst
50

    
51
maintainer-clean-local:
52
	rm -rf doc/api doc/html
53

    
54
CLEANFILES = \
55
	autotools/replace_vars.sed \
56
	daemons/ganeti-cleaner \
57
	devel/upload \
58
	doc/examples/bash_completion \
59
	doc/examples/ganeti.initd \
60
	doc/examples/ganeti.cron \
61
	doc/examples/hooks/ipsec \
62
	lib/*.py[co] \
63
	lib/build/*.py[co] \
64
	lib/http/*.py[co] \
65
	lib/hypervisor/*.py[co] \
66
	lib/rapi/*.py[co] \
67
	$(man_MANS) \
68
	$(manhtml) \
69
	qa/*.py[co] \
70
	test/*.py[co] \
71
	stamp-directories \
72
	stamp-srclinks \
73
	$(nodist_pkgpython_PYTHON)
74

    
75
BUILT_SOURCES = \
76
	ganeti \
77
	stamp-srclinks \
78
	stamp-directories \
79
	lib/_autoconf.py
80

    
81
nodist_pkgpython_PYTHON = \
82
	lib/_autoconf.py
83

    
84
noinst_PYTHON = \
85
	lib/build/__init__.py
86

    
87
pkgpython_PYTHON = \
88
	lib/__init__.py \
89
	lib/asyncnotifier.py \
90
	lib/backend.py \
91
	lib/bdev.py \
92
	lib/bootstrap.py \
93
	lib/cli.py \
94
	lib/cmdlib.py \
95
	lib/config.py \
96
	lib/constants.py \
97
	lib/daemon.py \
98
	lib/errors.py \
99
	lib/jqueue.py \
100
	lib/jstore.py \
101
	lib/locking.py \
102
	lib/luxi.py \
103
	lib/mcpu.py \
104
	lib/objects.py \
105
	lib/opcodes.py \
106
	lib/rpc.py \
107
	lib/serializer.py \
108
	lib/ssconf.py \
109
	lib/ssh.py \
110
	lib/storage.py \
111
	lib/utils.py \
112
	lib/workerpool.py
113

    
114
hypervisor_PYTHON = \
115
	lib/hypervisor/__init__.py \
116
	lib/hypervisor/hv_base.py \
117
	lib/hypervisor/hv_chroot.py \
118
	lib/hypervisor/hv_fake.py \
119
	lib/hypervisor/hv_kvm.py \
120
	lib/hypervisor/hv_xen.py
121

    
122
rapi_PYTHON = \
123
	lib/rapi/__init__.py \
124
	lib/rapi/baserlib.py \
125
	lib/rapi/connector.py \
126
	lib/rapi/rlib2.py
127

    
128
http_PYTHON = \
129
	lib/http/__init__.py \
130
	lib/http/auth.py \
131
	lib/http/client.py \
132
	lib/http/server.py
133

    
134
confd_PYTHON = \
135
	lib/confd/__init__.py \
136
	lib/confd/client.py \
137
	lib/confd/server.py \
138
	lib/confd/querylib.py
139

    
140
docrst = \
141
	doc/admin.rst \
142
	doc/design-2.0.rst \
143
	doc/design-2.1.rst \
144
	doc/devnotes.rst \
145
	doc/glossary.rst \
146
	doc/hooks.rst \
147
	doc/iallocator.rst \
148
	doc/index.rst \
149
	doc/install.rst \
150
	doc/locking.rst \
151
	doc/news.rst \
152
	doc/rapi.rst \
153
	doc/security.rst \
154
	doc/walkthrough.rst
155

    
156
doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
157
	@test -n "$(SPHINX)" || \
158
	    { echo 'sphinx-build' not found during configure; exit 1; }
159
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -b html \
160
	    -d . \
161
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
162
	    -D release="$(PACKAGE_VERSION)" \
163
	    $(abs_top_srcdir)/doc $(CURDIR)/doc/html
164
	rm -f doc/html/.buildinfo doc/html/objects.inv
165
	touch $@
166

    
167
doc/html: doc/html/.stamp
168

    
169
doc/news.rst: NEWS
170
	set -e; \
171
	{ echo '.. This file is automatically updated at build time from $<.'; \
172
	  echo '.. Do not edit.'; \
173
	  echo; \
174
	  cat $<; \
175
	} > $@
176

    
177
docdot = \
178
	doc/arch-2.0.dot \
179
	doc/design-2.1-lock-acquire.dot \
180
	doc/design-2.1-lock-release.dot
181

    
182
docpng = $(patsubst %.dot,%.png,$(docdot))
183

    
184
# Things to build but not to install (add it to EXTRA_DIST if it should be
185
# distributed)
186
noinst_DATA = \
187
	devel/upload \
188
	doc/html \
189
	doc/examples/bash_completion \
190
	doc/examples/ganeti.cron \
191
	doc/examples/ganeti.initd \
192
	doc/examples/hooks/ipsec \
193
	$(manhtml)
194

    
195
gnt_scripts = \
196
	scripts/gnt-backup \
197
	scripts/gnt-cluster \
198
	scripts/gnt-debug \
199
	scripts/gnt-instance \
200
	scripts/gnt-job \
201
	scripts/gnt-node \
202
	scripts/gnt-os
203

    
204
dist_sbin_SCRIPTS = \
205
	daemons/ganeti-noded \
206
	daemons/ganeti-watcher \
207
	daemons/ganeti-masterd \
208
	daemons/ganeti-confd \
209
	daemons/ganeti-rapi \
210
	$(gnt_scripts)
211

    
212
nodist_sbin_SCRIPTS = \
213
	daemons/ganeti-cleaner
214

    
215
dist_tools_SCRIPTS = \
216
	tools/burnin \
217
	tools/cfgshell \
218
	tools/cfgupgrade \
219
	tools/lvmstrap
220

    
221
EXTRA_DIST = \
222
	NEWS \
223
	pylintrc \
224
	autotools/build-bash-completion \
225
	autotools/check-python-code \
226
	autotools/docbook-wrapper \
227
	$(RUN_IN_TEMPDIR) \
228
	daemons/ganeti-cleaner.in \
229
	devel/upload.in \
230
	$(docdot) \
231
	$(docpng) \
232
	$(docrst) \
233
	doc/conf.py \
234
	doc/html \
235
	doc/examples/ganeti.initd.in \
236
	doc/examples/ganeti.cron.in \
237
	doc/examples/dumb-allocator \
238
	doc/examples/hooks/ethers \
239
	doc/examples/hooks/ipsec.in \
240
	test/testutils.py \
241
	test/mocks.py \
242
	$(dist_TESTS) \
243
	$(TEST_FILES) \
244
	man/footer.sgml \
245
	$(mansgml) \
246
	$(maninput) \
247
	qa/ganeti-qa.py \
248
	qa/qa-sample.json \
249
	qa/qa_cluster.py \
250
	qa/qa_config.py \
251
	qa/qa_daemon.py \
252
	qa/qa_env.py \
253
	qa/qa_error.py \
254
	qa/qa_instance.py \
255
	qa/qa_node.py \
256
	qa/qa_os.py \
257
	qa/qa_rapi.py \
258
	qa/qa_tags.py \
259
	qa/qa_utils.py
260

    
261
man_MANS = \
262
	man/ganeti.7 \
263
	man/ganeti-cleaner.8 \
264
	man/ganeti-confd.8 \
265
	man/ganeti-masterd.8 \
266
	man/ganeti-noded.8 \
267
	man/ganeti-os-interface.7 \
268
	man/ganeti-rapi.8 \
269
	man/ganeti-watcher.8 \
270
	man/gnt-backup.8 \
271
	man/gnt-cluster.8 \
272
	man/gnt-debug.8 \
273
	man/gnt-instance.8 \
274
	man/gnt-job.8 \
275
	man/gnt-node.8 \
276
	man/gnt-os.8
277

    
278
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
279
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
280
maninput = \
281
	$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
282
	$(patsubst %.html,%.html.in,$(manhtml))
283

    
284
TEST_FILES = \
285
	test/data/bdev-both.txt \
286
	test/data/bdev-8.3-both.txt \
287
	test/data/bdev-disk.txt \
288
	test/data/bdev-net.txt \
289
	test/data/proc_drbd8.txt \
290
	test/data/proc_drbd80-emptyline.txt \
291
	test/data/proc_drbd83.txt
292

    
293
dist_TESTS = \
294
	test/ganeti.bdev_unittest.py \
295
	test/ganeti.cli_unittest.py \
296
	test/ganeti.cmdlib_unittest.py \
297
	test/ganeti.confd_client_unittest.py \
298
	test/ganeti.config_unittest.py \
299
	test/ganeti.constants_unittest.py \
300
	test/ganeti.hooks_unittest.py \
301
	test/ganeti.http_unittest.py \
302
	test/ganeti.locking_unittest.py \
303
	test/ganeti.mcpu_unittest.py \
304
	test/ganeti.objects_unittest.py \
305
	test/ganeti.rapi.resources_unittest.py \
306
	test/ganeti.serializer_unittest.py \
307
	test/ganeti.ssh_unittest.py \
308
	test/ganeti.utils_unittest.py \
309
	test/ganeti.workerpool_unittest.py \
310
	test/docs_unittest.py
311

    
312
nodist_TESTS =
313

    
314
TESTS = $(dist_TESTS) $(nodist_TESTS)
315

    
316
TESTS_ENVIRONMENT = \
317
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
318
	$(RUN_IN_TEMPDIR) $(PYTHON)
319

    
320
all_python_code = \
321
	$(dist_sbin_SCRIPTS) \
322
	$(dist_tools_SCRIPTS) \
323
	$(dist_TESTS) \
324
	$(pkgpython_PYTHON) \
325
	$(hypervisor_PYTHON) \
326
	$(rapi_PYTHON) \
327
	$(http_PYTHON) \
328
	$(confd_PYTHON) \
329
	$(noinst_PYTHON)
330

    
331
srclink_files = \
332
	man/footer.sgml \
333
	$(all_python_code)
334

    
335
check_python_code = \
336
	$(all_python_code)
337

    
338
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
339
	sed -f $(REPLACE_VARS_SED) < $< > $@
340
	chmod u+x $@
341

    
342
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \
343
		$(REPLACE_VARS_SED)
344
	sed -f $(REPLACE_VARS_SED) < $< > $@
345
	chmod +x $@
346

    
347
doc/examples/%: doc/examples/%.in \
348
		$(REPLACE_VARS_SED)
349
	sed -f $(REPLACE_VARS_SED) < $< > $@
350

    
351
doc/examples/hooks/%: doc/examples/hooks/%.in \
352
		$(REPLACE_VARS_SED)
353
	sed -f $(REPLACE_VARS_SED) < $< > $@
354

    
355
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
356
	lib/cli.py $(gnt_scripts) tools/burnin
357
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
358

    
359
doc/%.png: doc/%.dot
360
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
361
	$(DOT) -Tpng -o $@ $<
362

    
363
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
364
	@test -n "$(DOCBOOK2MAN)" || \
365
	  { echo 'docbook2man' not found during configure; exit 1; }
366
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
367

    
368
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
369
	@test -n "$(DOCBOOK2HTML)" || \
370
	  { echo 'docbook2html' not found during configure; exit 1; }
371
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
372

    
373
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
374
	sed -f $(REPLACE_VARS_SED) < $< > $@
375

    
376
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
377
	sed -f $(REPLACE_VARS_SED) < $< > $@
378

    
379
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
380
	sed -f $(REPLACE_VARS_SED) < $< > $@
381

    
382
lib/_autoconf.py: Makefile stamp-directories
383
	set -e; \
384
	{ echo '# This file is automatically generated, do not edit!'; \
385
	  echo '#'; \
386
	  echo ''; \
387
	  echo '"""Build-time configuration for Ganeti.'; \
388
	  echo '';\
389
	  echo 'This file is autogenerated by the build process.'; \
390
	  echo 'For any changes you need to re-run ./configure (and'; \
391
	  echo 'not edit by hand).'; \
392
	  echo ''; \
393
	  echo '"""'; \
394
	  echo ''; \
395
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
396
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
397
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
398
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
399
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
400
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
401
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
402
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
403
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
404
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
405
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
406
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
407
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
408
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
409
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
410
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
411
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
412
	  echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
413
	  echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
414
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
415
	  echo "TOOLSDIR = '$(toolsdir)'"; \
416
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
417
	} > $@
418

    
419
$(REPLACE_VARS_SED): Makefile
420
	set -e; \
421
	{ echo 's#@PREFIX@#$(prefix)#g'; \
422
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
423
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
424
	  echo 's#@BINDIR@#$(bindir)#g'; \
425
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
426
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
427
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
428
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
429
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
430
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
431
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
432
	} > $@
433

    
434
# We need to create symlinks because "make distcheck" will not install Python
435
# files when building.
436
stamp-srclinks: Makefile stamp-directories
437
	set -e; \
438
	for i in $(srclink_files); do \
439
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
440
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
441
		fi; \
442
	done
443
	touch $@
444

    
445
.PHONY: ganeti
446
ganeti:
447
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
448

    
449
check-local:
450
	$(CHECK_PYTHON_CODE) $(check_python_code)
451

    
452
# a dist hook rule for catching revision control directories
453
distcheck-hook:
454
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
455
		echo "Found revision control files in final archive" 1>&2 ; \
456
		exit 1; \
457
	fi
458

    
459
install-exec-local:
460
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
461
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
462
	  "$(DESTDIR)${localstatedir}/run/ganeti"
463

    
464
stamp-directories: Makefile
465
	@mkdir_p@ $(DIRS)
466
	touch $@
467

    
468
.PHONY: apidoc
469
apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
470
	test -e doc/api || mkdir doc/api
471
	$(RUN_IN_TEMPDIR) epydoc -v \
472
		--conf $(CURDIR)/epydoc.conf \
473
		--output $(CURDIR)/doc/api
474

    
475
.PHONY: TAGS
476
TAGS:
477
	rm -f TAGS
478
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
479
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
480
	  etags -
481

    
482
# vim: set noet :