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 = \
89 lib/hypervisor/__init__.py \
90 lib/hypervisor/hv_base.py \
91 lib/hypervisor/hv_fake.py \
92 lib/hypervisor/hv_kvm.py \
93 lib/hypervisor/hv_xen.py
96 lib/rapi/__init__.py \
97 lib/rapi/httperror.py \
98 lib/rapi/baserlib.py \
99 lib/rapi/connector.py \
112 $(patsubst %.sgml,%.html,$(docsgml)) \
113 $(patsubst %.sgml,%.pdf,$(docsgml))
115 dist_sbin_SCRIPTS = \
116 daemons/ganeti-noded \
117 daemons/ganeti-watcher \
118 daemons/ganeti-masterd \
119 daemons/ganeti-rapi \
121 scripts/gnt-cluster \
123 scripts/gnt-instance \
128 dist_tools_SCRIPTS = \
137 autotools/docbook-wrapper \
140 doc/build-rapi-resources-doc \
141 doc/examples/ganeti.initd.in \
142 doc/examples/ganeti.cron.in \
143 doc/examples/dumb-allocator \
144 qa/hooks/datehook.py \
145 qa/hooks/loghook.py \
170 man/ganeti-os-interface.7 \
171 man/ganeti-watcher.8 \
178 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
179 mansgml = $(patsubst %.in,%.sgml,$(maninput))
182 test/data/bdev-both.txt \
183 test/data/bdev-disk.txt \
184 test/data/bdev-net.txt \
185 test/data/proc_drbd8.txt
188 test/ganeti.config_unittest.py \
189 test/ganeti.hooks_unittest.py \
190 test/ganeti.utils_unittest.py \
191 test/ganeti.bdev_unittest.py \
192 test/ganeti.ssh_unittest.py \
193 test/ganeti.locking_unittest.py \
194 test/ganeti.serializer_unittest.py \
195 test/ganeti.workerpool_unittest.py \
196 test/ganeti.rapi.resources_unittest.py \
197 test/ganeti.http_unittest.py \
198 test/ganeti.constants_unittest.py
202 TESTS = $(dist_TESTS) $(nodist_TESTS)
204 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
207 all-local: stamp-directories lib/_autoconf.py devel/upload \
208 doc/examples/ganeti.initd doc/examples/ganeti.cron
210 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
211 sed -f $(REPLACE_VARS_SED) < $< > $@
214 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
216 sed -f $(REPLACE_VARS_SED) < $< > $@
218 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
219 sed -f $(REPLACE_VARS_SED) < $< > $@
221 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
222 sed -f $(REPLACE_VARS_SED) < $< > $@
224 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
225 $(DOCBOOK_WRAPPER) $< $@
227 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
228 $(DOCBOOK_WRAPPER) $< $@
230 doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
232 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
233 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
235 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
236 $(DOCBOOK_WRAPPER) $< $@
238 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
239 $(DOCBOOK_WRAPPER) $< $@
241 man/footer.sgml $(TESTS): srclinks
243 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
245 lib/_autoconf.py: Makefile stamp-directories
247 { echo '# This file is automatically generated, do not edit!'; \
249 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
250 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
251 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
252 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
253 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
254 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
255 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
256 echo "SYSCONFDIR = '$(sysconfdir)'"; \
257 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
258 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
259 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
260 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
261 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
262 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
263 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
264 echo "KVM_PATH = '$(KVM_PATH)'"; \
267 $(REPLACE_VARS_SED): Makefile stamp-directories
269 { echo 's#@PREFIX@#$(prefix)#g'; \
270 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
271 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
272 echo 's#@SBINDIR@#$(sbindir)#g'; \
273 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
274 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
275 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
276 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
277 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
278 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
283 # We need to create symlinks because "make distcheck" will not install Python
284 # files when building.
286 srclinks: stamp-directories
288 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
289 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
290 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
296 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
298 # a dist hook rule for catching revision control directories
300 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
301 echo "Found revision control files in final archive" 1>&2 ; \
306 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
307 "$(DESTDIR)${localstatedir}/log/ganeti" \
308 "$(DESTDIR)${localstatedir}/run/ganeti"
310 stamp-directories: Makefile
316 test -e doc/api || mkdir doc/api
317 TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
318 cp -r scripts daemons lib $$TMPDIR && \
322 epydoc --conf ../epydoc.conf \