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 = \
50 maintainer-clean-local:
51 -rm -rf doc/api doc/build doc/html
54 autotools/replace_vars.sed \
55 daemons/ganeti-cleaner \
57 doc/examples/bash_completion \
58 doc/examples/ganeti.initd \
59 doc/examples/ganeti.cron \
60 doc/examples/hooks/ipsec \
64 lib/hypervisor/*.py[co] \
71 $(nodist_pkgpython_PYTHON)
78 nodist_pkgpython_PYTHON = \
86 lib/asyncnotifier.py \
111 hypervisor_PYTHON = \
112 lib/hypervisor/__init__.py \
113 lib/hypervisor/hv_base.py \
114 lib/hypervisor/hv_chroot.py \
115 lib/hypervisor/hv_fake.py \
116 lib/hypervisor/hv_kvm.py \
117 lib/hypervisor/hv_xen.py
120 lib/rapi/__init__.py \
121 lib/rapi/baserlib.py \
122 lib/rapi/connector.py \
126 lib/http/__init__.py \
132 lib/confd/__init__.py \
133 lib/confd/client.py \
134 lib/confd/server.py \
135 lib/confd/querylib.py
151 doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
152 @test -n "$(SPHINX)" || \
153 { echo 'sphinx-build' not found during configure; exit 1; }
154 mkdir -p doc/build/doctrees
155 PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
156 -d doc/build/doctrees \
157 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
158 -D release="$(PACKAGE_VERSION)" \
159 $(top_srcdir)/doc doc/html
164 doc/design-2.1-lock-acquire.dot \
165 doc/design-2.1-lock-release.dot
167 docpng = $(patsubst %.dot,%.png,$(docdot))
169 noinst_DATA = $(manhtml) doc/html
173 scripts/gnt-cluster \
175 scripts/gnt-instance \
180 dist_sbin_SCRIPTS = \
181 daemons/ganeti-noded \
182 daemons/ganeti-watcher \
183 daemons/ganeti-masterd \
184 daemons/ganeti-confd \
185 daemons/ganeti-rapi \
188 nodist_sbin_SCRIPTS = \
189 daemons/ganeti-cleaner
191 dist_tools_SCRIPTS = \
198 $(MAINTAINERCLEANFILES) \
201 autotools/build-bash-completion \
202 autotools/check-python-code \
203 autotools/docbook-wrapper \
204 autotools/run-in-tempdir \
205 daemons/ganeti-cleaner.in \
211 doc/examples/ganeti.initd.in \
212 doc/examples/ganeti.cron.in \
213 doc/examples/dumb-allocator \
214 doc/examples/hooks/ethers \
215 doc/examples/hooks/ipsec.in \
221 $(mansgml) $(maninput) \
238 man/ganeti-cleaner.8 \
239 man/ganeti-masterd.8 \
241 man/ganeti-os-interface.7 \
243 man/ganeti-watcher.8 \
252 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
253 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
254 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
257 test/data/bdev-both.txt \
258 test/data/bdev-8.3-both.txt \
259 test/data/bdev-disk.txt \
260 test/data/bdev-net.txt \
261 test/data/proc_drbd8.txt \
262 test/data/proc_drbd80-emptyline.txt \
263 test/data/proc_drbd83.txt
266 test/ganeti.bdev_unittest.py \
267 test/ganeti.cli_unittest.py \
268 test/ganeti.cmdlib_unittest.py \
269 test/ganeti.confd_client_unittest.py \
270 test/ganeti.config_unittest.py \
271 test/ganeti.constants_unittest.py \
272 test/ganeti.hooks_unittest.py \
273 test/ganeti.http_unittest.py \
274 test/ganeti.locking_unittest.py \
275 test/ganeti.objects_unittest.py \
276 test/ganeti.rapi.resources_unittest.py \
277 test/ganeti.serializer_unittest.py \
278 test/ganeti.ssh_unittest.py \
279 test/ganeti.utils_unittest.py \
280 test/ganeti.workerpool_unittest.py \
281 test/docs_unittest.py
285 TESTS = $(dist_TESTS) $(nodist_TESTS)
287 TESTS_ENVIRONMENT = \
288 PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
289 $(RUN_IN_TEMPDIR) $(PYTHON)
292 $(dist_sbin_SCRIPTS) \
293 $(dist_tools_SCRIPTS) \
295 $(pkgpython_PYTHON) \
296 $(hypervisor_PYTHON) \
306 check_python_code = \
309 all-local: stamp-directories devel/upload \
310 doc/examples/bash_completion \
311 doc/examples/ganeti.initd doc/examples/ganeti.cron \
312 doc/examples/hooks/ipsec
314 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
315 sed -f $(REPLACE_VARS_SED) < $< > $@
318 daemons/ganeti-cleaner: daemons/ganeti-cleaner.in stamp-directories \
320 sed -f $(REPLACE_VARS_SED) < $< > $@
323 doc/examples/%: doc/examples/%.in stamp-directories \
325 sed -f $(REPLACE_VARS_SED) < $< > $@
327 doc/examples/hooks/%: doc/examples/hooks/%.in stamp-directories \
329 sed -f $(REPLACE_VARS_SED) < $< > $@
331 doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
332 lib/cli.py $(gnt_scripts) tools/burnin
333 PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@
336 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
337 $(DOT) -Tpng -o $@ $<
339 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
340 @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; }
341 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
343 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
344 @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
345 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
347 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
348 sed -f $(REPLACE_VARS_SED) < $< > $@
350 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
351 sed -f $(REPLACE_VARS_SED) < $< > $@
353 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
354 sed -f $(REPLACE_VARS_SED) < $< > $@
356 lib/_autoconf.py: Makefile stamp-directories
358 { echo '# This file is automatically generated, do not edit!'; \
361 echo '"""Build-time configuration for Ganeti.'; \
363 echo 'This file is autogenerated by the build process.'; \
364 echo 'For any changes you need to re-run ./configure (and'; \
365 echo 'not edit by hand).'; \
369 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
370 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
371 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
372 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
373 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
374 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
375 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
376 echo "SYSCONFDIR = '$(sysconfdir)'"; \
377 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
378 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
379 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
380 echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
381 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
382 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
383 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
384 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
385 echo "KVM_PATH = '$(KVM_PATH)'"; \
386 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
387 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
388 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
389 echo "TOOLSDIR = '$(toolsdir)'"; \
390 echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
393 $(REPLACE_VARS_SED): Makefile stamp-directories
395 { echo 's#@PREFIX@#$(prefix)#g'; \
396 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
397 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
398 echo 's#@BINDIR@#$(bindir)#g'; \
399 echo 's#@SBINDIR@#$(sbindir)#g'; \
400 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
401 echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
402 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
403 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
404 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
405 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
408 # We need to create symlinks because "make distcheck" will not install Python
409 # files when building.
410 srclinks: stamp-directories
412 for i in $(srclink_files); do \
413 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
414 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
420 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
423 $(CHECK_PYTHON_CODE) $(check_python_code)
425 # a dist hook rule for catching revision control directories
427 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
428 echo "Found revision control files in final archive" 1>&2 ; \
433 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
434 "$(DESTDIR)${localstatedir}/log/ganeti" \
435 "$(DESTDIR)${localstatedir}/run/ganeti"
437 stamp-directories: Makefile
442 apidoc: epydoc.conf $(RUN_IN_TEMPDIR)
443 test -e doc/api || mkdir doc/api
444 $(RUN_IN_TEMPDIR) epydoc -v \
445 --conf $(CURDIR)/epydoc.conf \
446 --output $(CURDIR)/doc/api
451 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
452 -path 'daemons/ganeti-*' -o -path 'tools/*' | \