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 REPLACE_VARS_SED = autotools/replace_vars.sed
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)
46 MAINTAINERCLEANFILES = \
51 maintainer-clean-local:
52 rm -rf doc/api doc/html
55 autotools/replace_vars.sed \
56 daemons/ganeti-cleaner \
58 doc/examples/bash_completion \
59 doc/examples/ganeti.initd \
60 doc/examples/ganeti.cron \
61 doc/examples/hooks/ipsec \
65 lib/hypervisor/*.py[co] \
73 $(nodist_pkgpython_PYTHON)
81 nodist_pkgpython_PYTHON = \
89 lib/asyncnotifier.py \
114 hypervisor_PYTHON = \
115 lib/hypervisor/__init__.py \
116 lib/hypervisor/hv_base.py \
117 lib/hypervisor/hv_chroot.py \
118 lib/hypervisor/hv_fake.py \
119 lib/hypervisor/hv_kvm.py \
120 lib/hypervisor/hv_xen.py
123 lib/rapi/__init__.py \
124 lib/rapi/baserlib.py \
125 lib/rapi/connector.py \
129 lib/http/__init__.py \
135 lib/confd/__init__.py \
136 lib/confd/client.py \
137 lib/confd/server.py \
138 lib/confd/querylib.py
156 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
157 @test -n "$(SPHINX)" || \
158 { echo 'sphinx-build' not found during configure; exit 1; }
159 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -b html \
161 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
162 -D release="$(PACKAGE_VERSION)" \
163 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
164 rm -f doc/html/.buildinfo doc/html/objects.inv
167 doc/html: doc/html/.stamp
171 { echo '.. This file is automatically updated at build time from $<.'; \
172 echo '.. Do not edit.'; \
179 doc/design-2.1-lock-acquire.dot \
180 doc/design-2.1-lock-release.dot
182 docpng = $(patsubst %.dot,%.png,$(docdot))
184 # Things to build but not to install (add it to EXTRA_DIST if it should be
189 doc/examples/bash_completion \
190 doc/examples/ganeti.cron \
191 doc/examples/ganeti.initd \
192 doc/examples/hooks/ipsec \
197 scripts/gnt-cluster \
199 scripts/gnt-instance \
204 dist_sbin_SCRIPTS = \
205 daemons/ganeti-noded \
206 daemons/ganeti-watcher \
207 daemons/ganeti-masterd \
208 daemons/ganeti-confd \
209 daemons/ganeti-rapi \
212 nodist_sbin_SCRIPTS = \
213 daemons/ganeti-cleaner
215 dist_tools_SCRIPTS = \
224 autotools/build-bash-completion \
225 autotools/check-python-code \
226 autotools/docbook-wrapper \
228 daemons/ganeti-cleaner.in \
235 doc/examples/ganeti.initd.in \
236 doc/examples/ganeti.cron.in \
237 doc/examples/dumb-allocator \
238 doc/examples/hooks/ethers \
239 doc/examples/hooks/ipsec.in \
263 man/ganeti-cleaner.8 \
265 man/ganeti-masterd.8 \
267 man/ganeti-os-interface.7 \
269 man/ganeti-watcher.8 \
278 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
279 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
281 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
282 $(patsubst %.html,%.html.in,$(manhtml))
285 test/data/bdev-both.txt \
286 test/data/bdev-8.3-both.txt \
287 test/data/bdev-disk.txt \
288 test/data/bdev-net.txt \
289 test/data/proc_drbd8.txt \
290 test/data/proc_drbd80-emptyline.txt \
291 test/data/proc_drbd83.txt
294 test/ganeti.bdev_unittest.py \
295 test/ganeti.cli_unittest.py \
296 test/ganeti.cmdlib_unittest.py \
297 test/ganeti.confd_client_unittest.py \
298 test/ganeti.config_unittest.py \
299 test/ganeti.constants_unittest.py \
300 test/ganeti.hooks_unittest.py \
301 test/ganeti.http_unittest.py \
302 test/ganeti.locking_unittest.py \
303 test/ganeti.mcpu_unittest.py \
304 test/ganeti.objects_unittest.py \
305 test/ganeti.rapi.resources_unittest.py \
306 test/ganeti.serializer_unittest.py \
307 test/ganeti.ssh_unittest.py \
308 test/ganeti.utils_unittest.py \
309 test/ganeti.workerpool_unittest.py \
310 test/docs_unittest.py
314 TESTS = $(dist_TESTS) $(nodist_TESTS)
316 TESTS_ENVIRONMENT = \
317 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
318 $(RUN_IN_TEMPDIR) $(PYTHON)
321 $(dist_sbin_SCRIPTS) \
322 $(dist_tools_SCRIPTS) \
324 $(pkgpython_PYTHON) \
325 $(hypervisor_PYTHON) \
335 check_python_code = \
338 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
339 sed -f $(REPLACE_VARS_SED) < $< > $@
342 daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \
344 sed -f $(REPLACE_VARS_SED) < $< > $@
347 doc/examples/%: doc/examples/%.in \
349 sed -f $(REPLACE_VARS_SED) < $< > $@
351 doc/examples/hooks/%: doc/examples/hooks/%.in \
353 sed -f $(REPLACE_VARS_SED) < $< > $@
355 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
356 lib/cli.py $(gnt_scripts) tools/burnin
357 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
360 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
361 $(DOT) -Tpng -o $@ $<
363 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
364 @test -n "$(DOCBOOK2MAN)" || \
365 { echo 'docbook2man' not found during configure; exit 1; }
366 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
368 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
369 @test -n "$(DOCBOOK2HTML)" || \
370 { echo 'docbook2html' not found during configure; exit 1; }
371 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
373 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
374 sed -f $(REPLACE_VARS_SED) < $< > $@
376 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
377 sed -f $(REPLACE_VARS_SED) < $< > $@
379 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
380 sed -f $(REPLACE_VARS_SED) < $< > $@
382 lib/_autoconf.py: Makefile stamp-directories
384 { echo '# This file is automatically generated, do not edit!'; \
387 echo '"""Build-time configuration for Ganeti.'; \
389 echo 'This file is autogenerated by the build process.'; \
390 echo 'For any changes you need to re-run ./configure (and'; \
391 echo 'not edit by hand).'; \
395 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
396 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
397 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
398 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
399 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
400 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
401 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
402 echo "SYSCONFDIR = '$(sysconfdir)'"; \
403 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
404 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
405 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
406 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
407 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
408 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
409 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
410 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
411 echo "KVM_PATH = '$(KVM_PATH)'"; \
412 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
413 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
414 echo "SOCAT_ESCAPE = '$(SOCAT_ESCAPE)'"; \
415 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
416 echo "TOOLSDIR = '$(toolsdir)'"; \
417 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
420 $(REPLACE_VARS_SED): Makefile
422 { echo 's#@PREFIX@#$(prefix)#g'; \
423 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
424 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
425 echo 's#@BINDIR@#$(bindir)#g'; \
426 echo 's#@SBINDIR@#$(sbindir)#g'; \
427 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
428 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
429 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
430 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
431 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
432 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
435 # We need to create symlinks because "make distcheck" will not install Python
436 # files when building.
437 stamp-srclinks: Makefile stamp-directories
439 for i in $(srclink_files); do \
440 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
441 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
448 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
451 $(CHECK_PYTHON_CODE) $(check_python_code)
453 # a dist hook rule for catching revision control directories
455 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
456 echo "Found revision control files in final archive." 1>&2; \
459 if find $(top_distdir) -name '*.py[co]' | grep .; then \
460 echo "Found Python byte code in final archive." 1>&2; \
463 if find $(top_distdir) -name '*~' | grep .; then \
464 echo "Found backup files in final archive." 1>&2; \
469 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
470 "$(DESTDIR)${localstatedir}/log/ganeti" \
471 "$(DESTDIR)${localstatedir}/run/ganeti"
473 stamp-directories: Makefile
478 apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
479 test -e doc/api || mkdir doc/api
480 $(RUN_IN_TEMPDIR) epydoc -v \
481 --conf $(CURDIR)/epydoc.conf \
482 --output $(CURDIR)/doc/api
487 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
488 -path 'daemons/ganeti-*' -o -path 'tools/*' | \