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_xen.py
95 lib/rapi/__init__.py \
96 lib/rapi/httperror.py \
97 lib/rapi/baserlib.py \
98 lib/rapi/connector.py \
111 $(patsubst %.sgml,%.html,$(docsgml)) \
112 $(patsubst %.sgml,%.pdf,$(docsgml))
114 dist_sbin_SCRIPTS = \
115 daemons/ganeti-noded \
116 daemons/ganeti-watcher \
117 daemons/ganeti-masterd \
118 daemons/ganeti-rapi \
120 scripts/gnt-cluster \
122 scripts/gnt-instance \
127 dist_tools_SCRIPTS = \
136 autotools/docbook-wrapper \
139 doc/build-rapi-resources-doc \
140 doc/examples/ganeti.initd.in \
141 doc/examples/ganeti.cron.in \
142 doc/examples/dumb-allocator \
143 qa/hooks/datehook.py \
144 qa/hooks/loghook.py \
169 man/ganeti-os-interface.7 \
170 man/ganeti-watcher.8 \
177 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
178 mansgml = $(patsubst %.in,%.sgml,$(maninput))
181 test/data/bdev-both.txt \
182 test/data/bdev-disk.txt \
183 test/data/bdev-net.txt \
184 test/data/proc_drbd8.txt
187 test/ganeti.config_unittest.py \
188 test/ganeti.hooks_unittest.py \
189 test/ganeti.utils_unittest.py \
190 test/ganeti.bdev_unittest.py \
191 test/ganeti.ssh_unittest.py \
192 test/ganeti.locking_unittest.py \
193 test/ganeti.serializer_unittest.py \
194 test/ganeti.workerpool_unittest.py \
195 test/ganeti.rapi.resources_unittest.py \
196 test/ganeti.http_unittest.py \
197 test/ganeti.constants_unittest.py
201 TESTS = $(dist_TESTS) $(nodist_TESTS)
203 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
206 all-local: stamp-directories lib/_autoconf.py devel/upload \
207 doc/examples/ganeti.initd doc/examples/ganeti.cron
209 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
210 sed -f $(REPLACE_VARS_SED) < $< > $@
213 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
215 sed -f $(REPLACE_VARS_SED) < $< > $@
217 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
218 sed -f $(REPLACE_VARS_SED) < $< > $@
220 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
221 sed -f $(REPLACE_VARS_SED) < $< > $@
223 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
224 $(DOCBOOK_WRAPPER) $< $@
226 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
227 $(DOCBOOK_WRAPPER) $< $@
229 doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
231 doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
232 PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
234 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
235 $(DOCBOOK_WRAPPER) $< $@
237 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
238 $(DOCBOOK_WRAPPER) $< $@
240 man/footer.sgml $(TESTS): srclinks
242 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
244 lib/_autoconf.py: Makefile stamp-directories
246 { echo '# This file is automatically generated, do not edit!'; \
248 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
249 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
250 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
251 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
252 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
253 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
254 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
255 echo "SYSCONFDIR = '$(sysconfdir)'"; \
256 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
257 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
258 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
259 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
260 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
261 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
262 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
265 $(REPLACE_VARS_SED): Makefile stamp-directories
267 { echo 's#@PREFIX@#$(prefix)#g'; \
268 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
269 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
270 echo 's#@SBINDIR@#$(sbindir)#g'; \
271 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
272 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
273 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
274 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
275 echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
276 echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
281 # We need to create symlinks because "make distcheck" will not install Python
282 # files when building.
284 srclinks: stamp-directories
286 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
287 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
288 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
294 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
296 # a dist hook rule for catching revision control directories
298 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
299 echo "Found revision control files in final archive" 1>&2 ; \
304 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
305 "$(DESTDIR)${localstatedir}/log/ganeti" \
306 "$(DESTDIR)${localstatedir}/run/ganeti"
308 stamp-directories: Makefile
314 test -e doc/api || mkdir doc/api
315 TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
316 cp -r scripts daemons lib $$TMPDIR && \
320 epydoc --conf ../epydoc.conf \