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 REPLACE_VARS_SED = autotools/replace_vars.sed
16 hypervisordir = $(pkgpythondir)/hypervisor
17 toolsdir = $(pkglibdir)/tools
18 docdir = $(datadir)/doc/$(PACKAGE)
37 autotools/replace_vars.sed \
42 doc/examples/ganeti.initd \
43 doc/examples/ganeti.cron \
45 lib/hypervisor/*.py[co] \
52 $(nodist_pkgpython_PYTHON)
54 nodist_pkgpython_PYTHON = \
82 lib/hypervisor/__init__.py \
83 lib/hypervisor/hv_base.py \
84 lib/hypervisor/hv_fake.py \
85 lib/hypervisor/hv_xen.py
94 $(patsubst %.sgml,%.html,$(docsgml)) \
95 $(patsubst %.sgml,%.pdf,$(docsgml))
98 daemons/ganeti-noded \
99 daemons/ganeti-watcher \
100 daemons/ganeti-master \
101 daemons/ganeti-masterd \
103 scripts/gnt-cluster \
105 scripts/gnt-instance \
110 dist_tools_SCRIPTS = \
119 autotools/docbook-wrapper \
122 doc/examples/ganeti.initd.in \
123 doc/examples/ganeti.cron.in \
124 doc/examples/dumb-allocator \
125 qa/hooks/datehook.py \
126 qa/hooks/loghook.py \
149 man/ganeti-master.8 \
151 man/ganeti-os-interface.7 \
152 man/ganeti-watcher.8 \
159 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
160 mansgml = $(patsubst %.in,%.sgml,$(maninput))
163 test/data/bdev-both.txt \
164 test/data/bdev-disk.txt \
165 test/data/bdev-net.txt \
166 test/data/proc_drbd8.txt
169 test/ganeti.config_unittest.py \
170 test/ganeti.hooks_unittest.py \
171 test/ganeti.utils_unittest.py \
172 test/ganeti.bdev_unittest.py \
173 test/ganeti.ssh_unittest.py \
174 test/ganeti.locking_unittest.py \
175 test/ganeti.serializer_unittest.py \
176 test/ganeti.workerpool_unittest.py \
177 test/ganeti.constants_unittest.py
181 TESTS = $(dist_TESTS) $(nodist_TESTS)
183 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
186 all-local: stamp-directories lib/_autoconf.py devel/upload \
187 doc/examples/ganeti.initd doc/examples/ganeti.cron
189 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
190 sed -f $(REPLACE_VARS_SED) < $< > $@
193 doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
195 sed -f $(REPLACE_VARS_SED) < $< > $@
197 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
198 sed -f $(REPLACE_VARS_SED) < $< > $@
200 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
201 sed -f $(REPLACE_VARS_SED) < $< > $@
203 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
204 $(DOCBOOK_WRAPPER) $< $@
206 doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
207 $(DOCBOOK_WRAPPER) $< $@
209 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
210 $(DOCBOOK_WRAPPER) $< $@
212 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
213 $(DOCBOOK_WRAPPER) $< $@
215 man/footer.sgml $(TESTS): srclinks
219 lib/_autoconf.py: Makefile stamp-directories
221 { echo '# This file is automatically generated, do not edit!'; \
223 echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
224 echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
225 echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
226 echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
227 echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
228 echo "VERSION_FULL = '$(VERSION_FULL)'"; \
229 echo "LOCALSTATEDIR = '$(localstatedir)'"; \
230 echo "SYSCONFDIR = '$(sysconfdir)'"; \
231 echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
232 echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
233 echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
234 echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
235 echo "XEN_INITRD = '$(XEN_INITRD)'"; \
236 echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
237 echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
240 $(REPLACE_VARS_SED): Makefile stamp-directories
242 { echo 's#@PREFIX@#$(prefix)#g'; \
243 echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
244 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
245 echo 's#@SBINDIR@#$(sbindir)#g'; \
246 echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
247 echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
248 echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
249 echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
252 # We need to create symlinks because "make distcheck" will not install Python
253 # files when building.
255 srclinks: stamp-directories
257 for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON); do \
258 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
259 $(LN_S) $(abs_top_srcdir)/$$i $$i; \
265 cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
267 # a dist hook rule for catching revision control directories
269 if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
270 echo "Found revision control files in final archive" 1>&2 ; \
275 @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
276 "$(DESTDIR)${localstatedir}/log/ganeti" \
277 "$(DESTDIR)${localstatedir}/run/ganeti"
279 stamp-directories: Makefile