Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 4c14965f

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

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

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

    
39
MAINTAINERCLEANFILES = \
40
	$(docpng) \
41
	$(maninput)
42

    
43
maintainer-clean-local:
44
	-rm -rf doc/api doc/build doc/html
45

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

    
63
nodist_pkgpython_PYTHON = \
64
	lib/_autoconf.py
65

    
66
pkgpython_PYTHON = \
67
	lib/__init__.py \
68
	lib/backend.py \
69
	lib/bdev.py \
70
	lib/bootstrap.py \
71
	lib/cli.py \
72
	lib/cmdlib.py \
73
	lib/config.py \
74
	lib/constants.py \
75
	lib/daemon.py \
76
	lib/errors.py \
77
	lib/jqueue.py \
78
	lib/jstore.py \
79
	lib/locking.py \
80
	lib/luxi.py \
81
	lib/mcpu.py \
82
	lib/objects.py \
83
	lib/opcodes.py \
84
	lib/rpc.py \
85
	lib/serializer.py \
86
	lib/ssconf.py \
87
	lib/ssh.py \
88
	lib/storage.py \
89
	lib/utils.py \
90
	lib/workerpool.py
91

    
92
hypervisor_PYTHON = \
93
	lib/hypervisor/__init__.py \
94
	lib/hypervisor/hv_base.py \
95
	lib/hypervisor/hv_chroot.py \
96
	lib/hypervisor/hv_fake.py \
97
	lib/hypervisor/hv_kvm.py \
98
	lib/hypervisor/hv_xen.py
99

    
100
rapi_PYTHON = \
101
	lib/rapi/__init__.py \
102
	lib/rapi/baserlib.py \
103
	lib/rapi/connector.py \
104
	lib/rapi/rlib2.py
105

    
106
http_PYTHON = \
107
	lib/http/__init__.py \
108
	lib/http/auth.py \
109
	lib/http/client.py \
110
	lib/http/server.py
111

    
112

    
113
docrst = \
114
	doc/admin.rst \
115
	doc/design-2.0.rst \
116
	doc/design-2.1.rst \
117
	doc/glossary.rst \
118
	doc/hooks.rst \
119
	doc/iallocator.rst \
120
	doc/index.rst \
121
	doc/install.rst \
122
	doc/rapi.rst \
123
	doc/security.rst
124

    
125
doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
126
	@test -n "$(SPHINX)" || \
127
	    { echo 'sphinx-build' not found during configure; exit 1; }
128
	mkdir -p doc/build/doctrees
129
	PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
130
	    -d doc/build/doctrees \
131
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
132
	    -D release="$(PACKAGE_VERSION)" \
133
	    $(top_srcdir)/doc doc/html
134
	touch "$@"
135

    
136
docdot = \
137
	doc/arch-2.0.dot
138

    
139
docpng = $(patsubst %.dot,%.png,$(docdot))
140

    
141
noinst_DATA = $(manhtml) doc/html
142

    
143
dist_sbin_SCRIPTS = \
144
	daemons/ganeti-noded \
145
	daemons/ganeti-watcher \
146
	daemons/ganeti-masterd \
147
	daemons/ganeti-rapi \
148
	scripts/gnt-backup \
149
	scripts/gnt-cluster \
150
	scripts/gnt-debug \
151
	scripts/gnt-instance \
152
	scripts/gnt-job \
153
	scripts/gnt-node \
154
	scripts/gnt-os
155

    
156
dist_tools_SCRIPTS = \
157
	tools/burnin \
158
	tools/cfgshell \
159
	tools/cfgupgrade \
160
	tools/lvmstrap
161

    
162
EXTRA_DIST = \
163
	$(MAINTAINERCLEANFILES) \
164
	NEWS \
165
	DEVNOTES \
166
	pylintrc \
167
	autotools/docbook-wrapper \
168
	devel/upload.in \
169
	$(docdot) \
170
	$(docrst) \
171
	doc/conf.py \
172
	doc/html \
173
	doc/examples/bash_completion.in \
174
	doc/examples/ganeti.initd.in \
175
	doc/examples/ganeti.cron.in \
176
	doc/examples/dumb-allocator \
177
	doc/locking.txt \
178
	test/testutils.py \
179
	test/mocks.py \
180
	$(dist_TESTS) \
181
	$(TEST_FILES) \
182
	man/footer.sgml \
183
	$(mansgml) $(maninput) \
184
	qa/ganeti-qa.py \
185
	qa/qa-sample.json \
186
	qa/qa_cluster.py \
187
	qa/qa_config.py \
188
	qa/qa_daemon.py \
189
	qa/qa_env.py \
190
	qa/qa_error.py \
191
	qa/qa_instance.py \
192
	qa/qa_node.py \
193
	qa/qa_os.py \
194
	qa/qa_rapi.py \
195
	qa/qa_tags.py \
196
	qa/qa_utils.py
197

    
198
man_MANS = \
199
	man/ganeti.7 \
200
	man/ganeti-masterd.8 \
201
	man/ganeti-noded.8 \
202
	man/ganeti-os-interface.7 \
203
	man/ganeti-rapi.8 \
204
	man/ganeti-watcher.8 \
205
	man/gnt-backup.8 \
206
	man/gnt-cluster.8 \
207
	man/gnt-debug.8 \
208
	man/gnt-instance.8 \
209
	man/gnt-job.8 \
210
	man/gnt-node.8 \
211
	man/gnt-os.8
212

    
213
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
214
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
215
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
216

    
217
TEST_FILES = \
218
	test/data/bdev-both.txt \
219
	test/data/bdev-8.3-both.txt \
220
	test/data/bdev-disk.txt \
221
	test/data/bdev-net.txt \
222
	test/data/proc_drbd8.txt \
223
	test/data/proc_drbd83.txt
224

    
225
dist_TESTS = \
226
	test/ganeti.bdev_unittest.py \
227
	test/ganeti.cli_unittest.py \
228
	test/ganeti.cmdlib_unittest.py \
229
	test/ganeti.config_unittest.py \
230
	test/ganeti.constants_unittest.py \
231
	test/ganeti.hooks_unittest.py \
232
	test/ganeti.http_unittest.py \
233
	test/ganeti.locking_unittest.py \
234
	test/ganeti.objects_unittest.py \
235
	test/ganeti.rapi.resources_unittest.py \
236
	test/ganeti.serializer_unittest.py \
237
	test/ganeti.ssh_unittest.py \
238
	test/ganeti.utils_unittest.py \
239
	test/ganeti.workerpool_unittest.py
240

    
241
nodist_TESTS =
242

    
243
TESTS = $(dist_TESTS) $(nodist_TESTS)
244

    
245
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
246

    
247
all-local: stamp-directories lib/_autoconf.py devel/upload \
248
	doc/examples/bash_completion \
249
	doc/examples/ganeti.initd doc/examples/ganeti.cron
250

    
251
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
252
	sed -f $(REPLACE_VARS_SED) < $< > $@
253
	chmod u+x $@
254

    
255
doc/examples/%: doc/examples/%.in stamp-directories \
256
		$(REPLACE_VARS_SED)
257
	sed -f $(REPLACE_VARS_SED) < $< > $@
258

    
259
doc/%.png: doc/%.dot
260
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
261
	$(DOT) -Tpng -o $@ $<
262

    
263
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
264
	@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
265
	TMPDIR=`mktemp -d` && { \
266
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
267
	mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
268
	rm -rf "$$TMPDIR" ; \
269
	}
270

    
271
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
272
	@test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
273
	TMPDIR=`mktemp -d` && { \
274
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
275
	mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
276
	rm -rf "$$TMPDIR" ; \
277
	}
278

    
279
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
280
	sed -f $(REPLACE_VARS_SED) < $< > $@
281

    
282
man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
283
	sed -f $(REPLACE_VARS_SED) < $< > $@
284

    
285
man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
286
	sed -f $(REPLACE_VARS_SED) < $< > $@
287

    
288
man/footer.sgml $(TESTS): srclinks
289

    
290
$(TESTS): ganeti lib/_autoconf.py
291

    
292
lib/_autoconf.py: Makefile stamp-directories
293
	set -e; \
294
	{ echo '# This file is automatically generated, do not edit!'; \
295
	  echo '#'; \
296
	  echo ''; \
297
	  echo '"""Build-time configuration for Ganeti.'; \
298
	  echo '';\
299
	  echo 'This file is autogenerated by the build process.'; \
300
	  echo 'For any changes you need to re-run ./configure (and'; \
301
	  echo 'not edit by hand).'; \
302
	  echo ''; \
303
	  echo '"""'; \
304
	  echo ''; \
305
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
306
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
307
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
308
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
309
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
310
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
311
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
312
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
313
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
314
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
315
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
316
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
317
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
318
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
319
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
320
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
321
	  echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
322
	  echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
323
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)" ; \
324
	} > $@
325

    
326
$(REPLACE_VARS_SED): Makefile stamp-directories
327
	set -e; \
328
	{ echo 's#@PREFIX@#$(prefix)#g'; \
329
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
330
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
331
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
332
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
333
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
334
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
335
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
336
	} > $@
337

    
338
# We need to create symlinks because "make distcheck" will not install Python
339
# files when building.
340
#.PHONY: srclinks
341
srclinks: stamp-directories
342
	set -e; \
343
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
344
			$(rapi_PYTHON) $(http_PYTHON); do \
345
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
346
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
347
		fi; \
348
	done
349

    
350
.PHONY: ganeti
351
ganeti:
352
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
353

    
354
# a dist hook rule for catching revision control directories
355
distcheck-hook:
356
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
357
		echo "Found revision control files in final archive" 1>&2 ; \
358
		exit 1; \
359
	fi
360

    
361
install-exec-local:
362
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
363
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
364
	  "$(DESTDIR)${localstatedir}/run/ganeti"
365

    
366
stamp-directories: Makefile
367
	@mkdir_p@ $(DIRS)
368
	touch $@
369

    
370
.PHONY: apidoc
371
apidoc:
372
	test -e doc/api || mkdir doc/api
373
	TMPDIR=`mktemp -d ` && { \
374
		cp -r scripts daemons lib $$TMPDIR && \
375
		( \
376
			CDIR=`pwd` && \
377
			cd $$TMPDIR && \
378
			mv lib ganeti && \
379
			epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
380
		) ; \
381
		rm -rf $$TMPDIR ; \
382
	}
383

    
384
.PHONY: TAGS
385
TAGS:
386
	rm -f TAGS
387
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
388
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
389
	  etags -
390

    
391
# vim: set noet :