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
155 doc/html/.stamp: $(docrst) $(docpng) doc/conf.py configure.ac
156 @test -n "$(SPHINX)" || \
157 { echo 'sphinx-build' not found during configure; exit 1; }
158 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -b html \
160 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
161 -D release="$(PACKAGE_VERSION)" \
162 $(abs_top_srcdir)/doc $(CURDIR)/doc/html
163 rm -f doc/html/.buildinfo doc/html/objects.inv
166 doc/html: doc/html/.stamp
170 { echo '.. This file is automatically updated at build time from $<.'; \
171 echo '.. Do not edit.'; \
178 doc/design-2.1-lock-acquire.dot \
179 doc/design-2.1-lock-release.dot
181 docpng = $(patsubst %.dot,%.png,$(docdot))
183 # Things to build but not to install (add it to EXTRA_DIST if it should be
188 doc/examples/bash_completion \
189 doc/examples/ganeti.cron \
190 doc/examples/ganeti.initd \
191 doc/examples/hooks/ipsec \
196 scripts/gnt-cluster \
198 scripts/gnt-instance \
203 dist_sbin_SCRIPTS = \
204 daemons/ganeti-noded \
205 daemons/ganeti-watcher \
206 daemons/ganeti-masterd \
207 daemons/ganeti-confd \
208 daemons/ganeti-rapi \
211 nodist_sbin_SCRIPTS = \
212 daemons/ganeti-cleaner
214 dist_tools_SCRIPTS = \
223 autotools/build-bash-completion \
224 autotools/check-python-code \
225 autotools/docbook-wrapper \
227 daemons/ganeti-cleaner.in \
234 doc/examples/ganeti.initd.in \
235 doc/examples/ganeti.cron.in \
236 doc/examples/dumb-allocator \
237 doc/examples/hooks/ethers \
238 doc/examples/hooks/ipsec.in \
262 man/ganeti-cleaner.8 \
264 man/ganeti-masterd.8 \
266 man/ganeti-os-interface.7 \
268 man/ganeti-watcher.8 \
277 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
278 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
280 $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
281 $(patsubst %.html,%.html.in,$(manhtml))
284 test/data/bdev-both.txt \
285 test/data/bdev-8.3-both.txt \
286 test/data/bdev-disk.txt \
287 test/data/bdev-net.txt \
288 test/data/proc_drbd8.txt \
289 test/data/proc_drbd80-emptyline.txt \
290 test/data/proc_drbd83.txt
293 test/ganeti.bdev_unittest.py \
294 test/ganeti.cli_unittest.py \
295 test/ganeti.cmdlib_unittest.py \
296 test/ganeti.confd_client_unittest.py \
297 test/ganeti.config_unittest.py \
298 test/ganeti.constants_unittest.py \
299 test/ganeti.hooks_unittest.py \
300 test/ganeti.http_unittest.py \
301 test/ganeti.locking_unittest.py \
302 test/ganeti.mcpu_unittest.py \
303 test/ganeti.objects_unittest.py \
304 test/ganeti.rapi.resources_unittest.py \
305 test/ganeti.serializer_unittest.py \
306 test/ganeti.ssh_unittest.py \
307 test/ganeti.utils_unittest.py \
308 test/ganeti.workerpool_unittest.py \
309 test/docs_unittest.py
313 TESTS = $(dist_TESTS) $(nodist_TESTS)
315 TESTS_ENVIRONMENT = \
316 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
317 $(RUN_IN_TEMPDIR) $(PYTHON)
320 $(dist_sbin_SCRIPTS) \
321 $(dist_tools_SCRIPTS) \
323 $(pkgpython_PYTHON) \
324 $(hypervisor_PYTHON) \
334 check_python_code = \
337 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
338 sed -f $(REPLACE_VARS_SED) < $< > $@
341 daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \
343 sed -f $(REPLACE_VARS_SED) < $< > $@
346 doc/examples/%: doc/examples/%.in \
348 sed -f $(REPLACE_VARS_SED) < $< > $@
350 doc/examples/hooks/%: doc/examples/hooks/%.in \
352 sed -f $(REPLACE_VARS_SED) < $< > $@
354 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
355 lib/cli.py $(gnt_scripts) tools/burnin
356 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
359 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
360 $(DOT) -Tpng -o $@ $<
362 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
363 @test -n "$(DOCBOOK2MAN)" || \
364 { echo 'docbook2man' not found during configure; exit 1; }
365 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
367 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
368 @test -n "$(DOCBOOK2HTML)" || \
369 { echo 'docbook2html' not found during configure; exit 1; }
370 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
372 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
373 sed -f $(REPLACE_VARS_SED) < $< > $@
375 man/%.8: man/%.8.in $(REPLACE_VARS_SED)
376 sed -f $(REPLACE_VARS_SED) < $< > $@
378 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
379 sed -f $(REPLACE_VARS_SED) < $< > $@
381 lib/_autoconf.py: Makefile stamp-directories
383 { echo '# This file is automatically generated, do not edit!'; \
386 echo '"""Build-time configuration for Ganeti.'; \
388 echo 'This file is autogenerated by the build process.'; \
389 echo 'For any changes you need to re-run ./configure (and'; \
390 echo 'not edit by hand).'; \
394 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
395 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
396 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
397 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
398 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
399 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
400 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
401 echo "SYSCONFDIR = '$(sysconfdir)'"; \
402 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
403 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
404 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
405 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
406 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
407 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
408 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
409 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
410 echo "KVM_PATH = '$(KVM_PATH)'"; \
411 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
412 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
413 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
414 echo "TOOLSDIR = '$(toolsdir)'"; \
415 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
418 $(REPLACE_VARS_SED): Makefile
420 { echo 's#@PREFIX@#$(prefix)#g'; \
421 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
422 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
423 echo 's#@BINDIR@#$(bindir)#g'; \
424 echo 's#@SBINDIR@#$(sbindir)#g'; \
425 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
426 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
427 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
428 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
429 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
430 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
433 # We need to create symlinks because "make distcheck" will not install Python
434 # files when building.
435 stamp-srclinks: Makefile stamp-directories
437 for i in $(srclink_files); do \
438 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
439 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
446 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
449 $(CHECK_PYTHON_CODE) $(check_python_code)
451 # a dist hook rule for catching revision control directories
453 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
454 echo "Found revision control files in final archive" 1>&2 ; \
459 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
460 "$(DESTDIR)${localstatedir}/log/ganeti" \
461 "$(DESTDIR)${localstatedir}/run/ganeti"
463 stamp-directories: Makefile
468 apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
469 test -e doc/api || mkdir doc/api
470 $(RUN_IN_TEMPDIR) epydoc -v \
471 --conf $(CURDIR)/epydoc.conf \
472 --output $(CURDIR)/doc/api
477 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
478 -path 'daemons/ganeti-*' -o -path 'tools/*' | \