Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ a8a76bc2

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/asyncnotifier.py \
69
	lib/backend.py \
70
	lib/bdev.py \
71
	lib/bootstrap.py \
72
	lib/cli.py \
73
	lib/cmdlib.py \
74
	lib/config.py \
75
	lib/constants.py \
76
	lib/daemon.py \
77
	lib/errors.py \
78
	lib/jqueue.py \
79
	lib/jstore.py \
80
	lib/locking.py \
81
	lib/luxi.py \
82
	lib/mcpu.py \
83
	lib/objects.py \
84
	lib/opcodes.py \
85
	lib/rpc.py \
86
	lib/serializer.py \
87
	lib/ssconf.py \
88
	lib/ssh.py \
89
	lib/storage.py \
90
	lib/utils.py \
91
	lib/workerpool.py
92

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

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

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

    
113

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

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

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

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

    
142
noinst_DATA = $(manhtml) doc/html
143

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

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

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

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

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

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

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

    
242
nodist_TESTS =
243

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
392
# vim: set noet :