Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ f9897b6d

History | View | Annotate | Download (10.9 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/build \
34
	lib/http \
35
	lib/hypervisor \
36
	lib/rapi \
37
	lib/confd \
38
	man \
39
	qa \
40
	scripts \
41
	test \
42
	test/data \
43
	tools
44

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

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

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

    
72
BUILT_SOURCES = \
73
	ganeti \
74
	srclinks \
75
	lib/_autoconf.py
76

    
77
nodist_pkgpython_PYTHON = \
78
	lib/_autoconf.py
79

    
80
noinst_PYTHON = \
81
	lib/build/__init__.py
82

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

    
110
hypervisor_PYTHON = \
111
	lib/hypervisor/__init__.py \
112
	lib/hypervisor/hv_base.py \
113
	lib/hypervisor/hv_chroot.py \
114
	lib/hypervisor/hv_fake.py \
115
	lib/hypervisor/hv_kvm.py \
116
	lib/hypervisor/hv_xen.py
117

    
118
rapi_PYTHON = \
119
	lib/rapi/__init__.py \
120
	lib/rapi/baserlib.py \
121
	lib/rapi/connector.py \
122
	lib/rapi/rlib2.py
123

    
124
http_PYTHON = \
125
	lib/http/__init__.py \
126
	lib/http/auth.py \
127
	lib/http/client.py \
128
	lib/http/server.py
129

    
130
confd_PYTHON = \
131
	lib/confd/__init__.py \
132
	lib/confd/server.py \
133
	lib/confd/querylib.py
134

    
135
docrst = \
136
	doc/admin.rst \
137
	doc/design-2.0.rst \
138
	doc/design-2.1.rst \
139
	doc/glossary.rst \
140
	doc/hooks.rst \
141
	doc/iallocator.rst \
142
	doc/index.rst \
143
	doc/install.rst \
144
	doc/locking.rst \
145
	doc/rapi.rst \
146
	doc/security.rst
147

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

    
159
docdot = \
160
	doc/arch-2.0.dot
161

    
162
docpng = $(patsubst %.dot,%.png,$(docdot))
163

    
164
noinst_DATA = $(manhtml) doc/html
165

    
166
gnt_scripts = \
167
	scripts/gnt-backup \
168
	scripts/gnt-cluster \
169
	scripts/gnt-debug \
170
	scripts/gnt-instance \
171
	scripts/gnt-job \
172
	scripts/gnt-node \
173
	scripts/gnt-os
174

    
175
dist_sbin_SCRIPTS = \
176
	daemons/ganeti-noded \
177
	daemons/ganeti-watcher \
178
	daemons/ganeti-masterd \
179
	daemons/ganeti-confd \
180
	daemons/ganeti-rapi \
181
	$(gnt_scripts)
182

    
183
nodist_sbin_SCRIPTS = \
184
	daemons/ganeti-cleaner
185

    
186
dist_tools_SCRIPTS = \
187
	tools/burnin \
188
	tools/cfgshell \
189
	tools/cfgupgrade \
190
	tools/lvmstrap
191

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

    
231
man_MANS = \
232
	man/ganeti.7 \
233
	man/ganeti-masterd.8 \
234
	man/ganeti-noded.8 \
235
	man/ganeti-os-interface.7 \
236
	man/ganeti-rapi.8 \
237
	man/ganeti-watcher.8 \
238
	man/gnt-backup.8 \
239
	man/gnt-cluster.8 \
240
	man/gnt-debug.8 \
241
	man/gnt-instance.8 \
242
	man/gnt-job.8 \
243
	man/gnt-node.8 \
244
	man/gnt-os.8
245

    
246
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
247
manhtml = $(patsubst %.sgml,%.html,$(mansgml))
248
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
249

    
250
TEST_FILES = \
251
	test/data/bdev-both.txt \
252
	test/data/bdev-8.3-both.txt \
253
	test/data/bdev-disk.txt \
254
	test/data/bdev-net.txt \
255
	test/data/proc_drbd8.txt \
256
	test/data/proc_drbd83.txt
257

    
258
dist_TESTS = \
259
	test/ganeti.bdev_unittest.py \
260
	test/ganeti.cli_unittest.py \
261
	test/ganeti.cmdlib_unittest.py \
262
	test/ganeti.config_unittest.py \
263
	test/ganeti.constants_unittest.py \
264
	test/ganeti.hooks_unittest.py \
265
	test/ganeti.http_unittest.py \
266
	test/ganeti.locking_unittest.py \
267
	test/ganeti.objects_unittest.py \
268
	test/ganeti.rapi.resources_unittest.py \
269
	test/ganeti.serializer_unittest.py \
270
	test/ganeti.ssh_unittest.py \
271
	test/ganeti.utils_unittest.py \
272
	test/ganeti.workerpool_unittest.py \
273
	test/docs_unittest.py
274

    
275
nodist_TESTS =
276

    
277
TESTS = $(dist_TESTS) $(nodist_TESTS)
278

    
279
TESTS_ENVIRONMENT = \
280
	PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
281
	$(RUN_IN_TEMPDIR) $(PYTHON)
282

    
283
all-local: stamp-directories devel/upload \
284
	doc/examples/bash_completion \
285
	doc/examples/ganeti.initd doc/examples/ganeti.cron \
286
	doc/examples/hooks/ipsec
287

    
288
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
289
	sed -f $(REPLACE_VARS_SED) < $< > $@
290
	chmod u+x $@
291

    
292
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in stamp-directories \
293
		$(REPLACE_VARS_SED)
294
	sed -f $(REPLACE_VARS_SED) < $< > $@
295
	chmod +x $@
296

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

    
301
doc/examples/hooks/%: doc/examples/hooks/%.in stamp-directories \
302
		$(REPLACE_VARS_SED)
303
	sed -f $(REPLACE_VARS_SED) < $< > $@
304

    
305
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
306
	lib/cli.py $(gnt_scripts) tools/burnin
307
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
308

    
309
doc/%.png: doc/%.dot
310
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
311
	$(DOT) -Tpng -o $@ $<
312

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

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

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

    
324
man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
325
	sed -f $(REPLACE_VARS_SED) < $< > $@
326

    
327
man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
328
	sed -f $(REPLACE_VARS_SED) < $< > $@
329

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

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

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

    
393
.PHONY: ganeti
394
ganeti:
395
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
396

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

    
404
install-exec-local:
405
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
406
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
407
	  "$(DESTDIR)${localstatedir}/run/ganeti"
408

    
409
stamp-directories: Makefile
410
	@mkdir_p@ $(DIRS)
411
	touch $@
412

    
413
.PHONY: apidoc
414
apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
415
	test -e doc/api || mkdir doc/api
416
	$(RUN_IN_TEMPDIR) epydoc -v \
417
		--conf $(CURDIR)/epydoc.conf \
418
		--output $(CURDIR)/doc/api
419

    
420
.PHONY: TAGS
421
TAGS:
422
	rm -f TAGS
423
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
424
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
425
	  etags -
426

    
427
# vim: set noet :