root / Makefile.am @ 58d38b02
History | View | Annotate | Download (12.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 |
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code |
17 |
REPLACE_VARS_SED = autotools/replace_vars.sed |
18 |
|
19 |
hypervisordir = $(pkgpythondir)/hypervisor |
20 |
httpdir = $(pkgpythondir)/http |
21 |
confddir = $(pkgpythondir)/confd |
22 |
rapidir = $(pkgpythondir)/rapi |
23 |
toolsdir = $(pkglibdir)/tools |
24 |
docdir = $(datadir)/doc/$(PACKAGE) |
25 |
|
26 |
DIRS = \ |
27 |
autotools \ |
28 |
daemons \ |
29 |
devel \ |
30 |
doc \ |
31 |
doc/examples \ |
32 |
doc/examples/hooks \ |
33 |
lib \ |
34 |
lib/build \ |
35 |
lib/http \ |
36 |
lib/hypervisor \ |
37 |
lib/rapi \ |
38 |
lib/confd \ |
39 |
man \ |
40 |
qa \ |
41 |
scripts \ |
42 |
test \ |
43 |
test/data \ |
44 |
tools |
45 |
|
46 |
MAINTAINERCLEANFILES = \ |
47 |
$(docpng) \ |
48 |
$(maninput) \ |
49 |
doc/news.rst |
50 |
|
51 |
maintainer-clean-local: |
52 |
rm -rf doc/api doc/html |
53 |
|
54 |
CLEANFILES = \ |
55 |
autotools/replace_vars.sed \ |
56 |
daemons/ganeti-cleaner \ |
57 |
devel/upload \ |
58 |
doc/examples/bash_completion \ |
59 |
doc/examples/ganeti.initd \ |
60 |
doc/examples/ganeti.cron \ |
61 |
doc/examples/gnt-config-backup \ |
62 |
doc/examples/hooks/ipsec \ |
63 |
lib/*.py[co] \ |
64 |
lib/build/*.py[co] \ |
65 |
lib/http/*.py[co] \ |
66 |
lib/hypervisor/*.py[co] \ |
67 |
lib/rapi/*.py[co] \ |
68 |
$(man_MANS) \ |
69 |
$(manhtml) \ |
70 |
qa/*.py[co] \ |
71 |
test/*.py[co] \ |
72 |
stamp-directories \ |
73 |
stamp-srclinks \ |
74 |
$(nodist_pkgpython_PYTHON) |
75 |
|
76 |
BUILT_SOURCES = \ |
77 |
ganeti \ |
78 |
stamp-srclinks \ |
79 |
stamp-directories \ |
80 |
lib/_autoconf.py |
81 |
|
82 |
nodist_pkgpython_PYTHON = \ |
83 |
lib/_autoconf.py |
84 |
|
85 |
noinst_PYTHON = \ |
86 |
lib/build/__init__.py |
87 |
|
88 |
pkgpython_PYTHON = \ |
89 |
lib/__init__.py \ |
90 |
lib/asyncnotifier.py \ |
91 |
lib/backend.py \ |
92 |
lib/bdev.py \ |
93 |
lib/bootstrap.py \ |
94 |
lib/cli.py \ |
95 |
lib/cmdlib.py \ |
96 |
lib/config.py \ |
97 |
lib/constants.py \ |
98 |
lib/daemon.py \ |
99 |
lib/errors.py \ |
100 |
lib/jqueue.py \ |
101 |
lib/jstore.py \ |
102 |
lib/locking.py \ |
103 |
lib/luxi.py \ |
104 |
lib/mcpu.py \ |
105 |
lib/objects.py \ |
106 |
lib/opcodes.py \ |
107 |
lib/rpc.py \ |
108 |
lib/serializer.py \ |
109 |
lib/ssconf.py \ |
110 |
lib/ssh.py \ |
111 |
lib/storage.py \ |
112 |
lib/utils.py \ |
113 |
lib/workerpool.py |
114 |
|
115 |
hypervisor_PYTHON = \ |
116 |
lib/hypervisor/__init__.py \ |
117 |
lib/hypervisor/hv_base.py \ |
118 |
lib/hypervisor/hv_chroot.py \ |
119 |
lib/hypervisor/hv_fake.py \ |
120 |
lib/hypervisor/hv_kvm.py \ |
121 |
lib/hypervisor/hv_xen.py |
122 |
|
123 |
rapi_PYTHON = \ |
124 |
lib/rapi/__init__.py \ |
125 |
lib/rapi/baserlib.py \ |
126 |
lib/rapi/connector.py \ |
127 |
lib/rapi/rlib2.py |
128 |
|
129 |
http_PYTHON = \ |
130 |
lib/http/__init__.py \ |
131 |
lib/http/auth.py \ |
132 |
lib/http/client.py \ |
133 |
lib/http/server.py |
134 |
|
135 |
confd_PYTHON = \ |
136 |
lib/confd/__init__.py \ |
137 |
lib/confd/client.py \ |
138 |
lib/confd/server.py \ |
139 |
lib/confd/querylib.py |
140 |
|
141 |
docrst = \ |
142 |
doc/admin.rst \ |
143 |
doc/design-2.0.rst \ |
144 |
doc/design-2.1.rst \ |
145 |
doc/devnotes.rst \ |
146 |
doc/glossary.rst \ |
147 |
doc/hooks.rst \ |
148 |
doc/iallocator.rst \ |
149 |
doc/index.rst \ |
150 |
doc/install.rst \ |
151 |
doc/locking.rst \ |
152 |
doc/news.rst \ |
153 |
doc/rapi.rst \ |
154 |
doc/security.rst \ |
155 |
doc/walkthrough.rst |
156 |
|
157 |
doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac |
158 |
@test -n "$(SPHINX)" || \ |
159 |
{ echo 'sphinx-build' not found during configure; exit 1; } |
160 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -b html \ |
161 |
-d . \ |
162 |
-D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \ |
163 |
-D release="$(PACKAGE_VERSION)" \ |
164 |
$(abs_top_srcdir)/doc $(CURDIR)/doc/html |
165 |
rm -f doc/html/.buildinfo doc/html/objects.inv |
166 |
touch $@ |
167 |
|
168 |
doc/html: doc/html/.stamp |
169 |
|
170 |
doc/news.rst: NEWS |
171 |
set -e; \ |
172 |
{ echo '.. This file is automatically updated at build time from $<.'; \ |
173 |
echo '.. Do not edit.'; \ |
174 |
echo; \ |
175 |
cat $<; \ |
176 |
} > $@ |
177 |
|
178 |
docdot = \ |
179 |
doc/arch-2.0.dot \ |
180 |
doc/design-2.1-lock-acquire.dot \ |
181 |
doc/design-2.1-lock-release.dot |
182 |
|
183 |
docpng = $(patsubst %.dot,%.png,$(docdot)) |
184 |
|
185 |
# Things to build but not to install (add it to EXTRA_DIST if it should be |
186 |
# distributed) |
187 |
noinst_DATA = \ |
188 |
devel/upload \ |
189 |
doc/html \ |
190 |
doc/examples/bash_completion \ |
191 |
doc/examples/ganeti.cron \ |
192 |
doc/examples/ganeti.initd \ |
193 |
doc/examples/gnt-config-backup \ |
194 |
doc/examples/hooks/ipsec \ |
195 |
$(manhtml) |
196 |
|
197 |
gnt_scripts = \ |
198 |
scripts/gnt-backup \ |
199 |
scripts/gnt-cluster \ |
200 |
scripts/gnt-debug \ |
201 |
scripts/gnt-instance \ |
202 |
scripts/gnt-job \ |
203 |
scripts/gnt-node \ |
204 |
scripts/gnt-os |
205 |
|
206 |
dist_sbin_SCRIPTS = \ |
207 |
daemons/ganeti-noded \ |
208 |
daemons/ganeti-watcher \ |
209 |
daemons/ganeti-masterd \ |
210 |
daemons/ganeti-confd \ |
211 |
daemons/ganeti-rapi \ |
212 |
$(gnt_scripts) |
213 |
|
214 |
nodist_sbin_SCRIPTS = \ |
215 |
daemons/ganeti-cleaner |
216 |
|
217 |
dist_tools_SCRIPTS = \ |
218 |
tools/burnin \ |
219 |
tools/cfgshell \ |
220 |
tools/cfgupgrade \ |
221 |
tools/lvmstrap |
222 |
|
223 |
EXTRA_DIST = \ |
224 |
NEWS \ |
225 |
pylintrc \ |
226 |
autotools/build-bash-completion \ |
227 |
autotools/check-python-code \ |
228 |
autotools/docbook-wrapper \ |
229 |
$(RUN_IN_TEMPDIR) \ |
230 |
daemons/ganeti-cleaner.in \ |
231 |
devel/upload.in \ |
232 |
$(docdot) \ |
233 |
$(docpng) \ |
234 |
$(docrst) \ |
235 |
doc/conf.py \ |
236 |
doc/html \ |
237 |
doc/examples/ganeti.initd.in \ |
238 |
doc/examples/ganeti.cron.in \ |
239 |
doc/examples/gnt-config-backup.in \ |
240 |
doc/examples/dumb-allocator \ |
241 |
doc/examples/hooks/ethers \ |
242 |
doc/examples/hooks/ipsec.in \ |
243 |
test/testutils.py \ |
244 |
test/mocks.py \ |
245 |
$(dist_TESTS) \ |
246 |
$(TEST_FILES) \ |
247 |
man/footer.sgml \ |
248 |
$(mansgml) \ |
249 |
$(maninput) \ |
250 |
qa/ganeti-qa.py \ |
251 |
qa/qa-sample.json \ |
252 |
qa/qa_cluster.py \ |
253 |
qa/qa_config.py \ |
254 |
qa/qa_daemon.py \ |
255 |
qa/qa_env.py \ |
256 |
qa/qa_error.py \ |
257 |
qa/qa_instance.py \ |
258 |
qa/qa_node.py \ |
259 |
qa/qa_os.py \ |
260 |
qa/qa_rapi.py \ |
261 |
qa/qa_tags.py \ |
262 |
qa/qa_utils.py |
263 |
|
264 |
man_MANS = \ |
265 |
man/ganeti.7 \ |
266 |
man/ganeti-cleaner.8 \ |
267 |
man/ganeti-confd.8 \ |
268 |
man/ganeti-masterd.8 \ |
269 |
man/ganeti-noded.8 \ |
270 |
man/ganeti-os-interface.7 \ |
271 |
man/ganeti-rapi.8 \ |
272 |
man/ganeti-watcher.8 \ |
273 |
man/gnt-backup.8 \ |
274 |
man/gnt-cluster.8 \ |
275 |
man/gnt-debug.8 \ |
276 |
man/gnt-instance.8 \ |
277 |
man/gnt-job.8 \ |
278 |
man/gnt-node.8 \ |
279 |
man/gnt-os.8 |
280 |
|
281 |
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS))) |
282 |
manhtml = $(patsubst %.sgml,%.html,$(mansgml)) |
283 |
maninput = \ |
284 |
$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \ |
285 |
$(patsubst %.html,%.html.in,$(manhtml)) |
286 |
|
287 |
TEST_FILES = \ |
288 |
test/data/bdev-both.txt \ |
289 |
test/data/bdev-8.3-both.txt \ |
290 |
test/data/bdev-disk.txt \ |
291 |
test/data/bdev-net.txt \ |
292 |
test/data/proc_drbd8.txt \ |
293 |
test/data/proc_drbd80-emptyline.txt \ |
294 |
test/data/proc_drbd83.txt |
295 |
|
296 |
dist_TESTS = \ |
297 |
test/ganeti.bdev_unittest.py \ |
298 |
test/ganeti.cli_unittest.py \ |
299 |
test/ganeti.cmdlib_unittest.py \ |
300 |
test/ganeti.confd_client_unittest.py \ |
301 |
test/ganeti.config_unittest.py \ |
302 |
test/ganeti.constants_unittest.py \ |
303 |
test/ganeti.hooks_unittest.py \ |
304 |
test/ganeti.http_unittest.py \ |
305 |
test/ganeti.locking_unittest.py \ |
306 |
test/ganeti.mcpu_unittest.py \ |
307 |
test/ganeti.objects_unittest.py \ |
308 |
test/ganeti.rapi.resources_unittest.py \ |
309 |
test/ganeti.serializer_unittest.py \ |
310 |
test/ganeti.ssh_unittest.py \ |
311 |
test/ganeti.utils_unittest.py \ |
312 |
test/ganeti.workerpool_unittest.py \ |
313 |
test/docs_unittest.py |
314 |
|
315 |
nodist_TESTS = |
316 |
|
317 |
TESTS = $(dist_TESTS) $(nodist_TESTS) |
318 |
|
319 |
TESTS_ENVIRONMENT = \ |
320 |
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \ |
321 |
$(RUN_IN_TEMPDIR) $(PYTHON) |
322 |
|
323 |
all_python_code = \ |
324 |
$(dist_sbin_SCRIPTS) \ |
325 |
$(dist_tools_SCRIPTS) \ |
326 |
$(dist_TESTS) \ |
327 |
$(pkgpython_PYTHON) \ |
328 |
$(hypervisor_PYTHON) \ |
329 |
$(rapi_PYTHON) \ |
330 |
$(http_PYTHON) \ |
331 |
$(confd_PYTHON) \ |
332 |
$(noinst_PYTHON) |
333 |
|
334 |
srclink_files = \ |
335 |
man/footer.sgml \ |
336 |
$(all_python_code) |
337 |
|
338 |
check_python_code = \ |
339 |
$(all_python_code) |
340 |
|
341 |
devel/upload: devel/upload.in $(REPLACE_VARS_SED) |
342 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
343 |
chmod u+x $@ |
344 |
|
345 |
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \ |
346 |
$(REPLACE_VARS_SED) |
347 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
348 |
chmod +x $@ |
349 |
|
350 |
doc/examples/%: doc/examples/%.in \ |
351 |
$(REPLACE_VARS_SED) |
352 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
353 |
|
354 |
doc/examples/hooks/%: doc/examples/hooks/%.in \ |
355 |
$(REPLACE_VARS_SED) |
356 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
357 |
|
358 |
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \ |
359 |
lib/cli.py $(gnt_scripts) tools/burnin |
360 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@ |
361 |
|
362 |
doc/%.png: doc/%.dot |
363 |
@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; } |
364 |
$(DOT) -Tpng -o $@ $< |
365 |
|
366 |
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) |
367 |
@test -n "$(DOCBOOK2MAN)" || \ |
368 |
{ echo 'docbook2man' not found during configure; exit 1; } |
369 |
$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@ |
370 |
|
371 |
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) |
372 |
@test -n "$(DOCBOOK2HTML)" || \ |
373 |
{ echo 'docbook2html' not found during configure; exit 1; } |
374 |
$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@ |
375 |
|
376 |
man/%.7: man/%.7.in $(REPLACE_VARS_SED) |
377 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
378 |
|
379 |
man/%.8: man/%.8.in $(REPLACE_VARS_SED) |
380 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
381 |
|
382 |
man/%.html: man/%.html.in $(REPLACE_VARS_SED) |
383 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
384 |
|
385 |
lib/_autoconf.py: Makefile stamp-directories |
386 |
set -e; \ |
387 |
{ echo '# This file is automatically generated, do not edit!'; \ |
388 |
echo '#'; \ |
389 |
echo ''; \ |
390 |
echo '"""Build-time configuration for Ganeti.'; \ |
391 |
echo '';\ |
392 |
echo 'This file is autogenerated by the build process.'; \ |
393 |
echo 'For any changes you need to re-run ./configure (and'; \ |
394 |
echo 'not edit by hand).'; \ |
395 |
echo ''; \ |
396 |
echo '"""'; \ |
397 |
echo ''; \ |
398 |
echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \ |
399 |
echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \ |
400 |
echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \ |
401 |
echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \ |
402 |
echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \ |
403 |
echo "VERSION_FULL = '$(VERSION_FULL)'"; \ |
404 |
echo "LOCALSTATEDIR = '$(localstatedir)'"; \ |
405 |
echo "SYSCONFDIR = '$(sysconfdir)'"; \ |
406 |
echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \ |
407 |
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \ |
408 |
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \ |
409 |
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \ |
410 |
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \ |
411 |
echo "XEN_INITRD = '$(XEN_INITRD)'"; \ |
412 |
echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \ |
413 |
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \ |
414 |
echo "KVM_PATH = '$(KVM_PATH)'"; \ |
415 |
echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \ |
416 |
echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \ |
417 |
echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \ |
418 |
echo "TOOLSDIR = '$(toolsdir)'"; \ |
419 |
echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \ |
420 |
} > $@ |
421 |
|
422 |
$(REPLACE_VARS_SED): Makefile |
423 |
set -e; \ |
424 |
{ echo 's#@PREFIX@#$(prefix)#g'; \ |
425 |
echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \ |
426 |
echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \ |
427 |
echo 's#@BINDIR@#$(bindir)#g'; \ |
428 |
echo 's#@SBINDIR@#$(sbindir)#g'; \ |
429 |
echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \ |
430 |
echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \ |
431 |
echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \ |
432 |
echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \ |
433 |
echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \ |
434 |
echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \ |
435 |
} > $@ |
436 |
|
437 |
# We need to create symlinks because "make distcheck" will not install Python |
438 |
# files when building. |
439 |
stamp-srclinks: Makefile stamp-directories |
440 |
set -e; \ |
441 |
for i in $(srclink_files); do \ |
442 |
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \ |
443 |
$(LN_S) $(abs_top_srcdir)/$$i $$i; \ |
444 |
fi; \ |
445 |
done |
446 |
touch $@ |
447 |
|
448 |
.PHONY: ganeti |
449 |
ganeti: |
450 |
cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; } |
451 |
|
452 |
check-local: |
453 |
$(CHECK_PYTHON_CODE) $(check_python_code) |
454 |
|
455 |
# a dist hook rule for catching revision control directories |
456 |
distcheck-hook: |
457 |
if find $(top_distdir) -name .svn -or -name .git | grep .; then \ |
458 |
echo "Found revision control files in final archive." 1>&2; \ |
459 |
exit 1; \ |
460 |
fi |
461 |
if find $(top_distdir) -name '*.py[co]' | grep .; then \ |
462 |
echo "Found Python byte code in final archive." 1>&2; \ |
463 |
exit 1; \ |
464 |
fi |
465 |
if find $(top_distdir) -name '*~' | grep .; then \ |
466 |
echo "Found backup files in final archive." 1>&2; \ |
467 |
exit 1; \ |
468 |
fi |
469 |
|
470 |
install-exec-local: |
471 |
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \ |
472 |
"$(DESTDIR)${localstatedir}/log/ganeti" \ |
473 |
"$(DESTDIR)${localstatedir}/run/ganeti" |
474 |
|
475 |
stamp-directories: Makefile |
476 |
@mkdir_p@ $(DIRS) |
477 |
touch $@ |
478 |
|
479 |
.PHONY: apidoc |
480 |
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) |
481 |
test -e doc/api || mkdir doc/api |
482 |
$(RUN_IN_TEMPDIR) epydoc -v \ |
483 |
--conf $(CURDIR)/epydoc.conf \ |
484 |
--output $(CURDIR)/doc/api |
485 |
|
486 |
.PHONY: TAGS |
487 |
TAGS: |
488 |
rm -f TAGS |
489 |
find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \ |
490 |
-path 'daemons/ganeti-*' -o -path 'tools/*' | \ |
491 |
etags - |
492 |
|
493 |
# vim: set noet : |