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 rapidir = $(pkgpythondir)/rapi
19 toolsdir = $(pkglibdir)/tools
20 docdir = $(datadir)/doc/$(PACKAGE)
39 MAINTAINERCLEANFILES = \
43 maintainer-clean-local:
44 -rm -rf doc/api doc/build doc/html
47 autotools/replace_vars.sed \
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 \
121 doc/html: $(docrst) $(docpng) doc/conf.py configure.ac
122 @test -n "$(SPHINX)" || \
123 { echo 'sphinx-build' not found during configure; exit 1; }
124 mkdir -p doc/build/doctrees
125 PYTHONPATH=.:$(top_builddir) sphinx-build -q -b html \
126 -d doc/build/doctrees \
127 -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
128 -D release="$(PACKAGE_VERSION)" \
129 $(top_srcdir)/doc doc/html
135 docpng = $(patsubst %.dot,%.png,$(docdot))
137 noinst_DATA = $(manhtml) doc/html
139 dist_sbin_SCRIPTS = \
140 daemons/ganeti-noded \
141 daemons/ganeti-watcher \
142 daemons/ganeti-masterd \
143 daemons/ganeti-rapi \
145 scripts/gnt-cluster \
147 scripts/gnt-instance \
152 dist_tools_SCRIPTS = \
159 $(MAINTAINERCLEANFILES) \
162 autotools/docbook-wrapper \
168 doc/examples/bash_completion.in \
169 doc/examples/ganeti.initd.in \
170 doc/examples/ganeti.cron.in \
171 doc/examples/dumb-allocator \
178 $(mansgml) $(maninput) \
195 man/ganeti-masterd.8 \
197 man/ganeti-os-interface.7 \
199 man/ganeti-watcher.8 \
208 mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS)))
209 manhtml = $(patsubst %.sgml,%.html,$(mansgml))
210 maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml))
213 test/data/bdev-both.txt \
214 test/data/bdev-disk.txt \
215 test/data/bdev-net.txt \
216 test/data/proc_drbd8.txt
219 test/ganeti.bdev_unittest.py \
220 test/ganeti.cli_unittest.py \
221 test/ganeti.cmdlib_unittest.py \
222 test/ganeti.config_unittest.py \
223 test/ganeti.constants_unittest.py \
224 test/ganeti.hooks_unittest.py \
225 test/ganeti.http_unittest.py \
226 test/ganeti.locking_unittest.py \
227 test/ganeti.rapi.resources_unittest.py \
228 test/ganeti.serializer_unittest.py \
229 test/ganeti.ssh_unittest.py \
230 test/ganeti.utils_unittest.py \
231 test/ganeti.workerpool_unittest.py
235 TESTS = $(dist_TESTS) $(nodist_TESTS)
237 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
239 all-local: stamp-directories lib/_autoconf.py devel/upload \
240 doc/examples/bash_completion \
241 doc/examples/ganeti.initd doc/examples/ganeti.cron
243 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
244 sed -f $(REPLACE_VARS_SED) < $< > $@
247 doc/examples/%: doc/examples/%.in stamp-directories \
249 sed -f $(REPLACE_VARS_SED) < $< > $@
252 @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
253 $(DOT) -Tpng -o $@ $<
255 man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
256 @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2html' not found during configure; exit 1; }
257 TMPDIR=`mktemp -d` && { \
258 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
259 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
260 rm -rf "$$TMPDIR" ; \
263 man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
264 @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
265 TMPDIR=`mktemp -d` && { \
266 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
267 mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
268 rm -rf "$$TMPDIR" ; \
271 man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
272 sed -f $(REPLACE_VARS_SED) < $< > $@
274 man/%.8: man/%.8.in stamp-directories $(REPLACE_VARS_SED)
275 sed -f $(REPLACE_VARS_SED) < $< > $@
277 man/%.html: man/%.html.in stamp-directories $(REPLACE_VARS_SED)
278 sed -f $(REPLACE_VARS_SED) < $< > $@
280 man/footer.sgml $(TESTS): srclinks
282 $(TESTS): ganeti lib/_autoconf.py
284 lib/_autoconf.py: Makefile stamp-directories
286 { echo '# This file is automatically generated, do not edit!'; \
289 echo '"""Build-time configuration for Ganeti.'; \
291 echo 'This file is autogenerated by the build process.'; \
292 echo 'For any changes you need to re-run ./configure (and'; \
293 echo 'not edit by hand).'; \
297 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
298 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
299 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
300 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
301 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
302 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
303 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
304 echo "SYSCONFDIR = '$(sysconfdir)'"; \
305 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
306 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
307 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
308 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
309 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
310 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
311 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
312 echo "KVM_PATH = '$(KVM_PATH)'"; \
313 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
314 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
317 $(REPLACE_VARS_SED): Makefile stamp-directories
319 { echo 's#@PREFIX@#$(prefix)#g'; \
320 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
321 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
322 echo 's#@SBINDIR@#$(sbindir)#g'; \
323 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
324 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
325 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
326 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
329 # We need to create symlinks because "make distcheck" will not install Python
330 # files when building.
332 srclinks: stamp-directories
334 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
335 $(rapi_PYTHON) $(http_PYTHON); do \
336 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
337 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
343 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
345 # a dist hook rule for catching revision control directories
347 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
348 echo "Found revision control files in final archive" 1>&2 ; \
353 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
354 "$(DESTDIR)${localstatedir}/log/ganeti" \
355 "$(DESTDIR)${localstatedir}/run/ganeti"
357 stamp-directories: Makefile
363 test -e doc/api || mkdir doc/api
364 TMPDIR=`mktemp -d ` && { \
365 cp -r scripts daemons lib $$TMPDIR && \
370 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \