Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ b959138f

History | View | Annotate | Download (10.1 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
	devel/upload \
54
	doc/examples/bash_completion \
55
	doc/examples/ganeti.initd \
56
	doc/examples/ganeti.cron \
57
	lib/*.py[co] \
58
	lib/http/*.py[co] \
59
	lib/hypervisor/*.py[co] \
60
	lib/rapi/*.py[co] \
61
	$(man_MANS) \
62
	$(manhtml) \
63
	qa/*.py[co] \
64
	test/*.py[co] \
65
	stamp-directories \
66
	$(nodist_pkgpython_PYTHON)
67

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

    
73
nodist_pkgpython_PYTHON = \
74
	lib/_autoconf.py
75

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

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

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

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

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

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

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

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

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

    
156
noinst_DATA = $(manhtml) doc/html
157

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

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

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

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

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

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

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

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

    
261
nodist_TESTS =
262

    
263
TESTS = $(dist_TESTS) $(nodist_TESTS)
264

    
265
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
266

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

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

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

    
279
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
280
	lib/cli.py $(gnt_scripts) tools/burnin
281
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
282

    
283
doc/%.png: doc/%.dot
284
	@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
285
	$(DOT) -Tpng -o $@ $<
286

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

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

    
295
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
296
	sed -f $(REPLACE_VARS_SED) < $< > $@
297

    
298
man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
299
	sed -f $(REPLACE_VARS_SED) < $< > $@
300

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

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

    
340
$(REPLACE_VARS_SED): Makefile stamp-directories
341
	set -e; \
342
	{ echo 's#@PREFIX@#$(prefix)#g'; \
343
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
344
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
345
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
346
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
347
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
348
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
349
	  echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
350
	  echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
351
	} > $@
352

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

    
364
.PHONY: ganeti
365
ganeti:
366
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
367

    
368
# a dist hook rule for catching revision control directories
369
distcheck-hook:
370
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
371
		echo "Found revision control files in final archive" 1>&2 ; \
372
		exit 1; \
373
	fi
374

    
375
install-exec-local:
376
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
377
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
378
	  "$(DESTDIR)${localstatedir}/run/ganeti"
379

    
380
stamp-directories: Makefile
381
	@mkdir_p@ $(DIRS)
382
	touch $@
383

    
384
.PHONY: apidoc
385
apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
386
	test -e doc/api || mkdir doc/api
387
	$(RUN_IN_TEMPDIR) epydoc -v \
388
		--conf $(CURDIR)/epydoc.conf \
389
		--output $(CURDIR)/doc/api
390

    
391
.PHONY: TAGS
392
TAGS:
393
	rm -f TAGS
394
	find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
395
	  -path 'daemons/ganeti-*' -o -path 'tools/*' | \
396
	  etags -
397

    
398
# vim: set noet :