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 = \
49 doc/install-quick.rst \
52 maintainer-clean-local:
53 rm -rf doc/api doc/html
56 autotools/replace_vars.sed \
58 daemons/ganeti-cleaner \
60 doc/examples/bash_completion \
61 doc/examples/ganeti.initd \
62 doc/examples/ganeti.cron \
63 doc/examples/gnt-config-backup \
64 doc/examples/hooks/ipsec \
68 lib/hypervisor/*.py[co] \
76 $(nodist_pkgpython_PYTHON)
84 nodist_pkgpython_PYTHON = \
92 lib/asyncnotifier.py \
117 hypervisor_PYTHON = \
118 lib/hypervisor/__init__.py \
119 lib/hypervisor/hv_base.py \
120 lib/hypervisor/hv_chroot.py \
121 lib/hypervisor/hv_fake.py \
122 lib/hypervisor/hv_kvm.py \
123 lib/hypervisor/hv_xen.py
126 lib/rapi/__init__.py \
127 lib/rapi/baserlib.py \
128 lib/rapi/connector.py \
132 lib/http/__init__.py \
138 lib/confd/__init__.py \
139 lib/confd/client.py \
140 lib/confd/server.py \
141 lib/confd/querylib.py
153 doc/install-quick.rst \
161 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
162 @test -n "$(SPHINX)" || \
163 { echo 'sphinx-build' not found during configure; exit 1; }
164 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
166 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
167 -D release="$(PACKAGE_VERSION)" \
168 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
169 rm -f doc/html/.buildinfo doc/html/objects.inv
172 doc/html: doc/html/.stamp
176 { echo '.. This file is automatically updated at build time from $<.'; \
177 echo '.. Do not edit.'; \
182 doc/install-quick.rst: INSTALL
184 { echo '.. This file is automatically updated at build time from $<.'; \
185 echo '.. Do not edit.'; \
192 doc/design-2.1-lock-acquire.dot \
193 doc/design-2.1-lock-release.dot
195 docpng = $(patsubst %.dot,%.png,$(docdot))
197 # Things to build but not to install (add it to EXTRA_DIST if it should be
202 doc/examples/bash_completion \
203 doc/examples/ganeti.cron \
204 doc/examples/ganeti.initd \
205 doc/examples/gnt-config-backup \
206 doc/examples/hooks/ipsec \
211 scripts/gnt-cluster \
213 scripts/gnt-instance \
218 dist_sbin_SCRIPTS = \
219 daemons/ganeti-noded \
220 daemons/ganeti-watcher \
221 daemons/ganeti-masterd \
222 daemons/ganeti-confd \
223 daemons/ganeti-rapi \
226 nodist_sbin_SCRIPTS = \
227 daemons/ganeti-cleaner
229 dist_tools_SCRIPTS = \
241 autotools/build-bash-completion \
242 autotools/check-python-code \
243 autotools/docbook-wrapper \
245 daemons/daemon-util.in \
246 daemons/ganeti-cleaner.in \
253 doc/examples/ganeti.initd.in \
254 doc/examples/ganeti.cron.in \
255 doc/examples/gnt-config-backup.in \
256 doc/examples/dumb-allocator \
257 doc/examples/hooks/ethers \
258 doc/examples/hooks/ipsec.in \
282 man/ganeti-cleaner.8 \
284 man/ganeti-masterd.8 \
286 man/ganeti-os-interface.7 \
288 man/ganeti-watcher.8 \
297 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
298 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
300 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
301 $(patsubst %.html,%.html.in,$(manhtml))
304 test/data/bdev-both.txt \
305 test/data/bdev-8.3-both.txt \
306 test/data/bdev-disk.txt \
307 test/data/bdev-net.txt \
308 test/data/proc_drbd8.txt \
309 test/data/proc_drbd80-emptyline.txt \
310 test/data/proc_drbd83.txt
313 test/ganeti.bdev_unittest.py \
314 test/ganeti.cli_unittest.py \
315 test/ganeti.cmdlib_unittest.py \
316 test/ganeti.confd_client_unittest.py \
317 test/ganeti.config_unittest.py \
318 test/ganeti.constants_unittest.py \
319 test/ganeti.hooks_unittest.py \
320 test/ganeti.http_unittest.py \
321 test/ganeti.locking_unittest.py \
322 test/ganeti.mcpu_unittest.py \
323 test/ganeti.objects_unittest.py \
324 test/ganeti.rapi.resources_unittest.py \
325 test/ganeti.serializer_unittest.py \
326 test/ganeti.ssh_unittest.py \
327 test/ganeti.utils_unittest.py \
328 test/ganeti.workerpool_unittest.py \
329 test/docs_unittest.py
333 TESTS = $(dist_TESTS) $(nodist_TESTS)
335 TESTS_ENVIRONMENT = \
336 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
337 $(RUN_IN_TEMPDIR) $(PYTHON)
340 $(dist_sbin_SCRIPTS) \
341 $(dist_tools_SCRIPTS) \
343 $(pkgpython_PYTHON) \
344 $(hypervisor_PYTHON) \
354 check_python_code = \
355 autotools/build-bash-completion \
358 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
359 sed -f $(REPLACE_VARS_SED) < $< > $@
362 daemons/%: daemons/%.in \
364 sed -f $(REPLACE_VARS_SED) < $< > $@
367 doc/examples/%: doc/examples/%.in \
369 sed -f $(REPLACE_VARS_SED) < $< > $@
371 doc/examples/hooks/%: doc/examples/hooks/%.in \
373 sed -f $(REPLACE_VARS_SED) < $< > $@
375 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
376 lib/cli.py $(gnt_scripts) tools/burnin
377 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
380 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
381 $(DOT) -Tpng -o $@ $<
383 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
384 @test -n "$(DOCBOOK2MAN)" || \
385 { echo 'docbook2man' not found during configure; exit 1; }
386 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
388 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
389 @test -n "$(DOCBOOK2HTML)" || \
390 { echo 'docbook2html' not found during configure; exit 1; }
391 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
393 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
394 sed -f $(REPLACE_VARS_SED) < $< > $@
396 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
397 sed -f $(REPLACE_VARS_SED) < $< > $@
399 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
400 sed -f $(REPLACE_VARS_SED) < $< > $@
402 lib/_autoconf.py: Makefile stamp-directories
404 { echo '# This file is automatically generated, do not edit!'; \
407 echo '"""Build-time configuration for Ganeti.'; \
409 echo 'This file is autogenerated by the build process.'; \
410 echo 'For any changes you need to re-run ./configure (and'; \
411 echo 'not edit by hand).'; \
415 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
416 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
417 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
418 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
419 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
420 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
421 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
422 echo "SYSCONFDIR = '$(sysconfdir)'"; \
423 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
424 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
425 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
426 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
427 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
428 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
429 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
430 echo "KVM_PATH = '$(KVM_PATH)'"; \
431 echo "SOCAT_PATH = '$(SOCAT)'"; \
432 echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
433 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
434 echo "TOOLSDIR = '$(toolsdir)'"; \
435 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
436 echo "PKGLIBDIR = '$(pkglibdir)'"; \
439 $(REPLACE_VARS_SED): Makefile
441 { echo 's#@PREFIX@#$(prefix)#g'; \
442 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
443 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
444 echo 's#@BINDIR@#$(bindir)#g'; \
445 echo 's#@SBINDIR@#$(sbindir)#g'; \
446 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
447 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
448 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
449 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
450 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
451 echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
452 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
455 # We need to create symlinks because "make distcheck" will not install Python
456 # files when building.
457 stamp-srclinks: Makefile stamp-directories
459 for i in $(srclink_files); do \
460 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
461 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
468 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
471 $(CHECK_PYTHON_CODE) $(check_python_code)
473 # a dist hook rule for catching revision control directories
475 if find $(top_distdir) -name .svn -or -name .git | grep .; then \
476 echo "Found revision control files in final archive." 1>&2; \
479 if find $(top_distdir) -name '*.py[co]' | grep .; then \
480 echo "Found Python byte code in final archive." 1>&2; \
483 if find $(top_distdir) -name '*~' | grep .; then \
484 echo "Found backup files in final archive." 1>&2; \
489 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
490 "$(DESTDIR)${localstatedir}/log/ganeti" \
491 "$(DESTDIR)${localstatedir}/run/ganeti"
493 stamp-directories: Makefile
498 apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
499 test -e doc/api || mkdir doc/api
500 $(RUN_IN_TEMPDIR) epydoc -v \
501 --conf $(CURDIR)/epydoc.conf \
502 --output $(CURDIR)/doc/api
507 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
508 -path 'daemons/ganeti-*' -o -path 'tools/*' | \