Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ dc7d2c49

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

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

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

    
43
MAINTAINERCLEANFILES = \
44
	$(docpng) \
45
	$(maninput)
46

    
47
maintainer-clean-local:
48
	-rm -rf doc/api doc/build doc/html
49

    
50
CLEANFILES = \
51
	autotools/replace_vars.sed \
52
	devel/upload \
53
	doc/examples/bash_completion \
54
	doc/examples/ganeti.initd \
55
	doc/examples/ganeti.cron \
56
	lib/*.py[co] \
57
	lib/http/*.py[co] \
58
	lib/hypervisor/*.py[co] \
59
	lib/rapi/*.py[co] \
60
	$(man_MANS) \
61
	$(manhtml) \
62
	qa/*.py[co] \
63
	test/*.py[co] \
64
	stamp-directories \
65
	$(nodist_pkgpython_PYTHON)
66

    
67
BUILT_SOURCES = \
68
	ganeti \
69
	srclinks \
70
	lib/_autoconf.py
71

    
72
nodist_pkgpython_PYTHON = \
73
	lib/_autoconf.py
74

    
75
pkgpython_PYTHON = \
76
	lib/__init__.py \
77
	lib/asyncnotifier.py \
78
	lib/backend.py \
79
	lib/bdev.py \
80
	lib/bootstrap.py \
81
	lib/cli.py \
82
	lib/cmdlib.py \
83
	lib/config.py \
84
	lib/constants.py \
85
	lib/daemon.py \
86
	lib/errors.py \
87
	lib/jqueue.py \
88
	lib/jstore.py \
89
	lib/locking.py \
90
	lib/luxi.py \
91
	lib/mcpu.py \
92
	lib/objects.py \
93
	lib/opcodes.py \
94
	lib/rpc.py \
95
	lib/serializer.py \
96
	lib/ssconf.py \
97
	lib/ssh.py \
98
	lib/storage.py \
99
	lib/utils.py \
100
	lib/workerpool.py
101

    
102
hypervisor_PYTHON = \
103
	lib/hypervisor/__init__.py \
104
	lib/hypervisor/hv_base.py \
105
	lib/hypervisor/hv_chroot.py \
106
	lib/hypervisor/hv_fake.py \
107
	lib/hypervisor/hv_kvm.py \
108
	lib/hypervisor/hv_xen.py
109

    
110
rapi_PYTHON = \
111
	lib/rapi/__init__.py \
112
	lib/rapi/baserlib.py \
113
	lib/rapi/connector.py \
114
	lib/rapi/rlib2.py
115

    
116
http_PYTHON = \
117
	lib/http/__init__.py \
118
	lib/http/auth.py \
119
	lib/http/client.py \
120
	lib/http/server.py
121

    
122
confd_PYTHON = \
123
	lib/confd/__init__.py \
124
	lib/confd/server.py \
125
	lib/confd/querylib.py
126

    
127
docrst = \
128
	doc/admin.rst \
129
	doc/design-2.0.rst \
130
	doc/design-2.1.rst \
131
	doc/glossary.rst \
132
	doc/hooks.rst \
133
	doc/iallocator.rst \
134
	doc/index.rst \
135
	doc/install.rst \
136
	doc/rapi.rst \
137
	doc/security.rst
138

    
139
doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
140
	@test -n "$(SPHINX)" || \
141
	    { echo 'sphinx-build' not found during configure; exit 1; }
142
	mkdir -p doc/build/doctrees
143
	PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
144
	    -d doc/build/doctrees \
145
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
146
	    -D release="$(PACKAGE_VERSION)" \
147
	    $(top_srcdir)/doc doc/html
148
	touch "$@"
149

    
150
docdot = \
151
	doc/arch-2.0.dot
152

    
153
docpng = $(patsubst %.dot,%.png,$(docdot))
154

    
155
noinst_DATA = $(manhtml) doc/html
156

    
157
gnt_scripts = \
158
	scripts/gnt-backup \
159
	scripts/gnt-cluster \
160
	scripts/gnt-debug \
161
	scripts/gnt-instance \
162
	scripts/gnt-job \
163
	scripts/gnt-node \
164
	scripts/gnt-os
165

    
166
dist_sbin_SCRIPTS = \
167
	daemons/ganeti-noded \
168
	daemons/ganeti-watcher \
169
	daemons/ganeti-masterd \
170
	daemons/ganeti-confd \
171
	daemons/ganeti-rapi \
172
	$(gnt_scripts)
173

    
174
dist_tools_SCRIPTS = \
175
	tools/burnin \
176
	tools/cfgshell \
177
	tools/cfgupgrade \
178
	tools/lvmstrap
179

    
180
EXTRA_DIST = \
181
	$(MAINTAINERCLEANFILES) \
182
	NEWS \
183
	DEVNOTES \
184
	pylintrc \
185
	autotools/docbook-wrapper \
186
	devel/upload.in \
187
	$(docdot) \
188
	$(docrst) \
189
	doc/conf.py \
190
	doc/html \
191
	doc/examples/ganeti.initd.in \
192
	doc/examples/ganeti.cron.in \
193
	doc/examples/dumb-allocator \
194
	doc/examples/hooks/ethers \
195
	doc/locking.txt \
196
	test/testutils.py \
197
	test/mocks.py \
198
	$(dist_TESTS) \
199
	$(TEST_FILES) \
200
	man/footer.sgml \
201
	$(mansgml) $(maninput) \
202
	qa/ganeti-qa.py \
203
	qa/qa-sample.json \
204
	qa/qa_cluster.py \
205
	qa/qa_config.py \
206
	qa/qa_daemon.py \
207
	qa/qa_env.py \
208
	qa/qa_error.py \
209
	qa/qa_instance.py \
210
	qa/qa_node.py \
211
	qa/qa_os.py \
212
	qa/qa_rapi.py \
213
	qa/qa_tags.py \
214
	qa/qa_utils.py
215

    
216
man_MANS = \
217
	man/ganeti.7 \
218
	man/ganeti-masterd.8 \
219
	man/ganeti-noded.8 \
220
	man/ganeti-os-interface.7 \
221
	man/ganeti-rapi.8 \
222
	man/ganeti-watcher.8 \
223
	man/gnt-backup.8 \
224
	man/gnt-cluster.8 \
225
	man/gnt-debug.8 \
226
	man/gnt-instance.8 \
227
	man/gnt-job.8 \
228
	man/gnt-node.8 \
229
	man/gnt-os.8
230

    
231
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
232
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
233
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
234

    
235
TEST_FILES = \
236
	test/data/bdev-both.txt \
237
	test/data/bdev-8.3-both.txt \
238
	test/data/bdev-disk.txt \
239
	test/data/bdev-net.txt \
240
	test/data/proc_drbd8.txt \
241
	test/data/proc_drbd83.txt
242

    
243
dist_TESTS = \
244
	test/ganeti.bdev_unittest.py \
245
	test/ganeti.cli_unittest.py \
246
	test/ganeti.cmdlib_unittest.py \
247
	test/ganeti.config_unittest.py \
248
	test/ganeti.constants_unittest.py \
249
	test/ganeti.hooks_unittest.py \
250
	test/ganeti.http_unittest.py \
251
	test/ganeti.locking_unittest.py \
252
	test/ganeti.objects_unittest.py \
253
	test/ganeti.rapi.resources_unittest.py \
254
	test/ganeti.serializer_unittest.py \
255
	test/ganeti.ssh_unittest.py \
256
	test/ganeti.utils_unittest.py \
257
	test/ganeti.workerpool_unittest.py
258

    
259
nodist_TESTS =
260

    
261
TESTS = $(dist_TESTS) $(nodist_TESTS)
262

    
263
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
264

    
265
all-local: stamp-directories devel/upload \
266
	doc/examples/bash_completion \
267
	doc/examples/ganeti.initd doc/examples/ganeti.cron
268

    
269
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
270
	sed -f $(REPLACE_VARS_SED) < $< > $@
271
	chmod u+x $@
272

    
273
doc/examples/%: doc/examples/%.in stamp-directories \
274
		$(REPLACE_VARS_SED)
275
	sed -f $(REPLACE_VARS_SED) < $< > $@
276

    
277
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) \
278
	lib/cli.py $(gnt_scripts) tools/burnin
279
	TMPDIR=`mktemp -d ./buildtmpXXXXXX` && \
280
	cp -r scripts lib tools $$TMPDIR && \
281
	( \
282
		CDIR=`pwd` && \
283
		cd $$TMPDIR && \
284
		mv lib ganeti && \
285
		PYTHONPATH=. $$CDIR/$(BUILD_BASH_COMPLETION) > $$CDIR/$@; \
286
	); \
287
	rm -rf $$TMPDIR
288

    
289
doc/%.png: doc/%.dot
290
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
291
	$(DOT) -Tpng -o $@ $<
292

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

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

    
301
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
302
	sed -f $(REPLACE_VARS_SED) < $< > $@
303

    
304
man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
305
	sed -f $(REPLACE_VARS_SED) < $< > $@
306

    
307
man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
308
	sed -f $(REPLACE_VARS_SED) < $< > $@
309

    
310
lib/_autoconf.py: Makefile stamp-directories
311
	set -e; \
312
	{ echo '# This file is automatically generated, do not edit!'; \
313
	  echo '#'; \
314
	  echo ''; \
315
	  echo '"""Build-time configuration for Ganeti.'; \
316
	  echo '';\
317
	  echo 'This file is autogenerated by the build process.'; \
318
	  echo 'For any changes you need to re-run ./configure (and'; \
319
	  echo 'not edit by hand).'; \
320
	  echo ''; \
321
	  echo '"""'; \
322
	  echo ''; \
323
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
324
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
325
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
326
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
327
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
328
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
329
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
330
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
331
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
332
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
333
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
334
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
335
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
336
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
337
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
338
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
339
	  echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
340
	  echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
341
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
342
	  echo "TOOLSDIR = '$(toolsdir)'"; \
343
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
344
	} > $@
345

    
346
$(REPLACE_VARS_SED): Makefile stamp-directories
347
	set -e; \
348
	{ echo 's#@PREFIX@#$(prefix)#g'; \
349
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
350
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
351
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
352
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
353
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
354
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
355
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
356
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
357
	} > $@
358

    
359
# We need to create symlinks because "make distcheck" will not install Python
360
# files when building.
361
srclinks: stamp-directories
362
	set -e; \
363
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
364
			$(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON); do \
365
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
366
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
367
		fi; \
368
	done
369

    
370
.PHONY: ganeti
371
ganeti:
372
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
373

    
374
# a dist hook rule for catching revision control directories
375
distcheck-hook:
376
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
377
		echo "Found revision control files in final archive" 1>&2 ; \
378
		exit 1; \
379
	fi
380

    
381
install-exec-local:
382
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
383
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
384
	  "$(DESTDIR)${localstatedir}/run/ganeti"
385

    
386
stamp-directories: Makefile
387
	@mkdir_p@ $(DIRS)
388
	touch $@
389

    
390
.PHONY: apidoc
391
apidoc:
392
	test -e doc/api || mkdir doc/api
393
	TMPDIR=`mktemp -d ` && { \
394
		cp -r scripts daemons lib $$TMPDIR && \
395
		( \
396
			CDIR=`pwd` && \
397
			cd $$TMPDIR && \
398
			mv lib ganeti && \
399
			epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
400
		) ; \
401
		rm -rf $$TMPDIR ; \
402
	}
403

    
404
.PHONY: TAGS
405
TAGS:
406
	rm -f TAGS
407
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
408
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
409
	  etags -
410

    
411
# vim: set noet :