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 rapidir = $(pkgpythondir)/rapi
19 toolsdir = $(pkglibdir)/tools
20 docdir = $(datadir)/doc/$(PACKAGE)
39 autotools/replace_vars.sed \
44 doc/rapi-resources.sgml \
45 doc/examples/ganeti.initd \
46 doc/examples/ganeti.cron \
48 lib/hypervisor/*.py[co] \
55 $(nodist_pkgpython_PYTHON)
57 nodist_pkgpython_PYTHON = \
87 lib/hypervisor/__init__.py \
88 lib/hypervisor/hv_base.py \
89 lib/hypervisor/hv_fake.py \
90 lib/hypervisor/hv_kvm.py \
91 lib/hypervisor/hv_xen.py
94 lib/rapi/__init__.py \
95 lib/rapi/httperror.py \
96 lib/rapi/baserlib.py \
97 lib/rapi/connector.py \
110 doc/design-2.0-commandline-parameters.rst \
111 doc/design-2.0-disk-handling.rst \
112 doc/design-2.0-index.rst \
113 doc/design-2.0-job-queue.rst \
114 doc/design-2.0-locking.rst \
115 doc/design-2.0-master-daemon.rst \
116 doc/design-2.0-rapi-changes.rst
119 $(patsubst %.rst,%.html,$(docrst)) \
120 $(patsubst %.sgml,%.html,$(docsgml)) \
121 $(patsubst %.sgml,%.pdf,$(docsgml))
123 dist_sbin_SCRIPTS = \
124 daemons/ganeti-noded \
125 daemons/ganeti-watcher \
126 daemons/ganeti-masterd \
127 daemons/ganeti-rapi \
129 scripts/gnt-cluster \
131 scripts/gnt-instance \
136 dist_tools_SCRIPTS = \
145 autotools/docbook-wrapper \
149 doc/build-rapi-resources-doc \
150 doc/examples/ganeti.initd.in \
151 doc/examples/ganeti.cron.in \
152 doc/examples/dumb-allocator \
177 man/ganeti-os-interface.7 \
178 man/ganeti-watcher.8 \
185 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
186 mansgml = $(patsubst %.in,%.sgml,$(maninput))
189 test/data/bdev-both.txt \
190 test/data/bdev-disk.txt \
191 test/data/bdev-net.txt \
192 test/data/proc_drbd8.txt
195 test/ganeti.config_unittest.py \
196 test/ganeti.hooks_unittest.py \
197 test/ganeti.utils_unittest.py \
198 test/ganeti.bdev_unittest.py \
199 test/ganeti.ssh_unittest.py \
200 test/ganeti.locking_unittest.py \
201 test/ganeti.serializer_unittest.py \
202 test/ganeti.workerpool_unittest.py \
203 test/ganeti.rapi.resources_unittest.py \
204 test/ganeti.http_unittest.py \
205 test/ganeti.constants_unittest.py
209 TESTS = $(dist_TESTS) $(nodist_TESTS)
211 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
214 all-local: stamp-directories lib/_autoconf.py devel/upload \
215 doc/examples/ganeti.initd doc/examples/ganeti.cron
217 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
218 sed -f $(REPLACE_VARS_SED) < $< > $@
221 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
223 sed -f $(REPLACE_VARS_SED) < $< > $@
225 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
226 sed -f $(REPLACE_VARS_SED) < $< > $@
228 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
229 sed -f $(REPLACE_VARS_SED) < $< > $@
231 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
232 $(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
234 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
235 $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
237 doc/%.html: doc/%.rst
240 doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
242 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
243 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
245 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
246 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
248 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
249 $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
251 man/footer.sgml $(TESTS): srclinks
253 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
255 lib/_autoconf.py: Makefile stamp-directories
257 { echo '# This file is automatically generated, do not edit!'; \
259 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
260 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
261 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
262 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
263 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
264 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
265 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
266 echo "SYSCONFDIR = '$(sysconfdir)'"; \
267 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
268 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
269 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
270 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
271 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
272 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
273 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
274 echo "KVM_PATH = '$(KVM_PATH)'"; \
277 $(REPLACE_VARS_SED): Makefile stamp-directories
279 { echo 's#@PREFIX@#$(prefix)#g'; \
280 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
281 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
282 echo 's#@SBINDIR@#$(sbindir)#g'; \
283 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
284 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
285 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
286 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
287 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
288 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
293 # We need to create symlinks because "make distcheck" will not install Python
294 # files when building.
296 srclinks: stamp-directories
298 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
299 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
300 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
306 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
308 # a dist hook rule for catching revision control directories
310 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
311 echo "Found revision control files in final archive" 1>&2 ; \
316 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
317 "$(DESTDIR)${localstatedir}/log/ganeti" \
318 "$(DESTDIR)${localstatedir}/run/ganeti"
320 stamp-directories: Makefile
326 test -e doc/api || mkdir doc/api
327 TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
328 cp -r scripts daemons lib $$TMPDIR && \
332 epydoc --conf ../epydoc.conf \