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 autotools/replace_vars.sed \
46 $(patsubst %.dot,%.png,$(docdot)) \
47 doc/rapi-resources.sgml \
48 doc/examples/ganeti.initd \
49 doc/examples/ganeti.cron \
52 lib/hypervisor/*.py[co] \
60 $(nodist_pkgpython_PYTHON)
62 nodist_pkgpython_PYTHON = \
91 lib/hypervisor/__init__.py \
92 lib/hypervisor/hv_base.py \
93 lib/hypervisor/hv_fake.py \
94 lib/hypervisor/hv_kvm.py \
95 lib/hypervisor/hv_xen.py
98 lib/rapi/__init__.py \
99 lib/rapi/baserlib.py \
100 lib/rapi/connector.py \
104 lib/http/__init__.py \
125 $(patsubst %.rst,%.html,$(docrst)) \
126 $(patsubst %.sgml,%.html,$(docsgml)) \
127 $(patsubst %.sgml,%.pdf,$(docsgml))
129 noinst_DATA = $(manhtml)
131 dist_sbin_SCRIPTS = \
132 daemons/ganeti-noded \
133 daemons/ganeti-watcher \
134 daemons/ganeti-masterd \
135 daemons/ganeti-rapi \
137 scripts/gnt-cluster \
139 scripts/gnt-instance \
144 dist_tools_SCRIPTS = \
153 autotools/docbook-wrapper \
158 doc/build-rapi-resources-doc \
159 doc/examples/ganeti.initd.in \
160 doc/examples/ganeti.cron.in \
161 doc/examples/dumb-allocator \
185 man/ganeti-masterd.8 \
187 man/ganeti-os-interface.7 \
189 man/ganeti-watcher.8 \
198 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
199 mansgml = $(patsubst %.in,%.sgml,$(maninput))
200 manhtml = $(patsubst %.in,%.html,$(maninput))
203 test/data/bdev-both.txt \
204 test/data/bdev-disk.txt \
205 test/data/bdev-net.txt \
206 test/data/proc_drbd8.txt
209 test/ganeti.bdev_unittest.py \
210 test/ganeti.cli_unittest.py \
211 test/ganeti.cmdlib_unittest.py \
212 test/ganeti.config_unittest.py \
213 test/ganeti.constants_unittest.py \
214 test/ganeti.hooks_unittest.py \
215 test/ganeti.http_unittest.py \
216 test/ganeti.locking_unittest.py \
217 test/ganeti.rapi.resources_unittest.py \
218 test/ganeti.serializer_unittest.py \
219 test/ganeti.ssh_unittest.py \
220 test/ganeti.utils_unittest.py \
221 test/ganeti.workerpool_unittest.py
225 TESTS = $(dist_TESTS) $(nodist_TESTS)
227 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
230 all-local: stamp-directories lib/_autoconf.py devel/upload \
231 doc/examples/ganeti.initd doc/examples/ganeti.cron
233 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
234 sed -f $(REPLACE_VARS_SED) < $< > $@
237 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
239 sed -f $(REPLACE_VARS_SED) < $< > $@
241 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
242 sed -f $(REPLACE_VARS_SED) < $< > $@
244 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
245 sed -f $(REPLACE_VARS_SED) < $< > $@
247 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
248 $(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
250 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
251 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
253 doc/%.html: doc/%.rst
257 $(DOT) -Tpng -o $@ $<
259 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
261 doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
263 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
264 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
266 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
267 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
269 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
270 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
272 man/%.html: man/%.in $(DOCBOOK_WRAPPER)
273 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
275 man/footer.sgml $(TESTS): srclinks
277 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
279 lib/_autoconf.py: Makefile stamp-directories
281 { echo '# This file is automatically generated, do not edit!'; \
284 echo '"""Build-time configuration for Ganeti.'; \
286 echo 'This file is autogenerated by the build process.'; \
287 echo 'For any changes you need to re-run ./configure (and'; \
288 echo 'not edit by hand).'; \
292 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
293 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
294 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
295 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
296 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
297 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
298 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
299 echo "SYSCONFDIR = '$(sysconfdir)'"; \
300 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
301 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
302 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
303 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
304 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
305 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
306 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
307 echo "KVM_PATH = '$(KVM_PATH)'"; \
308 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
309 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
312 $(REPLACE_VARS_SED): Makefile stamp-directories
314 { echo 's#@PREFIX@#$(prefix)#g'; \
315 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
316 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
317 echo 's#@SBINDIR@#$(sbindir)#g'; \
318 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
319 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
320 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
321 echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
322 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
323 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
328 # We need to create symlinks because "make distcheck" will not install Python
329 # files when building.
331 srclinks: stamp-directories
333 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
334 $(rapi_PYTHON) $(http_PYTHON); do \
335 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
336 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
342 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
344 # a dist hook rule for catching revision control directories
346 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
347 echo "Found revision control files in final archive" 1>&2 ; \
352 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
353 "$(DESTDIR)${localstatedir}/log/ganeti" \
354 "$(DESTDIR)${localstatedir}/run/ganeti"
356 stamp-directories: Makefile
362 test -e doc/api || mkdir doc/api
363 TMPDIR=`mktemp -d ` && { \
364 cp -r scripts daemons lib $$TMPDIR && \
369 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \