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.
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@
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 CHECK_MAN = $(top_srcdir)/autotools/check-man
18 REPLACE_VARS_SED = autotools/replace_vars.sed
20 hypervisordir = $(pkgpythondir)/hypervisor
21 httpdir = $(pkgpythondir)/http
22 confddir = $(pkgpythondir)/confd
23 rapidir = $(pkgpythondir)/rapi
24 toolsdir = $(pkglibdir)/tools
25 docdir = $(datadir)/doc/$(PACKAGE)
27 # Delete output file if an error occurred while building it
50 MAINTAINERCLEANFILES = \
53 doc/install-quick.rst \
56 maintainer-clean-local:
57 rm -rf doc/api doc/html doc/coverage
60 autotools/replace_vars.sed \
62 daemons/ganeti-cleaner \
64 doc/examples/bash_completion \
65 doc/examples/ganeti.initd \
66 doc/examples/ganeti.cron \
67 doc/examples/gnt-config-backup \
68 doc/examples/hooks/ipsec \
72 lib/hypervisor/*.py[co] \
80 $(nodist_pkgpython_PYTHON)
88 nodist_pkgpython_PYTHON = \
96 lib/asyncnotifier.py \
121 hypervisor_PYTHON = \
122 lib/hypervisor/__init__.py \
123 lib/hypervisor/hv_base.py \
124 lib/hypervisor/hv_chroot.py \
125 lib/hypervisor/hv_fake.py \
126 lib/hypervisor/hv_kvm.py \
127 lib/hypervisor/hv_xen.py
130 lib/rapi/__init__.py \
131 lib/rapi/baserlib.py \
132 lib/rapi/connector.py \
136 lib/http/__init__.py \
142 lib/confd/__init__.py \
143 lib/confd/client.py \
144 lib/confd/server.py \
145 lib/confd/querylib.py
156 doc/install-quick.rst \
164 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
165 @test -n "$(SPHINX)" || \
166 { echo 'sphinx-build' not found during configure; exit 1; }
167 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
169 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
170 -D release="$(PACKAGE_VERSION)" \
171 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
172 rm -f doc/html/.buildinfo doc/html/objects.inv
175 doc/html: doc/html/.stamp
179 { echo '.. This file is automatically updated at build time from $<.'; \
180 echo '.. Do not edit.'; \
185 doc/install-quick.rst: INSTALL
187 { echo '.. This file is automatically updated at build time from $<.'; \
188 echo '.. Do not edit.'; \
195 doc/design-2.1-lock-acquire.dot \
196 doc/design-2.1-lock-release.dot
198 docpng = $(patsubst %.dot,%.png,$(docdot))
200 # Things to build but not to install (add it to EXTRA_DIST if it should be
205 doc/examples/bash_completion \
206 doc/examples/ganeti.cron \
207 doc/examples/ganeti.initd \
208 doc/examples/gnt-config-backup \
209 doc/examples/hooks/ipsec \
214 scripts/gnt-cluster \
216 scripts/gnt-instance \
221 dist_sbin_SCRIPTS = \
222 daemons/ganeti-noded \
223 daemons/ganeti-watcher \
224 daemons/ganeti-masterd \
225 daemons/ganeti-confd \
226 daemons/ganeti-rapi \
229 nodist_sbin_SCRIPTS = \
230 daemons/ganeti-cleaner
232 dist_tools_SCRIPTS = \
236 tools/cluster-merge \
245 autotools/build-bash-completion \
246 autotools/check-python-code \
247 autotools/check-man \
248 autotools/docbook-wrapper \
249 autotools/gen-coverage \
251 daemons/daemon-util.in \
252 daemons/ganeti-cleaner.in \
259 doc/examples/ganeti.initd.in \
260 doc/examples/ganeti.cron.in \
261 doc/examples/gnt-config-backup.in \
262 doc/examples/dumb-allocator \
263 doc/examples/ganeti.default \
264 doc/examples/ganeti.default-debug \
265 doc/examples/hooks/ethers \
266 doc/examples/hooks/ipsec.in \
290 man/ganeti-cleaner.8 \
292 man/ganeti-masterd.8 \
294 man/ganeti-os-interface.7 \
296 man/ganeti-watcher.8 \
305 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
306 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
308 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
309 $(patsubst %.html,%.html.in,$(manhtml))
312 test/data/bdev-both.txt \
313 test/data/bdev-8.3-both.txt \
314 test/data/bdev-disk.txt \
315 test/data/bdev-net.txt \
316 test/data/proc_drbd8.txt \
317 test/data/proc_drbd80-emptyline.txt \
318 test/data/proc_drbd83.txt
321 test/ganeti.bdev_unittest.py \
322 test/ganeti.cli_unittest.py \
323 test/ganeti.cmdlib_unittest.py \
324 test/ganeti.confd_client_unittest.py \
325 test/ganeti.config_unittest.py \
326 test/ganeti.constants_unittest.py \
327 test/ganeti.hooks_unittest.py \
328 test/ganeti.http_unittest.py \
329 test/ganeti.locking_unittest.py \
330 test/ganeti.mcpu_unittest.py \
331 test/ganeti.objects_unittest.py \
332 test/ganeti.opcodes_unittest.py \
333 test/ganeti.rapi.resources_unittest.py \
334 test/ganeti.serializer_unittest.py \
335 test/ganeti.ssh_unittest.py \
336 test/ganeti.utils_unittest.py \
337 test/ganeti.workerpool_unittest.py \
338 test/docs_unittest.py \
339 test/tempfile_fork_unittest.py
343 TESTS = $(dist_TESTS) $(nodist_TESTS)
345 # Environment for all tests
346 PLAIN_TESTS_ENVIRONMENT = \
347 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
349 # Environment for tests run by automake
350 TESTS_ENVIRONMENT = $(PLAIN_TESTS_ENVIRONMENT) $(PYTHON)
353 $(dist_sbin_SCRIPTS) \
354 $(dist_tools_SCRIPTS) \
356 $(pkgpython_PYTHON) \
357 $(hypervisor_PYTHON) \
367 check_python_code = \
368 $(BUILD_BASH_COMPLETION) \
373 $(dist_sbin_SCRIPTS) \
374 $(dist_tools_SCRIPTS) \
375 $(BUILD_BASH_COMPLETION)
377 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
378 sed -f $(REPLACE_VARS_SED) < $< > $@
381 daemons/%: daemons/%.in \
383 sed -f $(REPLACE_VARS_SED) < $< > $@
386 doc/examples/%: doc/examples/%.in \
388 sed -f $(REPLACE_VARS_SED) < $< > $@
390 doc/examples/hooks/%: doc/examples/hooks/%.in \
392 sed -f $(REPLACE_VARS_SED) < $< > $@
394 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
395 lib/cli.py $(gnt_scripts) tools/burnin
396 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
399 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
400 $(DOT) -Tpng -o $@ $<
402 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
403 @test -n "$(DOCBOOK2MAN)" || \
404 { echo 'docbook2man' not found during configure; exit 1; }
405 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
407 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
408 @test -n "$(DOCBOOK2HTML)" || \
409 { echo 'docbook2html' not found during configure; exit 1; }
410 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
412 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
413 sed -f $(REPLACE_VARS_SED) < $< > $@
416 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
417 sed -f $(REPLACE_VARS_SED) < $< > $@
420 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
421 sed -f $(REPLACE_VARS_SED) < $< > $@
423 lib/_autoconf.py: Makefile stamp-directories
425 { echo '# This file is automatically generated, do not edit!'; \
428 echo '"""Build-time configuration for Ganeti.'; \
430 echo 'This file is autogenerated by the build process.'; \
431 echo 'For any changes you need to re-run ./configure (and'; \
432 echo 'not edit by hand).'; \
436 echo '# pylint: disable-msg=C0301,C0324'; \
437 echo '# because this is autogenerated, we do not want'; \
438 echo '# style warnings' ; \
440 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
441 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
442 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
443 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
444 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
445 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
446 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
447 echo "SYSCONFDIR = '$(sysconfdir)'"; \
448 echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
449 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
450 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
451 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
452 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
453 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
454 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
455 echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
456 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
457 echo "KVM_PATH = '$(KVM_PATH)'"; \
458 echo "SOCAT_PATH = '$(SOCAT)'"; \
459 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
460 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
461 echo "TOOLSDIR = '$(toolsdir)'"; \
462 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
463 echo "PKGLIBDIR = '$(pkglibdir)'"; \
464 echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
465 echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
468 $(REPLACE_VARS_SED): Makefile
470 { echo 's#@PREFIX@#$(prefix)#g'; \
471 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
472 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
473 echo 's#@BINDIR@#$(bindir)#g'; \
474 echo 's#@SBINDIR@#$(sbindir)#g'; \
475 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
476 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
477 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
478 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
479 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
480 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
481 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
484 # We need to create symlinks because "make distcheck" will not install Python
485 # files when building.
486 stamp-srclinks: Makefile stamp-directories
488 for i in $(srclink_files); do \
489 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
490 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
497 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
500 $(CHECK_PYTHON_CODE) $(check_python_code)
503 lint: ganeti $(BUILT_SOURCES)
504 @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
505 $(PYLINT) $(LINT_OPTS) $(lint_python_code)
507 # a dist hook rule for catching revision control directories
509 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
510 echo "Found revision control files in final archive." 1>&2; \
513 if find $(top_distdir) -name '*.py[co]' | grep .; then \
514 echo "Found Python byte code in final archive." 1>&2; \
517 if find $(top_distdir) -name '*~' | grep .; then \
518 echo "Found backup files in final archive." 1>&2; \
523 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
524 "$(DESTDIR)${localstatedir}/log/ganeti" \
525 "$(DESTDIR)${localstatedir}/run/ganeti"
527 stamp-directories: Makefile
532 apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
533 test -e doc/api || mkdir doc/api
534 $(RUN_IN_TEMPDIR) epydoc -v \
535 --conf $(CURDIR)/epydoc.conf \
536 --output $(CURDIR)/doc/api
539 TAGS: $(BUILT_SOURCES)
541 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
542 -path 'daemons/ganeti-*' -o -path 'tools/*' | \
546 coverage: $(BUILT_SOURCES) $(TESTS)
548 mkdir -p doc/coverage; \
549 COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
550 TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
551 HTML_COVERAGE=$(CURDIR)/doc/coverage \
552 $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage $(TESTS)