Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 7e1ccbe0

History | View | Annotate | Download (11.5 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

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

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

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

    
80
nodist_pkgpython_PYTHON = \
81
	lib/_autoconf.py
82

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

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

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

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

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

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

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

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

    
164
doc/html: doc/html/.stamp
165

    
166
docdot = \
167
	doc/arch-2.0.dot \
168
	doc/design-2.1-lock-acquire.dot \
169
	doc/design-2.1-lock-release.dot
170

    
171
docpng = $(patsubst %.dot,%.png,$(docdot))
172

    
173
# Things to build but not to install (add it to EXTRA_DIST if it should be
174
# distributed)
175
noinst_DATA = \
176
	devel/upload \
177
	doc/html \
178
	doc/examples/bash_completion \
179
	doc/examples/ganeti.cron \
180
	doc/examples/ganeti.initd \
181
	doc/examples/hooks/ipsec \
182
	$(manhtml)
183

    
184
gnt_scripts = \
185
	scripts/gnt-backup \
186
	scripts/gnt-cluster \
187
	scripts/gnt-debug \
188
	scripts/gnt-instance \
189
	scripts/gnt-job \
190
	scripts/gnt-node \
191
	scripts/gnt-os
192

    
193
dist_sbin_SCRIPTS = \
194
	daemons/ganeti-noded \
195
	daemons/ganeti-watcher \
196
	daemons/ganeti-masterd \
197
	daemons/ganeti-confd \
198
	daemons/ganeti-rapi \
199
	$(gnt_scripts)
200

    
201
nodist_sbin_SCRIPTS = \
202
	daemons/ganeti-cleaner
203

    
204
dist_tools_SCRIPTS = \
205
	tools/burnin \
206
	tools/cfgshell \
207
	tools/cfgupgrade \
208
	tools/lvmstrap
209

    
210
EXTRA_DIST = \
211
	$(MAINTAINERCLEANFILES) \
212
	NEWS \
213
	pylintrc \
214
	autotools/build-bash-completion \
215
	autotools/check-python-code \
216
	autotools/docbook-wrapper \
217
	$(RUN_IN_TEMPDIR) \
218
	daemons/ganeti-cleaner.in \
219
	devel/upload.in \
220
	$(docdot) \
221
	$(docrst) \
222
	doc/conf.py \
223
	doc/html \
224
	doc/examples/ganeti.initd.in \
225
	doc/examples/ganeti.cron.in \
226
	doc/examples/dumb-allocator \
227
	doc/examples/hooks/ethers \
228
	doc/examples/hooks/ipsec.in \
229
	test/testutils.py \
230
	test/mocks.py \
231
	$(dist_TESTS) \
232
	$(TEST_FILES) \
233
	man/footer.sgml \
234
	$(mansgml) $(maninput) \
235
	qa/ganeti-qa.py \
236
	qa/qa-sample.json \
237
	qa/qa_cluster.py \
238
	qa/qa_config.py \
239
	qa/qa_daemon.py \
240
	qa/qa_env.py \
241
	qa/qa_error.py \
242
	qa/qa_instance.py \
243
	qa/qa_node.py \
244
	qa/qa_os.py \
245
	qa/qa_rapi.py \
246
	qa/qa_tags.py \
247
	qa/qa_utils.py
248

    
249
man_MANS = \
250
	man/ganeti.7 \
251
	man/ganeti-cleaner.8 \
252
	man/ganeti-confd.8 \
253
	man/ganeti-masterd.8 \
254
	man/ganeti-noded.8 \
255
	man/ganeti-os-interface.7 \
256
	man/ganeti-rapi.8 \
257
	man/ganeti-watcher.8 \
258
	man/gnt-backup.8 \
259
	man/gnt-cluster.8 \
260
	man/gnt-debug.8 \
261
	man/gnt-instance.8 \
262
	man/gnt-job.8 \
263
	man/gnt-node.8 \
264
	man/gnt-os.8
265

    
266
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
267
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
268
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
269

    
270
TEST_FILES = \
271
	test/data/bdev-both.txt \
272
	test/data/bdev-8.3-both.txt \
273
	test/data/bdev-disk.txt \
274
	test/data/bdev-net.txt \
275
	test/data/proc_drbd8.txt \
276
	test/data/proc_drbd80-emptyline.txt \
277
	test/data/proc_drbd83.txt
278

    
279
dist_TESTS = \
280
	test/ganeti.bdev_unittest.py \
281
	test/ganeti.cli_unittest.py \
282
	test/ganeti.cmdlib_unittest.py \
283
	test/ganeti.confd_client_unittest.py \
284
	test/ganeti.config_unittest.py \
285
	test/ganeti.constants_unittest.py \
286
	test/ganeti.hooks_unittest.py \
287
	test/ganeti.http_unittest.py \
288
	test/ganeti.locking_unittest.py \
289
	test/ganeti.mcpu_unittest.py \
290
	test/ganeti.objects_unittest.py \
291
	test/ganeti.rapi.resources_unittest.py \
292
	test/ganeti.serializer_unittest.py \
293
	test/ganeti.ssh_unittest.py \
294
	test/ganeti.utils_unittest.py \
295
	test/ganeti.workerpool_unittest.py \
296
	test/docs_unittest.py
297

    
298
nodist_TESTS =
299

    
300
TESTS = $(dist_TESTS) $(nodist_TESTS)
301

    
302
TESTS_ENVIRONMENT = \
303
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
304
	$(RUN_IN_TEMPDIR) $(PYTHON)
305

    
306
all_python_code = \
307
	$(dist_sbin_SCRIPTS) \
308
	$(dist_tools_SCRIPTS) \
309
	$(dist_TESTS) \
310
	$(pkgpython_PYTHON) \
311
	$(hypervisor_PYTHON) \
312
	$(rapi_PYTHON) \
313
	$(http_PYTHON) \
314
	$(confd_PYTHON) \
315
	$(noinst_PYTHON)
316

    
317
srclink_files = \
318
	man/footer.sgml \
319
	$(all_python_code)
320

    
321
check_python_code = \
322
	$(all_python_code)
323

    
324
devel/upload: devel/upload.in $(REPLACE_VARS_SED)
325
	sed -f $(REPLACE_VARS_SED) < $< > $@
326
	chmod u+x $@
327

    
328
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \
329
		$(REPLACE_VARS_SED)
330
	sed -f $(REPLACE_VARS_SED) < $< > $@
331
	chmod +x $@
332

    
333
doc/examples/%: doc/examples/%.in \
334
		$(REPLACE_VARS_SED)
335
	sed -f $(REPLACE_VARS_SED) < $< > $@
336

    
337
doc/examples/hooks/%: doc/examples/hooks/%.in \
338
		$(REPLACE_VARS_SED)
339
	sed -f $(REPLACE_VARS_SED) < $< > $@
340

    
341
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
342
	lib/cli.py $(gnt_scripts) tools/burnin
343
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
344

    
345
doc/%.png: doc/%.dot
346
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
347
	$(DOT) -Tpng -o $@ $<
348

    
349
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
350
	@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; }
351
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
352

    
353
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
354
	@test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
355
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
356

    
357
man/%.7: man/%.7.in $(REPLACE_VARS_SED)
358
	sed -f $(REPLACE_VARS_SED) < $< > $@
359

    
360
man/%.8: man/%.8.in $(REPLACE_VARS_SED)
361
	sed -f $(REPLACE_VARS_SED) < $< > $@
362

    
363
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
364
	sed -f $(REPLACE_VARS_SED) < $< > $@
365

    
366
lib/_autoconf.py: Makefile stamp-directories
367
	set -e; \
368
	{ echo '# This file is automatically generated, do not edit!'; \
369
	  echo '#'; \
370
	  echo ''; \
371
	  echo '"""Build-time configuration for Ganeti.'; \
372
	  echo '';\
373
	  echo 'This file is autogenerated by the build process.'; \
374
	  echo 'For any changes you need to re-run ./configure (and'; \
375
	  echo 'not edit by hand).'; \
376
	  echo ''; \
377
	  echo '"""'; \
378
	  echo ''; \
379
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
380
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
381
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
382
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
383
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
384
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
385
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
386
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
387
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
388
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
389
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
390
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
391
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
392
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
393
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
394
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
395
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
396
	  echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
397
	  echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
398
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
399
	  echo "TOOLSDIR = '$(toolsdir)'"; \
400
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
401
	} > $@
402

    
403
$(REPLACE_VARS_SED): Makefile
404
	set -e; \
405
	{ echo 's#@PREFIX@#$(prefix)#g'; \
406
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
407
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
408
	  echo 's#@BINDIR@#$(bindir)#g'; \
409
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
410
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
411
	  echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
412
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
413
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
414
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
415
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
416
	} > $@
417

    
418
# We need to create symlinks because "make distcheck" will not install Python
419
# files when building.
420
stamp-srclinks: Makefile stamp-directories
421
	set -e; \
422
	for i in $(srclink_files); do \
423
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
424
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
425
		fi; \
426
	done
427
	touch $@
428

    
429
.PHONY: ganeti
430
ganeti:
431
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
432

    
433
check-local:
434
	$(CHECK_PYTHON_CODE) $(check_python_code)
435

    
436
# a dist hook rule for catching revision control directories
437
distcheck-hook:
438
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
439
		echo "Found revision control files in final archive" 1>&2 ; \
440
		exit 1; \
441
	fi
442

    
443
install-exec-local:
444
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
445
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
446
	  "$(DESTDIR)${localstatedir}/run/ganeti"
447

    
448
stamp-directories: Makefile
449
	@mkdir_p@ $(DIRS)
450
	touch $@
451

    
452
.PHONY: apidoc
453
apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
454
	test -e doc/api || mkdir doc/api
455
	$(RUN_IN_TEMPDIR) epydoc -v \
456
		--conf $(CURDIR)/epydoc.conf \
457
		--output $(CURDIR)/doc/api
458

    
459
.PHONY: TAGS
460
TAGS:
461
	rm -f TAGS
462
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
463
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
464
	  etags -
465

    
466
# vim: set noet :