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)
40 autotools/replace_vars.sed \
45 doc/rapi-resources.sgml \
46 doc/examples/ganeti.initd \
47 doc/examples/ganeti.cron \
49 lib/hypervisor/*.py[co] \
57 $(nodist_pkgpython_PYTHON)
59 nodist_pkgpython_PYTHON = \
88 lib/hypervisor/__init__.py \
89 lib/hypervisor/hv_base.py \
90 lib/hypervisor/hv_fake.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 \
142 qa/hooks/datehook.py \
143 qa/hooks/loghook.py \
168 man/ganeti-os-interface.7 \
169 man/ganeti-watcher.8 \
176 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
177 mansgml = $(patsubst %.in,%.sgml,$(maninput))
180 test/data/bdev-both.txt \
181 test/data/bdev-disk.txt \
182 test/data/bdev-net.txt \
183 test/data/proc_drbd8.txt
186 test/ganeti.config_unittest.py \
187 test/ganeti.hooks_unittest.py \
188 test/ganeti.utils_unittest.py \
189 test/ganeti.bdev_unittest.py \
190 test/ganeti.ssh_unittest.py \
191 test/ganeti.locking_unittest.py \
192 test/ganeti.serializer_unittest.py \
193 test/ganeti.workerpool_unittest.py \
194 test/ganeti.rapi.resources_unittest.py \
195 test/ganeti.http_unittest.py \
196 test/ganeti.constants_unittest.py
200 TESTS = $(dist_TESTS) $(nodist_TESTS)
202 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
205 all-local: stamp-directories lib/_autoconf.py devel/upload \
206 doc/examples/ganeti.initd doc/examples/ganeti.cron
208 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
209 sed -f $(REPLACE_VARS_SED) < $< > $@
212 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
214 sed -f $(REPLACE_VARS_SED) < $< > $@
216 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
217 sed -f $(REPLACE_VARS_SED) < $< > $@
219 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
220 sed -f $(REPLACE_VARS_SED) < $< > $@
222 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
223 $(DOCBOOK_WRAPPER) $< $@
225 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
226 $(DOCBOOK_WRAPPER) $< $@
228 doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
230 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
231 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
233 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
234 $(DOCBOOK_WRAPPER) $< $@
236 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
237 $(DOCBOOK_WRAPPER) $< $@
239 man/footer.sgml $(TESTS): srclinks
241 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
243 lib/_autoconf.py: Makefile stamp-directories
245 { echo '# This file is automatically generated, do not edit!'; \
247 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
248 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
249 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
250 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
251 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
252 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
253 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
254 echo "SYSCONFDIR = '$(sysconfdir)'"; \
255 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
256 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
257 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
258 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
259 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
260 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
261 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
264 $(REPLACE_VARS_SED): Makefile stamp-directories
266 { echo 's#@PREFIX@#$(prefix)#g'; \
267 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
268 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
269 echo 's#@SBINDIR@#$(sbindir)#g'; \
270 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
271 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
272 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
273 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
274 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
275 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
280 # We need to create symlinks because "make distcheck" will not install Python
281 # files when building.
283 srclinks: stamp-directories
285 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
286 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
287 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
293 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
295 # a dist hook rule for catching revision control directories
297 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
298 echo "Found revision control files in final archive" 1>&2 ; \
303 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
304 "$(DESTDIR)${localstatedir}/log/ganeti" \
305 "$(DESTDIR)${localstatedir}/run/ganeti"
307 stamp-directories: Makefile
313 test -e doc/api || mkdir doc/api
314 TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
315 cp -r scripts daemons lib $$TMPDIR && \
319 epydoc --conf ../epydoc.conf \