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)
41 MAINTAINERCLEANFILES = \
43 $(patsubst %.dot,%.png,$(docdot)) \
47 autotools/replace_vars.sed \
48 daemons/ganeti-cleaner \
50 doc/rapi-resources.gen \
51 doc/examples/bash_completion \
52 doc/examples/ganeti.initd \
53 doc/examples/ganeti.cron \
56 lib/hypervisor/*.py[co] \
63 $(nodist_pkgpython_PYTHON)
65 nodist_pkgpython_PYTHON = \
94 lib/hypervisor/__init__.py \
95 lib/hypervisor/hv_base.py \
96 lib/hypervisor/hv_fake.py \
97 lib/hypervisor/hv_kvm.py \
98 lib/hypervisor/hv_xen.py
101 lib/rapi/__init__.py \
102 lib/rapi/baserlib.py \
103 lib/rapi/connector.py \
107 lib/http/__init__.py \
121 dochtml = $(patsubst %.rst,%.html,$(docrst))
126 doc_DATA = $(dochtml)
128 noinst_DATA = $(manhtml)
130 dist_sbin_SCRIPTS = \
131 daemons/ganeti-noded \
132 daemons/ganeti-watcher \
133 daemons/ganeti-masterd \
134 daemons/ganeti-rapi \
136 scripts/gnt-cluster \
138 scripts/gnt-instance \
143 nodist_sbin_SCRIPTS = \
144 daemons/ganeti-cleaner
146 dist_tools_SCRIPTS = \
153 $(MAINTAINERCLEANFILES) \
157 autotools/docbook-wrapper \
158 daemons/ganeti-cleaner.in \
162 doc/build-rapi-resources-doc \
163 doc/examples/bash_completion.in \
164 doc/examples/ganeti.initd.in \
165 doc/examples/ganeti.cron.in \
166 doc/examples/dumb-allocator \
167 doc/examples/hooks/ethers \
174 $(mansgml) $(maninput) \
191 man/ganeti-masterd.8 \
193 man/ganeti-os-interface.7 \
195 man/ganeti-watcher.8 \
204 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
205 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
206 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
209 test/data/bdev-both.txt \
210 test/data/bdev-8.3-both.txt \
211 test/data/bdev-disk.txt \
212 test/data/bdev-net.txt \
213 test/data/proc_drbd8.txt \
214 test/data/proc_drbd80-emptyline.txt \
215 test/data/proc_drbd83.txt
218 test/ganeti.bdev_unittest.py \
219 test/ganeti.cli_unittest.py \
220 test/ganeti.cmdlib_unittest.py \
221 test/ganeti.config_unittest.py \
222 test/ganeti.constants_unittest.py \
223 test/ganeti.hooks_unittest.py \
224 test/ganeti.http_unittest.py \
225 test/ganeti.locking_unittest.py \
226 test/ganeti.rapi.resources_unittest.py \
227 test/ganeti.serializer_unittest.py \
228 test/ganeti.ssh_unittest.py \
229 test/ganeti.utils_unittest.py \
230 test/ganeti.workerpool_unittest.py
234 TESTS = $(dist_TESTS) $(nodist_TESTS)
236 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
238 RAPI_RESOURCES = $(wildcard lib/rapi/*.py)
240 all-local: stamp-directories lib/_autoconf.py devel/upload \
241 doc/examples/bash_completion \
242 doc/examples/ganeti.initd doc/examples/ganeti.cron
244 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
245 sed -f $(REPLACE_VARS_SED) < $< > $@
248 doc/examples/%: doc/examples/%.in stamp-directories \
250 sed -f $(REPLACE_VARS_SED) < $< > $@
252 daemons/ganeti-cleaner: daemons/ganeti-cleaner.in stamp-directories \
254 sed -f $(REPLACE_VARS_SED) < $< > $@
257 doc/%.html: doc/%.rst
258 @test -n "$(RST2HTML)" || { echo 'rst2html' not found during configure; exit 1; }
262 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
263 $(DOT) -Tpng -o $@ $<
265 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
267 doc/rapi.html: doc/rapi-resources.gen
269 doc/rapi-resources.gen: $(BUILD_RAPI_RESOURCE_DOC) $(RAPI_RESOURCES)
270 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || \
273 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
274 @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
275 TMPDIR=`mktemp -d` && { \
276 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
277 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
278 rm -rf "$$TMPDIR" ; \
281 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
282 @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
283 TMPDIR=`mktemp -d` && { \
284 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
285 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
286 rm -rf "$$TMPDIR" ; \
289 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
290 sed -f $(REPLACE_VARS_SED) < $< > $@
292 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
293 sed -f $(REPLACE_VARS_SED) < $< > $@
295 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
296 sed -f $(REPLACE_VARS_SED) < $< > $@
298 man/footer.sgml $(TESTS): srclinks
300 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
302 lib/_autoconf.py: Makefile stamp-directories
304 { echo '# This file is automatically generated, do not edit!'; \
307 echo '"""Build-time configuration for Ganeti.'; \
309 echo 'This file is autogenerated by the build process.'; \
310 echo 'For any changes you need to re-run ./configure (and'; \
311 echo 'not edit by hand).'; \
315 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
316 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
317 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
318 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
319 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
320 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
321 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
322 echo "SYSCONFDIR = '$(sysconfdir)'"; \
323 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
324 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
325 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
326 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
327 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
328 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
329 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
330 echo "KVM_PATH = '$(KVM_PATH)'"; \
331 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
332 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
333 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)" ; \
336 $(REPLACE_VARS_SED): Makefile stamp-directories
338 { echo 's#@PREFIX@#$(prefix)#g'; \
339 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
340 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
341 echo 's#@SBINDIR@#$(sbindir)#g'; \
342 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
343 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
344 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
345 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
346 echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \
349 # We need to create symlinks because "make distcheck" will not install Python
350 # files when building.
352 srclinks: stamp-directories
354 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
355 $(rapi_PYTHON) $(http_PYTHON); do \
356 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
357 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
363 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
365 # a dist hook rule for catching revision control directories
367 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
368 echo "Found revision control files in final archive" 1>&2 ; \
373 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
374 "$(DESTDIR)${localstatedir}/log/ganeti" \
375 "$(DESTDIR)${localstatedir}/run/ganeti"
377 stamp-directories: Makefile
383 test -e doc/api || mkdir doc/api
384 TMPDIR=`mktemp -d ` && { \
385 cp -r scripts daemons lib $$TMPDIR && \
390 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \