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 \
57 daemons/ganeti-cleaner \
59 doc/examples/bash_completion \
60 doc/examples/ganeti.initd \
61 doc/examples/ganeti.cron \
62 doc/examples/gnt-config-backup \
63 doc/examples/hooks/ipsec \
67 lib/hypervisor/*.py[co] \
75 $(nodist_pkgpython_PYTHON)
83 nodist_pkgpython_PYTHON = \
91 lib/asyncnotifier.py \
116 hypervisor_PYTHON = \
117 lib/hypervisor/__init__.py \
118 lib/hypervisor/hv_base.py \
119 lib/hypervisor/hv_chroot.py \
120 lib/hypervisor/hv_fake.py \
121 lib/hypervisor/hv_kvm.py \
122 lib/hypervisor/hv_xen.py
125 lib/rapi/__init__.py \
126 lib/rapi/baserlib.py \
127 lib/rapi/connector.py \
131 lib/http/__init__.py \
137 lib/confd/__init__.py \
138 lib/confd/client.py \
139 lib/confd/server.py \
140 lib/confd/querylib.py
158 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
159 @test -n "$(SPHINX)" || \
160 { echo 'sphinx-build' not found during configure; exit 1; }
161 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -b html \
163 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
164 -D release="$(PACKAGE_VERSION)" \
165 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
166 rm -f doc/html/.buildinfo doc/html/objects.inv
169 doc/html: doc/html/.stamp
173 { echo '.. This file is automatically updated at build time from $<.'; \
174 echo '.. Do not edit.'; \
181 doc/design-2.1-lock-acquire.dot \
182 doc/design-2.1-lock-release.dot
184 docpng = $(patsubst %.dot,%.png,$(docdot))
186 # Things to build but not to install (add it to EXTRA_DIST if it should be
191 doc/examples/bash_completion \
192 doc/examples/ganeti.cron \
193 doc/examples/ganeti.initd \
194 doc/examples/gnt-config-backup \
195 doc/examples/hooks/ipsec \
200 scripts/gnt-cluster \
202 scripts/gnt-instance \
207 dist_sbin_SCRIPTS = \
208 daemons/ganeti-noded \
209 daemons/ganeti-watcher \
210 daemons/ganeti-masterd \
211 daemons/ganeti-confd \
212 daemons/ganeti-rapi \
215 nodist_sbin_SCRIPTS = \
216 daemons/ganeti-cleaner
218 dist_tools_SCRIPTS = \
230 autotools/build-bash-completion \
231 autotools/check-python-code \
232 autotools/docbook-wrapper \
234 daemons/daemon-util.in \
235 daemons/ganeti-cleaner.in \
242 doc/examples/ganeti.initd.in \
243 doc/examples/ganeti.cron.in \
244 doc/examples/gnt-config-backup.in \
245 doc/examples/dumb-allocator \
246 doc/examples/hooks/ethers \
247 doc/examples/hooks/ipsec.in \
271 man/ganeti-cleaner.8 \
273 man/ganeti-masterd.8 \
275 man/ganeti-os-interface.7 \
277 man/ganeti-watcher.8 \
286 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
287 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
289 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
290 $(patsubst %.html,%.html.in,$(manhtml))
293 test/data/bdev-both.txt \
294 test/data/bdev-8.3-both.txt \
295 test/data/bdev-disk.txt \
296 test/data/bdev-net.txt \
297 test/data/proc_drbd8.txt \
298 test/data/proc_drbd80-emptyline.txt \
299 test/data/proc_drbd83.txt
302 test/ganeti.bdev_unittest.py \
303 test/ganeti.cli_unittest.py \
304 test/ganeti.cmdlib_unittest.py \
305 test/ganeti.confd_client_unittest.py \
306 test/ganeti.config_unittest.py \
307 test/ganeti.constants_unittest.py \
308 test/ganeti.hooks_unittest.py \
309 test/ganeti.http_unittest.py \
310 test/ganeti.locking_unittest.py \
311 test/ganeti.mcpu_unittest.py \
312 test/ganeti.objects_unittest.py \
313 test/ganeti.rapi.resources_unittest.py \
314 test/ganeti.serializer_unittest.py \
315 test/ganeti.ssh_unittest.py \
316 test/ganeti.utils_unittest.py \
317 test/ganeti.workerpool_unittest.py \
318 test/docs_unittest.py
322 TESTS = $(dist_TESTS) $(nodist_TESTS)
324 TESTS_ENVIRONMENT = \
325 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
326 $(RUN_IN_TEMPDIR) $(PYTHON)
329 $(dist_sbin_SCRIPTS) \
330 $(dist_tools_SCRIPTS) \
332 $(pkgpython_PYTHON) \
333 $(hypervisor_PYTHON) \
343 check_python_code = \
346 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
347 sed -f $(REPLACE_VARS_SED) < $< > $@
350 daemons/%: daemons/%.in \
352 sed -f $(REPLACE_VARS_SED) < $< > $@
355 doc/examples/%: doc/examples/%.in \
357 sed -f $(REPLACE_VARS_SED) < $< > $@
359 doc/examples/hooks/%: doc/examples/hooks/%.in \
361 sed -f $(REPLACE_VARS_SED) < $< > $@
363 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
364 lib/cli.py $(gnt_scripts) tools/burnin
365 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
368 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
369 $(DOT) -Tpng -o $@ $<
371 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
372 @test -n "$(DOCBOOK2MAN)" || \
373 { echo 'docbook2man' not found during configure; exit 1; }
374 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
376 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
377 @test -n "$(DOCBOOK2HTML)" || \
378 { echo 'docbook2html' not found during configure; exit 1; }
379 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
381 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
382 sed -f $(REPLACE_VARS_SED) < $< > $@
384 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
385 sed -f $(REPLACE_VARS_SED) < $< > $@
387 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
388 sed -f $(REPLACE_VARS_SED) < $< > $@
390 lib/_autoconf.py: Makefile stamp-directories
392 { echo '# This file is automatically generated, do not edit!'; \
395 echo '"""Build-time configuration for Ganeti.'; \
397 echo 'This file is autogenerated by the build process.'; \
398 echo 'For any changes you need to re-run ./configure (and'; \
399 echo 'not edit by hand).'; \
403 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
404 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
405 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
406 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
407 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
408 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
409 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
410 echo "SYSCONFDIR = '$(sysconfdir)'"; \
411 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
412 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
413 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
414 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
415 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
416 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
417 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
418 echo "KVM_PATH = '$(KVM_PATH)'"; \
419 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
420 echo "SOCAT_ESCAPE = '$(SOCAT_ESCAPE)'"; \
421 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
422 echo "TOOLSDIR = '$(toolsdir)'"; \
423 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
424 echo "PKGLIBDIR = '$(pkglibdir)'"; \
427 $(REPLACE_VARS_SED): Makefile
429 { echo 's#@PREFIX@#$(prefix)#g'; \
430 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
431 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
432 echo 's#@BINDIR@#$(bindir)#g'; \
433 echo 's#@SBINDIR@#$(sbindir)#g'; \
434 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
435 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
436 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
437 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
438 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
439 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
440 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
443 # We need to create symlinks because "make distcheck" will not install Python
444 # files when building.
445 stamp-srclinks: Makefile stamp-directories
447 for i in $(srclink_files); do \
448 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
449 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
456 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
459 $(CHECK_PYTHON_CODE) $(check_python_code)
461 # a dist hook rule for catching revision control directories
463 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
464 echo "Found revision control files in final archive." 1>&2; \
467 if find $(top_distdir) -name '*.py[co]' | grep .; then \
468 echo "Found Python byte code in final archive." 1>&2; \
471 if find $(top_distdir) -name '*~' | grep .; then \
472 echo "Found backup files in final archive." 1>&2; \
477 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
478 "$(DESTDIR)${localstatedir}/log/ganeti" \
479 "$(DESTDIR)${localstatedir}/run/ganeti"
481 stamp-directories: Makefile
486 apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
487 test -e doc/api || mkdir doc/api
488 $(RUN_IN_TEMPDIR) epydoc -v \
489 --conf $(CURDIR)/epydoc.conf \
490 --output $(CURDIR)/doc/api
495 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
496 -path 'daemons/ganeti-*' -o -path 'tools/*' | \