Update the iallocator documentation
[ganeti-local] / Makefile.am
1 # Ganeti makefile
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.
7
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@
11
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
16
17 hypervisordir = $(pkgpythondir)/hypervisor
18 httpdir = $(pkgpythondir)/http
19 rapidir = $(pkgpythondir)/rapi
20 toolsdir = $(pkglibdir)/tools
21 docdir = $(datadir)/doc/$(PACKAGE)
22
23 DIRS = \
24         autotools \
25         daemons \
26         devel \
27         doc \
28         doc/examples \
29         lib \
30         lib/http \
31         lib/hypervisor \
32         lib/rapi \
33         man \
34         qa \
35         scripts \
36         test \
37         test/data \
38         tools
39
40 CLEANFILES = \
41         autotools/replace_vars.sed \
42         devel/upload \
43         doc/*.html \
44         doc/*.in \
45         doc/*.pdf \
46         $(patsubst %.dot,%.png,$(docdot)) \
47         doc/rapi-resources.gen \
48         doc/examples/bash_completion \
49         doc/examples/ganeti.initd \
50         doc/examples/ganeti.cron \
51         lib/*.py[co] \
52         lib/http/*.py[co] \
53         lib/hypervisor/*.py[co] \
54         lib/rapi/*.py[co] \
55         man/*.[78] \
56         man/*.in \
57         man/*.html \
58         qa/*.py[co] \
59         test/*.py[co] \
60         stamp-directories \
61         $(nodist_pkgpython_PYTHON)
62
63 nodist_pkgpython_PYTHON = \
64         lib/_autoconf.py
65
66 pkgpython_PYTHON = \
67         lib/__init__.py \
68         lib/backend.py \
69         lib/bdev.py \
70         lib/bootstrap.py \
71         lib/cli.py \
72         lib/cmdlib.py \
73         lib/config.py \
74         lib/constants.py \
75         lib/daemon.py \
76         lib/errors.py \
77         lib/jqueue.py \
78         lib/jstore.py \
79         lib/locking.py \
80         lib/luxi.py \
81         lib/mcpu.py \
82         lib/objects.py \
83         lib/opcodes.py \
84         lib/rpc.py \
85         lib/serializer.py \
86         lib/ssconf.py \
87         lib/ssh.py \
88         lib/utils.py \
89         lib/workerpool.py
90
91 hypervisor_PYTHON = \
92         lib/hypervisor/__init__.py \
93         lib/hypervisor/hv_base.py \
94         lib/hypervisor/hv_fake.py \
95         lib/hypervisor/hv_kvm.py \
96         lib/hypervisor/hv_xen.py
97
98 rapi_PYTHON = \
99         lib/rapi/__init__.py \
100         lib/rapi/baserlib.py \
101         lib/rapi/connector.py \
102         lib/rapi/rlib2.py
103
104 http_PYTHON = \
105         lib/http/__init__.py \
106         lib/http/auth.py \
107         lib/http/client.py \
108         lib/http/server.py
109
110
111 docrst = \
112         doc/admin.rst \
113         doc/design-2.0.rst \
114         doc/hooks.rst \
115         doc/iallocator.rst \
116         doc/install.rst \
117         doc/security.rst
118
119 docdot = \
120         doc/arch-2.0.dot
121
122 doc_DATA = \
123         $(patsubst %.rst,%.html,$(docrst))
124
125 noinst_DATA = $(manhtml)
126
127 dist_sbin_SCRIPTS = \
128         daemons/ganeti-noded \
129         daemons/ganeti-watcher \
130         daemons/ganeti-masterd \
131         daemons/ganeti-rapi \
132         scripts/gnt-backup \
133         scripts/gnt-cluster \
134         scripts/gnt-debug \
135         scripts/gnt-instance \
136         scripts/gnt-job \
137         scripts/gnt-node \
138         scripts/gnt-os
139
140 dist_tools_SCRIPTS = \
141         tools/burnin \
142         tools/cfgshell \
143         tools/cfgupgrade \
144         tools/lvmstrap
145
146 EXTRA_DIST = \
147         NEWS \
148         DEVNOTES \
149         autotools/docbook-wrapper \
150         devel/upload.in \
151         $(docrst) \
152         $(docdot) \
153         doc/build-rapi-resources-doc \
154         doc/examples/bash_completion.in \
155         doc/examples/ganeti.initd.in \
156         doc/examples/ganeti.cron.in \
157         doc/examples/dumb-allocator \
158         doc/locking.txt \
159         test/testutils.py \
160         test/mocks.py \
161         $(dist_TESTS) \
162         $(TEST_FILES) \
163         man/footer.sgml \
164         $(mansgml) \
165         qa/ganeti-qa.py \
166         qa/qa-sample.json \
167         qa/qa_cluster.py \
168         qa/qa_config.py \
169         qa/qa_daemon.py \
170         qa/qa_env.py \
171         qa/qa_error.py \
172         qa/qa_instance.py \
173         qa/qa_node.py \
174         qa/qa_os.py \
175         qa/qa_rapi.py \
176         qa/qa_tags.py \
177         qa/qa_utils.py
178
179 man_MANS = \
180         man/ganeti.7 \
181         man/ganeti-masterd.8 \
182         man/ganeti-noded.8 \
183         man/ganeti-os-interface.7 \
184         man/ganeti-rapi.8 \
185         man/ganeti-watcher.8 \
186         man/gnt-backup.8 \
187         man/gnt-cluster.8 \
188         man/gnt-debug.8 \
189         man/gnt-instance.8 \
190         man/gnt-job.8 \
191         man/gnt-node.8 \
192         man/gnt-os.8
193
194 maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
195 mansgml = $(patsubst %.in,%.sgml,$(maninput))
196 manhtml = $(patsubst %.in,%.html,$(maninput))
197
198 TEST_FILES = \
199         test/data/bdev-both.txt \
200         test/data/bdev-disk.txt \
201         test/data/bdev-net.txt \
202         test/data/proc_drbd8.txt
203
204 dist_TESTS = \
205         test/ganeti.bdev_unittest.py \
206         test/ganeti.cli_unittest.py \
207         test/ganeti.cmdlib_unittest.py \
208         test/ganeti.config_unittest.py \
209         test/ganeti.constants_unittest.py \
210         test/ganeti.hooks_unittest.py \
211         test/ganeti.http_unittest.py \
212         test/ganeti.locking_unittest.py \
213         test/ganeti.rapi.resources_unittest.py \
214         test/ganeti.serializer_unittest.py \
215         test/ganeti.ssh_unittest.py \
216         test/ganeti.utils_unittest.py \
217         test/ganeti.workerpool_unittest.py
218
219 nodist_TESTS =
220
221 TESTS = $(dist_TESTS) $(nodist_TESTS)
222
223 TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
224
225 RAPI_RESOURCES = $(wildcard lib/rapi/*.py)
226
227 all-local: stamp-directories lib/_autoconf.py devel/upload \
228         doc/examples/bash_completion \
229         doc/examples/ganeti.initd doc/examples/ganeti.cron
230
231 devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
232         sed -f $(REPLACE_VARS_SED) < $< > $@
233         chmod u+x $@
234
235 doc/examples/%: doc/examples/%.in stamp-directories \
236                 $(REPLACE_VARS_SED)
237         sed -f $(REPLACE_VARS_SED) < $< > $@
238
239 doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
240         sed -f $(REPLACE_VARS_SED) < $< > $@
241
242 man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
243         sed -f $(REPLACE_VARS_SED) < $< > $@
244
245 doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
246         $(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
247
248 doc/%.html: doc/%.rst
249         $(RST2HTML) $< $@
250
251 doc/%.png: doc/%.dot
252         $(DOT) -Tpng -o $@ $<
253
254 doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
255
256 doc/rapi.pdf doc/rapi.html: doc/rapi-resources.gen
257
258 doc/rapi-resources.gen: $(BUILD_RAPI_RESOURCE_DOC) $(RAPI_RESOURCES)
259         PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || \
260           rm -f $@
261
262 man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
263         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
264
265 man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
266         $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
267
268 man/%.html: man/%.in $(DOCBOOK_WRAPPER)
269         $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
270
271 man/footer.sgml $(TESTS): srclinks
272
273 $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
274
275 lib/_autoconf.py: Makefile stamp-directories
276         set -e; \
277         { echo '# This file is automatically generated, do not edit!'; \
278           echo '#'; \
279           echo ''; \
280           echo '"""Build-time configuration for Ganeti.'; \
281           echo '';\
282           echo 'This file is autogenerated by the build process.'; \
283           echo 'For any changes you need to re-run ./configure (and'; \
284           echo 'not edit by hand).'; \
285           echo ''; \
286           echo '"""'; \
287           echo ''; \
288           echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
289           echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
290           echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
291           echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
292           echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
293           echo "VERSION_FULL = '$(VERSION_FULL)'"; \
294           echo "LOCALSTATEDIR = '$(localstatedir)'"; \
295           echo "SYSCONFDIR = '$(sysconfdir)'"; \
296           echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
297           echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
298           echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
299           echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
300           echo "XEN_INITRD = '$(XEN_INITRD)'"; \
301           echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
302           echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
303           echo "KVM_PATH = '$(KVM_PATH)'"; \
304           echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \
305           echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \
306         } > $@
307
308 $(REPLACE_VARS_SED): Makefile stamp-directories
309         set -e; \
310         { echo 's#@PREFIX@#$(prefix)#g'; \
311           echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
312           echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
313           echo 's#@SBINDIR@#$(sbindir)#g'; \
314           echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
315           echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
316           echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
317           echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
318         } > $@
319
320 # We need to create symlinks because "make distcheck" will not install Python
321 # files when building.
322 #.PHONY: srclinks
323 srclinks: stamp-directories
324         set -e; \
325         for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
326                         $(rapi_PYTHON) $(http_PYTHON); do \
327                 if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
328                         $(LN_S) $(abs_top_srcdir)/$$i $$i; \
329                 fi; \
330         done
331
332 .PHONY: ganeti
333 ganeti:
334         cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
335
336 # a dist hook rule for catching revision control directories
337 distcheck-hook:
338         if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
339                 echo "Found revision control files in final archive" 1>&2 ; \
340                 exit 1; \
341         fi
342
343 install-exec-local:
344         @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
345           "$(DESTDIR)${localstatedir}/log/ganeti" \
346           "$(DESTDIR)${localstatedir}/run/ganeti"
347
348 stamp-directories: Makefile
349         @mkdir_p@ $(DIRS)
350         touch $@
351
352 .PHONY: apidoc
353 apidoc:
354         test -e doc/api || mkdir doc/api
355         TMPDIR=`mktemp -d ` && { \
356                 cp -r scripts daemons lib $$TMPDIR && \
357                 ( \
358                         CDIR=`pwd` && \
359                         cd $$TMPDIR && \
360                         mv lib ganeti && \
361                         epydoc -v --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
362                 ) ; \
363                 rm -rf $$TMPDIR ; \
364         }
365
366 # vim: set noet :