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 REPLACE_VARS_SED = autotools/replace_vars.sed
16 hypervisordir = $(pkgpythondir)/hypervisor
17 httpdir = $(pkgpythondir)/http
18 confddir = $(pkgpythondir)/confd
19 rapidir = $(pkgpythondir)/rapi
20 toolsdir = $(pkglibdir)/tools
21 docdir = $(datadir)/doc/$(PACKAGE)
41 MAINTAINERCLEANFILES = \
45 maintainer-clean-local:
46 -rm -rf doc/api doc/build doc/html
49 autotools/replace_vars.sed \
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 = \
70 lib/asyncnotifier.py \
96 lib/hypervisor/__init__.py \
97 lib/hypervisor/hv_base.py \
98 lib/hypervisor/hv_chroot.py \
99 lib/hypervisor/hv_fake.py \
100 lib/hypervisor/hv_kvm.py \
101 lib/hypervisor/hv_xen.py
104 lib/rapi/__init__.py \
105 lib/rapi/baserlib.py \
106 lib/rapi/connector.py \
110 lib/http/__init__.py \
116 lib/confd/__init__.py
130 doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
131 @test -n "$(SPHINX)" || \
132 { echo 'sphinx-build' not found during configure; exit 1; }
133 mkdir -p doc/build/doctrees
134 PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
135 -d doc/build/doctrees \
136 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
137 -D release="$(PACKAGE_VERSION)" \
138 $(top_srcdir)/doc doc/html
144 docpng = $(patsubst %.dot,%.png,$(docdot))
146 noinst_DATA = $(manhtml) doc/html
148 dist_sbin_SCRIPTS = \
149 daemons/ganeti-noded \
150 daemons/ganeti-watcher \
151 daemons/ganeti-masterd \
152 daemons/ganeti-rapi \
154 scripts/gnt-cluster \
156 scripts/gnt-instance \
161 dist_tools_SCRIPTS = \
168 $(MAINTAINERCLEANFILES) \
172 autotools/docbook-wrapper \
178 doc/examples/bash_completion.in \
179 doc/examples/ganeti.initd.in \
180 doc/examples/ganeti.cron.in \
181 doc/examples/dumb-allocator \
188 $(mansgml) $(maninput) \
205 man/ganeti-masterd.8 \
207 man/ganeti-os-interface.7 \
209 man/ganeti-watcher.8 \
218 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
219 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
220 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
223 test/data/bdev-both.txt \
224 test/data/bdev-8.3-both.txt \
225 test/data/bdev-disk.txt \
226 test/data/bdev-net.txt \
227 test/data/proc_drbd8.txt \
228 test/data/proc_drbd83.txt
231 test/ganeti.bdev_unittest.py \
232 test/ganeti.cli_unittest.py \
233 test/ganeti.cmdlib_unittest.py \
234 test/ganeti.config_unittest.py \
235 test/ganeti.constants_unittest.py \
236 test/ganeti.hooks_unittest.py \
237 test/ganeti.http_unittest.py \
238 test/ganeti.locking_unittest.py \
239 test/ganeti.objects_unittest.py \
240 test/ganeti.rapi.resources_unittest.py \
241 test/ganeti.serializer_unittest.py \
242 test/ganeti.ssh_unittest.py \
243 test/ganeti.utils_unittest.py \
244 test/ganeti.workerpool_unittest.py
248 TESTS = $(dist_TESTS) $(nodist_TESTS)
250 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON)
252 all-local: stamp-directories lib/_autoconf.py devel/upload \
253 doc/examples/bash_completion \
254 doc/examples/ganeti.initd doc/examples/ganeti.cron
256 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
257 sed -f $(REPLACE_VARS_SED) < $< > $@
260 doc/examples/%: doc/examples/%.in stamp-directories \
262 sed -f $(REPLACE_VARS_SED) < $< > $@
265 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
266 $(DOT) -Tpng -o $@ $<
268 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
269 @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
270 TMPDIR=`mktemp -d` && { \
271 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
272 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
273 rm -rf "$$TMPDIR" ; \
276 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
277 @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
278 TMPDIR=`mktemp -d` && { \
279 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
280 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
281 rm -rf "$$TMPDIR" ; \
284 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
285 sed -f $(REPLACE_VARS_SED) < $< > $@
287 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
288 sed -f $(REPLACE_VARS_SED) < $< > $@
290 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
291 sed -f $(REPLACE_VARS_SED) < $< > $@
293 man/footer.sgml $(TESTS): srclinks
295 $(TESTS): ganeti lib/_autoconf.py
297 lib/_autoconf.py: Makefile stamp-directories
299 { echo '# This file is automatically generated, do not edit!'; \
302 echo '"""Build-time configuration for Ganeti.'; \
304 echo 'This file is autogenerated by the build process.'; \
305 echo 'For any changes you need to re-run ./configure (and'; \
306 echo 'not edit by hand).'; \
310 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
311 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
312 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
313 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
314 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
315 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
316 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
317 echo "SYSCONFDIR = '$(sysconfdir)'"; \
318 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
319 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
320 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
321 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
322 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
323 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
324 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
325 echo "KVM_PATH = '$(KVM_PATH)'"; \
326 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
327 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
328 echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)" ; \
331 $(REPLACE_VARS_SED): Makefile stamp-directories
333 { echo 's#@PREFIX@#$(prefix)#g'; \
334 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
335 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
336 echo 's#@SBINDIR@#$(sbindir)#g'; \
337 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
338 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
339 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
340 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
343 # We need to create symlinks because "make distcheck" will not install Python
344 # files when building.
346 srclinks: stamp-directories
348 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
349 $(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON); do \
350 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
351 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
357 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
359 # a dist hook rule for catching revision control directories
361 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
362 echo "Found revision control files in final archive" 1>&2 ; \
367 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
368 "$(DESTDIR)${localstatedir}/log/ganeti" \
369 "$(DESTDIR)${localstatedir}/run/ganeti"
371 stamp-directories: Makefile
377 test -e doc/api || mkdir doc/api
378 TMPDIR=`mktemp -d ` && { \
379 cp -r scripts daemons lib $$TMPDIR && \
384 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
392 find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \
393 -path 'daemons/ganeti-*' -o -path 'tools/*' | \