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 $(patsubst %.sgml,%.html,$(docsgml)) \
111 $(patsubst %.sgml,%.pdf,$(docsgml))
113 dist_sbin_SCRIPTS = \
114 daemons/ganeti-noded \
115 daemons/ganeti-watcher \
116 daemons/ganeti-masterd \
117 daemons/ganeti-rapi \
119 scripts/gnt-cluster \
121 scripts/gnt-instance \
126 dist_tools_SCRIPTS = \
135 autotools/docbook-wrapper \
138 doc/build-rapi-resources-doc \
139 doc/examples/ganeti.initd.in \
140 doc/examples/ganeti.cron.in \
141 doc/examples/dumb-allocator \
166 man/ganeti-os-interface.7 \
167 man/ganeti-watcher.8 \
174 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
175 mansgml = $(patsubst %.in,%.sgml,$(maninput))
178 test/data/bdev-both.txt \
179 test/data/bdev-disk.txt \
180 test/data/bdev-net.txt \
181 test/data/proc_drbd8.txt
184 test/ganeti.config_unittest.py \
185 test/ganeti.hooks_unittest.py \
186 test/ganeti.utils_unittest.py \
187 test/ganeti.bdev_unittest.py \
188 test/ganeti.ssh_unittest.py \
189 test/ganeti.locking_unittest.py \
190 test/ganeti.serializer_unittest.py \
191 test/ganeti.workerpool_unittest.py \
192 test/ganeti.rapi.resources_unittest.py \
193 test/ganeti.http_unittest.py \
194 test/ganeti.constants_unittest.py
198 TESTS = $(dist_TESTS) $(nodist_TESTS)
200 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
203 all-local: stamp-directories lib/_autoconf.py devel/upload \
204 doc/examples/ganeti.initd doc/examples/ganeti.cron
206 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
207 sed -f $(REPLACE_VARS_SED) < $< > $@
210 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
212 sed -f $(REPLACE_VARS_SED) < $< > $@
214 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
215 sed -f $(REPLACE_VARS_SED) < $< > $@
217 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
218 sed -f $(REPLACE_VARS_SED) < $< > $@
220 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
221 $(DOCBOOK_WRAPPER) $< $@
223 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
224 $(DOCBOOK_WRAPPER) $< $@
226 doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
228 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
229 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
231 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
232 $(DOCBOOK_WRAPPER) $< $@
234 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
235 $(DOCBOOK_WRAPPER) $< $@
237 man/footer.sgml $(TESTS): srclinks
239 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
241 lib/_autoconf.py: Makefile stamp-directories
243 { echo '# This file is automatically generated, do not edit!'; \
245 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
246 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
247 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
248 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
249 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
250 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
251 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
252 echo "SYSCONFDIR = '$(sysconfdir)'"; \
253 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
254 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
255 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
256 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
257 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
258 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
259 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
260 echo "KVM_PATH = '$(KVM_PATH)'"; \
263 $(REPLACE_VARS_SED): Makefile stamp-directories
265 { echo 's#@PREFIX@#$(prefix)#g'; \
266 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
267 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
268 echo 's#@SBINDIR@#$(sbindir)#g'; \
269 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
270 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
271 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
272 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
273 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
274 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
279 # We need to create symlinks because "make distcheck" will not install Python
280 # files when building.
282 srclinks: stamp-directories
284 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
285 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
286 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
292 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
294 # a dist hook rule for catching revision control directories
296 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
297 echo "Found revision control files in final archive" 1>&2 ; \
302 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
303 "$(DESTDIR)${localstatedir}/log/ganeti" \
304 "$(DESTDIR)${localstatedir}/run/ganeti"
306 stamp-directories: Makefile
312 test -e doc/api || mkdir doc/api
313 TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
314 cp -r scripts daemons lib $$TMPDIR && \
318 epydoc --conf ../epydoc.conf \