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_RAPI_RESOURCE_DOC = $(top_srcdir)/doc/build-rapi-resources-doc
15 REPLACE_VARS_SED = autotools/replace_vars.sed
17 hypervisordir = $(pkgpythondir)/hypervisor
18 httpdir = $(pkgpythondir)/http
19 rapidir = $(pkgpythondir)/rapi
20 toolsdir = $(pkglibdir)/tools
21 docdir = $(datadir)/doc/$(PACKAGE)
40 MAINTAINERCLEANFILES = \
42 $(patsubst %.dot,%.png,$(docdot)) \
46 autotools/replace_vars.sed \
48 doc/rapi-resources.gen \
49 doc/examples/bash_completion \
50 doc/examples/ganeti.initd \
51 doc/examples/ganeti.cron \
54 lib/hypervisor/*.py[co] \
61 $(nodist_pkgpython_PYTHON)
63 nodist_pkgpython_PYTHON = \
92 lib/hypervisor/__init__.py \
93 lib/hypervisor/hv_base.py \
94 lib/hypervisor/hv_fake.py \
95 lib/hypervisor/hv_kvm.py \
96 lib/hypervisor/hv_xen.py
99 lib/rapi/__init__.py \
100 lib/rapi/baserlib.py \
101 lib/rapi/connector.py \
105 lib/http/__init__.py \
119 dochtml = $(patsubst %.rst,%.html,$(docrst))
124 doc_DATA = $(dochtml)
126 noinst_DATA = $(manhtml)
128 dist_sbin_SCRIPTS = \
129 daemons/ganeti-noded \
130 daemons/ganeti-watcher \
131 daemons/ganeti-masterd \
132 daemons/ganeti-rapi \
134 scripts/gnt-cluster \
136 scripts/gnt-instance \
141 dist_tools_SCRIPTS = \
148 $(MAINTAINERCLEANFILES) \
152 autotools/docbook-wrapper \
156 doc/build-rapi-resources-doc \
157 doc/examples/bash_completion.in \
158 doc/examples/ganeti.initd.in \
159 doc/examples/ganeti.cron.in \
160 doc/examples/dumb-allocator \
167 $(mansgml) $(maninput) \
184 man/ganeti-masterd.8 \
186 man/ganeti-os-interface.7 \
188 man/ganeti-watcher.8 \
197 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
198 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
199 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
202 test/data/bdev-both.txt \
203 test/data/bdev-8.3-both.txt \
204 test/data/bdev-disk.txt \
205 test/data/bdev-net.txt \
206 test/data/proc_drbd8.txt \
207 test/data/proc_drbd83.txt
210 test/ganeti.bdev_unittest.py \
211 test/ganeti.cli_unittest.py \
212 test/ganeti.cmdlib_unittest.py \
213 test/ganeti.config_unittest.py \
214 test/ganeti.constants_unittest.py \
215 test/ganeti.hooks_unittest.py \
216 test/ganeti.http_unittest.py \
217 test/ganeti.locking_unittest.py \
218 test/ganeti.rapi.resources_unittest.py \
219 test/ganeti.serializer_unittest.py \
220 test/ganeti.ssh_unittest.py \
221 test/ganeti.utils_unittest.py \
222 test/ganeti.workerpool_unittest.py
226 TESTS = $(dist_TESTS) $(nodist_TESTS)
228 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
230 RAPI_RESOURCES = $(wildcard lib/rapi/*.py)
232 all-local: stamp-directories lib/_autoconf.py devel/upload \
233 doc/examples/bash_completion \
234 doc/examples/ganeti.initd doc/examples/ganeti.cron
236 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
237 sed -f $(REPLACE_VARS_SED) < $< > $@
240 doc/examples/%: doc/examples/%.in stamp-directories \
242 sed -f $(REPLACE_VARS_SED) < $< > $@
244 doc/%.html: doc/%.rst
245 @test -n "$(RST2HTML)" || { echo 'rst2html' not found during configure; exit 1; }
249 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
250 $(DOT) -Tpng -o $@ $<
252 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
254 doc/rapi.html: doc/rapi-resources.gen
256 doc/rapi-resources.gen: $(BUILD_RAPI_RESOURCE_DOC) $(RAPI_RESOURCES)
257 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || \
260 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
261 @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
262 TMPDIR=`mktemp -d` && { \
263 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
264 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
265 rm -rf "$$TMPDIR" ; \
268 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
269 @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
270 TMPDIR=`mktemp -d` && { \
271 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
272 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
273 rm -rf "$$TMPDIR" ; \
276 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
277 sed -f $(REPLACE_VARS_SED) < $< > $@
279 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
280 sed -f $(REPLACE_VARS_SED) < $< > $@
282 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
283 sed -f $(REPLACE_VARS_SED) < $< > $@
285 man/footer.sgml $(TESTS): srclinks
287 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
289 lib/_autoconf.py: Makefile stamp-directories
291 { echo '# This file is automatically generated, do not edit!'; \
294 echo '"""Build-time configuration for Ganeti.'; \
296 echo 'This file is autogenerated by the build process.'; \
297 echo 'For any changes you need to re-run ./configure (and'; \
298 echo 'not edit by hand).'; \
302 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
303 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
304 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
305 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
306 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
307 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
308 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
309 echo "SYSCONFDIR = '$(sysconfdir)'"; \
310 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
311 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
312 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
313 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
314 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
315 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
316 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
317 echo "KVM_PATH = '$(KVM_PATH)'"; \
318 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
319 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
320 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)" ; \
323 $(REPLACE_VARS_SED): Makefile stamp-directories
325 { echo 's#@PREFIX@#$(prefix)#g'; \
326 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
327 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
328 echo 's#@SBINDIR@#$(sbindir)#g'; \
329 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
330 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
331 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
332 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
333 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
336 # We need to create symlinks because "make distcheck" will not install Python
337 # files when building.
339 srclinks: stamp-directories
341 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
342 $(rapi_PYTHON) $(http_PYTHON); do \
343 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
344 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
350 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
352 # a dist hook rule for catching revision control directories
354 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
355 echo "Found revision control files in final archive" 1>&2 ; \
360 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
361 "$(DESTDIR)${localstatedir}/log/ganeti" \
362 "$(DESTDIR)${localstatedir}/run/ganeti"
364 stamp-directories: Makefile
370 test -e doc/api || mkdir doc/api
371 TMPDIR=`mktemp -d ` && { \
372 cp -r scripts daemons lib $$TMPDIR && \
377 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \