Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 3f991867

History | View | Annotate | Download (10.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
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
15
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
16
REPLACE_VARS_SED = autotools/replace_vars.sed
17

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

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

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

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

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

    
70
BUILT_SOURCES = \
71
	ganeti \
72
	srclinks \
73
	lib/_autoconf.py
74

    
75
nodist_pkgpython_PYTHON = \
76
	lib/_autoconf.py
77

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

    
105
hypervisor_PYTHON = \
106
	lib/hypervisor/__init__.py \
107
	lib/hypervisor/hv_base.py \
108
	lib/hypervisor/hv_chroot.py \
109
	lib/hypervisor/hv_fake.py \
110
	lib/hypervisor/hv_kvm.py \
111
	lib/hypervisor/hv_xen.py
112

    
113
rapi_PYTHON = \
114
	lib/rapi/__init__.py \
115
	lib/rapi/baserlib.py \
116
	lib/rapi/connector.py \
117
	lib/rapi/rlib2.py
118

    
119
http_PYTHON = \
120
	lib/http/__init__.py \
121
	lib/http/auth.py \
122
	lib/http/client.py \
123
	lib/http/server.py
124

    
125
confd_PYTHON = \
126
	lib/confd/__init__.py \
127
	lib/confd/server.py \
128
	lib/confd/querylib.py
129

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

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

    
153
docdot = \
154
	doc/arch-2.0.dot
155

    
156
docpng = $(patsubst %.dot,%.png,$(docdot))
157

    
158
noinst_DATA = $(manhtml) doc/html
159

    
160
gnt_scripts = \
161
	scripts/gnt-backup \
162
	scripts/gnt-cluster \
163
	scripts/gnt-debug \
164
	scripts/gnt-instance \
165
	scripts/gnt-job \
166
	scripts/gnt-node \
167
	scripts/gnt-os
168

    
169
dist_sbin_SCRIPTS = \
170
	daemons/ganeti-noded \
171
	daemons/ganeti-watcher \
172
	daemons/ganeti-masterd \
173
	daemons/ganeti-confd \
174
	daemons/ganeti-rapi \
175
	$(gnt_scripts)
176

    
177
nodist_sbin_SCRIPTS = \
178
	daemons/ganeti-cleaner
179

    
180
dist_tools_SCRIPTS = \
181
	tools/burnin \
182
	tools/cfgshell \
183
	tools/cfgupgrade \
184
	tools/lvmstrap
185

    
186
EXTRA_DIST = \
187
	$(MAINTAINERCLEANFILES) \
188
	NEWS \
189
	DEVNOTES \
190
	pylintrc \
191
	autotools/build-bash-completion \
192
	autotools/docbook-wrapper \
193
	autotools/run-in-tempdir \
194
	daemons/ganeti-cleaner.in \
195
	devel/upload.in \
196
	$(docdot) \
197
	$(docrst) \
198
	doc/conf.py \
199
	doc/html \
200
	doc/examples/ganeti.initd.in \
201
	doc/examples/ganeti.cron.in \
202
	doc/examples/dumb-allocator \
203
	doc/examples/hooks/ethers \
204
	doc/examples/hooks/ipsec.in \
205
	doc/locking.txt \
206
	test/testutils.py \
207
	test/mocks.py \
208
	$(dist_TESTS) \
209
	$(TEST_FILES) \
210
	man/footer.sgml \
211
	$(mansgml) $(maninput) \
212
	qa/ganeti-qa.py \
213
	qa/qa-sample.json \
214
	qa/qa_cluster.py \
215
	qa/qa_config.py \
216
	qa/qa_daemon.py \
217
	qa/qa_env.py \
218
	qa/qa_error.py \
219
	qa/qa_instance.py \
220
	qa/qa_node.py \
221
	qa/qa_os.py \
222
	qa/qa_rapi.py \
223
	qa/qa_tags.py \
224
	qa/qa_utils.py
225

    
226
man_MANS = \
227
	man/ganeti.7 \
228
	man/ganeti-masterd.8 \
229
	man/ganeti-noded.8 \
230
	man/ganeti-os-interface.7 \
231
	man/ganeti-rapi.8 \
232
	man/ganeti-watcher.8 \
233
	man/gnt-backup.8 \
234
	man/gnt-cluster.8 \
235
	man/gnt-debug.8 \
236
	man/gnt-instance.8 \
237
	man/gnt-job.8 \
238
	man/gnt-node.8 \
239
	man/gnt-os.8
240

    
241
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
242
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
243
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
244

    
245
TEST_FILES = \
246
	test/data/bdev-both.txt \
247
	test/data/bdev-8.3-both.txt \
248
	test/data/bdev-disk.txt \
249
	test/data/bdev-net.txt \
250
	test/data/proc_drbd8.txt \
251
	test/data/proc_drbd83.txt
252

    
253
dist_TESTS = \
254
	test/ganeti.bdev_unittest.py \
255
	test/ganeti.cli_unittest.py \
256
	test/ganeti.cmdlib_unittest.py \
257
	test/ganeti.config_unittest.py \
258
	test/ganeti.constants_unittest.py \
259
	test/ganeti.hooks_unittest.py \
260
	test/ganeti.http_unittest.py \
261
	test/ganeti.locking_unittest.py \
262
	test/ganeti.objects_unittest.py \
263
	test/ganeti.rapi.resources_unittest.py \
264
	test/ganeti.serializer_unittest.py \
265
	test/ganeti.ssh_unittest.py \
266
	test/ganeti.utils_unittest.py \
267
	test/ganeti.workerpool_unittest.py \
268
	test/docs_unittest.py
269

    
270
nodist_TESTS =
271

    
272
TESTS = $(dist_TESTS) $(nodist_TESTS)
273

    
274
TESTS_ENVIRONMENT = \
275
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
276
	$(RUN_IN_TEMPDIR) $(PYTHON)
277

    
278
all-local: stamp-directories devel/upload \
279
	doc/examples/bash_completion \
280
	doc/examples/ganeti.initd doc/examples/ganeti.cron \
281
	doc/examples/hooks/ipsec
282

    
283
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
284
	sed -f $(REPLACE_VARS_SED) < $< > $@
285
	chmod u+x $@
286

    
287
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in stamp-directories \
288
		$(REPLACE_VARS_SED)
289
	sed -f $(REPLACE_VARS_SED) < $< > $@
290
	chmod +x $@
291

    
292
doc/examples/%: doc/examples/%.in stamp-directories \
293
		$(REPLACE_VARS_SED)
294
	sed -f $(REPLACE_VARS_SED) < $< > $@
295

    
296
doc/examples/hooks/%: doc/examples/hooks/%.in stamp-directories \
297
		$(REPLACE_VARS_SED)
298
	sed -f $(REPLACE_VARS_SED) < $< > $@
299

    
300
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
301
	lib/cli.py $(gnt_scripts) tools/burnin
302
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
303

    
304
doc/%.png: doc/%.dot
305
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
306
	$(DOT) -Tpng -o $@ $<
307

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

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

    
316
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
317
	sed -f $(REPLACE_VARS_SED) < $< > $@
318

    
319
man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
320
	sed -f $(REPLACE_VARS_SED) < $< > $@
321

    
322
man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
323
	sed -f $(REPLACE_VARS_SED) < $< > $@
324

    
325
lib/_autoconf.py: Makefile stamp-directories
326
	set -e; \
327
	{ echo '# This file is automatically generated, do not edit!'; \
328
	  echo '#'; \
329
	  echo ''; \
330
	  echo '"""Build-time configuration for Ganeti.'; \
331
	  echo '';\
332
	  echo 'This file is autogenerated by the build process.'; \
333
	  echo 'For any changes you need to re-run ./configure (and'; \
334
	  echo 'not edit by hand).'; \
335
	  echo ''; \
336
	  echo '"""'; \
337
	  echo ''; \
338
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
339
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
340
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
341
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
342
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
343
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
344
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
345
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
346
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
347
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
348
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
349
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
350
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
351
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
352
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
353
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
354
	  echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
355
	  echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
356
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
357
	  echo "TOOLSDIR = '$(toolsdir)'"; \
358
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
359
	} > $@
360

    
361
$(REPLACE_VARS_SED): Makefile stamp-directories
362
	set -e; \
363
	{ echo 's#@PREFIX@#$(prefix)#g'; \
364
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
365
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
366
	  echo 's#@BINDIR@#$(bindir)#g'; \
367
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
368
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
369
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
370
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
371
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
372
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
373
	} > $@
374

    
375
# We need to create symlinks because "make distcheck" will not install Python
376
# files when building.
377
srclinks: stamp-directories
378
	set -e; \
379
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
380
			$(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON) \
381
			$(dist_sbin_SCRIPTS) $(dist_tools_SCRIPTS) \
382
			$(dist_TESTS); do \
383
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
384
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
385
		fi; \
386
	done
387

    
388
.PHONY: ganeti
389
ganeti:
390
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
391

    
392
# a dist hook rule for catching revision control directories
393
distcheck-hook:
394
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
395
		echo "Found revision control files in final archive" 1>&2 ; \
396
		exit 1; \
397
	fi
398

    
399
install-exec-local:
400
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
401
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
402
	  "$(DESTDIR)${localstatedir}/run/ganeti"
403

    
404
stamp-directories: Makefile
405
	@mkdir_p@ $(DIRS)
406
	touch $@
407

    
408
.PHONY: apidoc
409
apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
410
	test -e doc/api || mkdir doc/api
411
	$(RUN_IN_TEMPDIR) epydoc -v \
412
		--conf $(CURDIR)/epydoc.conf \
413
		--output $(CURDIR)/doc/api
414

    
415
.PHONY: TAGS
416
TAGS:
417
	rm -f TAGS
418
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
419
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
420
	  etags -
421

    
422
# vim: set noet :