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] \
59 $(nodist_pkgpython_PYTHON)
61 nodist_pkgpython_PYTHON = \
90 lib/hypervisor/__init__.py \
91 lib/hypervisor/hv_base.py \
92 lib/hypervisor/hv_fake.py \
93 lib/hypervisor/hv_kvm.py \
94 lib/hypervisor/hv_xen.py
97 lib/rapi/__init__.py \
98 lib/rapi/baserlib.py \
99 lib/rapi/connector.py \
103 lib/http/__init__.py \
124 $(patsubst %.rst,%.html,$(docrst)) \
125 $(patsubst %.sgml,%.html,$(docsgml)) \
126 $(patsubst %.sgml,%.pdf,$(docsgml))
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 = \
150 autotools/docbook-wrapper \
155 doc/build-rapi-resources-doc \
156 doc/examples/ganeti.initd.in \
157 doc/examples/ganeti.cron.in \
158 doc/examples/dumb-allocator \
183 man/ganeti-os-interface.7 \
184 man/ganeti-watcher.8 \
191 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
192 mansgml = $(patsubst %.in,%.sgml,$(maninput))
195 test/data/bdev-both.txt \
196 test/data/bdev-disk.txt \
197 test/data/bdev-net.txt \
198 test/data/proc_drbd8.txt
201 test/ganeti.bdev_unittest.py \
202 test/ganeti.cli_unittest.py \
203 test/ganeti.cmdlib_unittest.py \
204 test/ganeti.config_unittest.py \
205 test/ganeti.constants_unittest.py \
206 test/ganeti.hooks_unittest.py \
207 test/ganeti.http_unittest.py \
208 test/ganeti.locking_unittest.py \
209 test/ganeti.rapi.resources_unittest.py \
210 test/ganeti.serializer_unittest.py \
211 test/ganeti.ssh_unittest.py \
212 test/ganeti.utils_unittest.py \
213 test/ganeti.workerpool_unittest.py
217 TESTS = $(dist_TESTS) $(nodist_TESTS)
219 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
222 all-local: stamp-directories lib/_autoconf.py devel/upload \
223 doc/examples/ganeti.initd doc/examples/ganeti.cron
225 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
226 sed -f $(REPLACE_VARS_SED) < $< > $@
229 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
231 sed -f $(REPLACE_VARS_SED) < $< > $@
233 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
234 sed -f $(REPLACE_VARS_SED) < $< > $@
236 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
237 sed -f $(REPLACE_VARS_SED) < $< > $@
239 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
240 $(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
242 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
243 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
245 doc/%.html: doc/%.rst
249 $(DOT) -Tpng -o $@ $<
251 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
253 doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
255 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
256 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
258 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
259 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
261 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
262 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
264 man/footer.sgml $(TESTS): srclinks
266 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
268 lib/_autoconf.py: Makefile stamp-directories
270 { echo '# This file is automatically generated, do not edit!'; \
273 echo '"""Build-time configuration for Ganeti.'; \
275 echo 'This file is autogenerated by the build process.'; \
276 echo 'For any changes you need to re-run ./configure (and'; \
277 echo 'not edit by hand).'; \
281 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
282 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
283 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
284 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
285 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
286 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
287 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
288 echo "SYSCONFDIR = '$(sysconfdir)'"; \
289 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
290 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
291 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
292 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
293 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
294 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
295 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
296 echo "KVM_PATH = '$(KVM_PATH)'"; \
297 echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
298 echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
301 $(REPLACE_VARS_SED): Makefile stamp-directories
303 { echo 's#@PREFIX@#$(prefix)#g'; \
304 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
305 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
306 echo 's#@SBINDIR@#$(sbindir)#g'; \
307 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
308 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
309 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
310 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
311 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
312 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
317 # We need to create symlinks because "make distcheck" will not install Python
318 # files when building.
320 srclinks: stamp-directories
322 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
323 $(rapi_PYTHON) $(http_PYTHON); do \
324 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
325 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
331 cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
333 # a dist hook rule for catching revision control directories
335 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
336 echo "Found revision control files in final archive" 1>&2 ; \
341 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
342 "$(DESTDIR)${localstatedir}/log/ganeti" \
343 "$(DESTDIR)${localstatedir}/run/ganeti"
345 stamp-directories: Makefile
351 test -e doc/api || mkdir doc/api
352 TMPDIR=`mktemp -d ` && { \
353 cp -r scripts daemons lib $$TMPDIR && \
358 epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \