root / Makefile.am @ dbefcc7e
History | View | Annotate | Download (11.3 kB)
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_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion |
15 |
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir |
16 |
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code |
17 |
REPLACE_VARS_SED = autotools/replace_vars.sed |
18 |
|
19 |
hypervisordir = $(pkgpythondir)/hypervisor |
20 |
httpdir = $(pkgpythondir)/http |
21 |
confddir = $(pkgpythondir)/confd |
22 |
rapidir = $(pkgpythondir)/rapi |
23 |
toolsdir = $(pkglibdir)/tools |
24 |
docdir = $(datadir)/doc/$(PACKAGE) |
25 |
|
26 |
DIRS = \ |
27 |
autotools \ |
28 |
daemons \ |
29 |
devel \ |
30 |
doc \ |
31 |
doc/examples \ |
32 |
doc/examples/hooks \ |
33 |
lib \ |
34 |
lib/build \ |
35 |
lib/http \ |
36 |
lib/hypervisor \ |
37 |
lib/rapi \ |
38 |
lib/confd \ |
39 |
man \ |
40 |
qa \ |
41 |
scripts \ |
42 |
test \ |
43 |
test/data \ |
44 |
tools |
45 |
|
46 |
MAINTAINERCLEANFILES = \ |
47 |
$(docpng) \ |
48 |
$(maninput) |
49 |
|
50 |
maintainer-clean-local: |
51 |
-rm -rf doc/api doc/build doc/html |
52 |
|
53 |
CLEANFILES = \ |
54 |
autotools/replace_vars.sed \ |
55 |
daemons/ganeti-cleaner \ |
56 |
devel/upload \ |
57 |
doc/examples/bash_completion \ |
58 |
doc/examples/ganeti.initd \ |
59 |
doc/examples/ganeti.cron \ |
60 |
doc/examples/hooks/ipsec \ |
61 |
lib/*.py[co] \ |
62 |
lib/build/*.py[co] \ |
63 |
lib/http/*.py[co] \ |
64 |
lib/hypervisor/*.py[co] \ |
65 |
lib/rapi/*.py[co] \ |
66 |
$(man_MANS) \ |
67 |
$(manhtml) \ |
68 |
qa/*.py[co] \ |
69 |
test/*.py[co] \ |
70 |
stamp-directories \ |
71 |
$(nodist_pkgpython_PYTHON) |
72 |
|
73 |
BUILT_SOURCES = \ |
74 |
ganeti \ |
75 |
srclinks \ |
76 |
stamp-directories \ |
77 |
lib/_autoconf.py |
78 |
|
79 |
nodist_pkgpython_PYTHON = \ |
80 |
lib/_autoconf.py |
81 |
|
82 |
noinst_PYTHON = \ |
83 |
lib/build/__init__.py |
84 |
|
85 |
pkgpython_PYTHON = \ |
86 |
lib/__init__.py \ |
87 |
lib/asyncnotifier.py \ |
88 |
lib/backend.py \ |
89 |
lib/bdev.py \ |
90 |
lib/bootstrap.py \ |
91 |
lib/cli.py \ |
92 |
lib/cmdlib.py \ |
93 |
lib/config.py \ |
94 |
lib/constants.py \ |
95 |
lib/daemon.py \ |
96 |
lib/errors.py \ |
97 |
lib/jqueue.py \ |
98 |
lib/jstore.py \ |
99 |
lib/locking.py \ |
100 |
lib/luxi.py \ |
101 |
lib/mcpu.py \ |
102 |
lib/objects.py \ |
103 |
lib/opcodes.py \ |
104 |
lib/rpc.py \ |
105 |
lib/serializer.py \ |
106 |
lib/ssconf.py \ |
107 |
lib/ssh.py \ |
108 |
lib/storage.py \ |
109 |
lib/utils.py \ |
110 |
lib/workerpool.py |
111 |
|
112 |
hypervisor_PYTHON = \ |
113 |
lib/hypervisor/__init__.py \ |
114 |
lib/hypervisor/hv_base.py \ |
115 |
lib/hypervisor/hv_chroot.py \ |
116 |
lib/hypervisor/hv_fake.py \ |
117 |
lib/hypervisor/hv_kvm.py \ |
118 |
lib/hypervisor/hv_xen.py |
119 |
|
120 |
rapi_PYTHON = \ |
121 |
lib/rapi/__init__.py \ |
122 |
lib/rapi/baserlib.py \ |
123 |
lib/rapi/connector.py \ |
124 |
lib/rapi/rlib2.py |
125 |
|
126 |
http_PYTHON = \ |
127 |
lib/http/__init__.py \ |
128 |
lib/http/auth.py \ |
129 |
lib/http/client.py \ |
130 |
lib/http/server.py |
131 |
|
132 |
confd_PYTHON = \ |
133 |
lib/confd/__init__.py \ |
134 |
lib/confd/client.py \ |
135 |
lib/confd/server.py \ |
136 |
lib/confd/querylib.py |
137 |
|
138 |
docrst = \ |
139 |
doc/admin.rst \ |
140 |
doc/design-2.0.rst \ |
141 |
doc/design-2.1.rst \ |
142 |
doc/devnotes.rst \ |
143 |
doc/glossary.rst \ |
144 |
doc/hooks.rst \ |
145 |
doc/iallocator.rst \ |
146 |
doc/index.rst \ |
147 |
doc/install.rst \ |
148 |
doc/locking.rst \ |
149 |
doc/rapi.rst \ |
150 |
doc/security.rst |
151 |
|
152 |
doc/html: $(docrst) $(docpng) doc/conf.py configure.ac |
153 |
@test -n "$(SPHINX)" || \ |
154 |
{ echo 'sphinx-build' not found during configure; exit 1; } |
155 |
mkdir -p doc/build/doctrees |
156 |
PYTHONPATH=.:$(top_builddir) $(SPHINX) -q -b html \ |
157 |
-d doc/build/doctrees \ |
158 |
-D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \ |
159 |
-D release="$(PACKAGE_VERSION)" \ |
160 |
$(top_srcdir)/doc doc/html |
161 |
touch "$@" |
162 |
|
163 |
docdot = \ |
164 |
doc/arch-2.0.dot \ |
165 |
doc/design-2.1-lock-acquire.dot \ |
166 |
doc/design-2.1-lock-release.dot |
167 |
|
168 |
docpng = $(patsubst %.dot,%.png,$(docdot)) |
169 |
|
170 |
noinst_DATA = $(manhtml) doc/html |
171 |
|
172 |
gnt_scripts = \ |
173 |
scripts/gnt-backup \ |
174 |
scripts/gnt-cluster \ |
175 |
scripts/gnt-debug \ |
176 |
scripts/gnt-instance \ |
177 |
scripts/gnt-job \ |
178 |
scripts/gnt-node \ |
179 |
scripts/gnt-os |
180 |
|
181 |
dist_sbin_SCRIPTS = \ |
182 |
daemons/ganeti-noded \ |
183 |
daemons/ganeti-watcher \ |
184 |
daemons/ganeti-masterd \ |
185 |
daemons/ganeti-confd \ |
186 |
daemons/ganeti-rapi \ |
187 |
$(gnt_scripts) |
188 |
|
189 |
nodist_sbin_SCRIPTS = \ |
190 |
daemons/ganeti-cleaner |
191 |
|
192 |
dist_tools_SCRIPTS = \ |
193 |
tools/burnin \ |
194 |
tools/cfgshell \ |
195 |
tools/cfgupgrade \ |
196 |
tools/lvmstrap |
197 |
|
198 |
EXTRA_DIST = \ |
199 |
$(MAINTAINERCLEANFILES) \ |
200 |
NEWS \ |
201 |
pylintrc \ |
202 |
autotools/build-bash-completion \ |
203 |
autotools/check-python-code \ |
204 |
autotools/docbook-wrapper \ |
205 |
$(RUN_IN_TEMPDIR) \ |
206 |
daemons/ganeti-cleaner.in \ |
207 |
devel/upload.in \ |
208 |
$(docdot) \ |
209 |
$(docrst) \ |
210 |
doc/conf.py \ |
211 |
doc/html \ |
212 |
doc/examples/ganeti.initd.in \ |
213 |
doc/examples/ganeti.cron.in \ |
214 |
doc/examples/dumb-allocator \ |
215 |
doc/examples/hooks/ethers \ |
216 |
doc/examples/hooks/ipsec.in \ |
217 |
test/testutils.py \ |
218 |
test/mocks.py \ |
219 |
$(dist_TESTS) \ |
220 |
$(TEST_FILES) \ |
221 |
man/footer.sgml \ |
222 |
$(mansgml) $(maninput) \ |
223 |
qa/ganeti-qa.py \ |
224 |
qa/qa-sample.json \ |
225 |
qa/qa_cluster.py \ |
226 |
qa/qa_config.py \ |
227 |
qa/qa_daemon.py \ |
228 |
qa/qa_env.py \ |
229 |
qa/qa_error.py \ |
230 |
qa/qa_instance.py \ |
231 |
qa/qa_node.py \ |
232 |
qa/qa_os.py \ |
233 |
qa/qa_rapi.py \ |
234 |
qa/qa_tags.py \ |
235 |
qa/qa_utils.py |
236 |
|
237 |
man_MANS = \ |
238 |
man/ganeti.7 \ |
239 |
man/ganeti-cleaner.8 \ |
240 |
man/ganeti-confd.8 \ |
241 |
man/ganeti-masterd.8 \ |
242 |
man/ganeti-noded.8 \ |
243 |
man/ganeti-os-interface.7 \ |
244 |
man/ganeti-rapi.8 \ |
245 |
man/ganeti-watcher.8 \ |
246 |
man/gnt-backup.8 \ |
247 |
man/gnt-cluster.8 \ |
248 |
man/gnt-debug.8 \ |
249 |
man/gnt-instance.8 \ |
250 |
man/gnt-job.8 \ |
251 |
man/gnt-node.8 \ |
252 |
man/gnt-os.8 |
253 |
|
254 |
mansgml = $(patsubst %.7,%.sgml,$(patsubst %.8,%.sgml,$(man_MANS))) |
255 |
manhtml = $(patsubst %.sgml,%.html,$(mansgml)) |
256 |
maninput = $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) $(patsubst %.html,%.html.in,$(manhtml)) |
257 |
|
258 |
TEST_FILES = \ |
259 |
test/data/bdev-both.txt \ |
260 |
test/data/bdev-8.3-both.txt \ |
261 |
test/data/bdev-disk.txt \ |
262 |
test/data/bdev-net.txt \ |
263 |
test/data/proc_drbd8.txt \ |
264 |
test/data/proc_drbd80-emptyline.txt \ |
265 |
test/data/proc_drbd83.txt |
266 |
|
267 |
dist_TESTS = \ |
268 |
test/ganeti.bdev_unittest.py \ |
269 |
test/ganeti.cli_unittest.py \ |
270 |
test/ganeti.cmdlib_unittest.py \ |
271 |
test/ganeti.confd_client_unittest.py \ |
272 |
test/ganeti.config_unittest.py \ |
273 |
test/ganeti.constants_unittest.py \ |
274 |
test/ganeti.hooks_unittest.py \ |
275 |
test/ganeti.http_unittest.py \ |
276 |
test/ganeti.locking_unittest.py \ |
277 |
test/ganeti.mcpu_unittest.py \ |
278 |
test/ganeti.objects_unittest.py \ |
279 |
test/ganeti.rapi.resources_unittest.py \ |
280 |
test/ganeti.serializer_unittest.py \ |
281 |
test/ganeti.ssh_unittest.py \ |
282 |
test/ganeti.utils_unittest.py \ |
283 |
test/ganeti.workerpool_unittest.py \ |
284 |
test/docs_unittest.py |
285 |
|
286 |
nodist_TESTS = |
287 |
|
288 |
TESTS = $(dist_TESTS) $(nodist_TESTS) |
289 |
|
290 |
TESTS_ENVIRONMENT = \ |
291 |
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \ |
292 |
$(RUN_IN_TEMPDIR) $(PYTHON) |
293 |
|
294 |
all_python_code = \ |
295 |
$(dist_sbin_SCRIPTS) \ |
296 |
$(dist_tools_SCRIPTS) \ |
297 |
$(dist_TESTS) \ |
298 |
$(pkgpython_PYTHON) \ |
299 |
$(hypervisor_PYTHON) \ |
300 |
$(rapi_PYTHON) \ |
301 |
$(http_PYTHON) \ |
302 |
$(confd_PYTHON) \ |
303 |
$(noinst_PYTHON) |
304 |
|
305 |
srclink_files = \ |
306 |
man/footer.sgml \ |
307 |
$(all_python_code) |
308 |
|
309 |
check_python_code = \ |
310 |
$(all_python_code) |
311 |
|
312 |
all-local: devel/upload \ |
313 |
doc/examples/bash_completion \ |
314 |
doc/examples/ganeti.initd doc/examples/ganeti.cron \ |
315 |
doc/examples/hooks/ipsec |
316 |
|
317 |
devel/upload: devel/upload.in $(REPLACE_VARS_SED) |
318 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
319 |
chmod u+x $@ |
320 |
|
321 |
daemons/ganeti-cleaner: daemons/ganeti-cleaner.in \ |
322 |
$(REPLACE_VARS_SED) |
323 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
324 |
chmod +x $@ |
325 |
|
326 |
doc/examples/%: doc/examples/%.in \ |
327 |
$(REPLACE_VARS_SED) |
328 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
329 |
|
330 |
doc/examples/hooks/%: doc/examples/hooks/%.in \ |
331 |
$(REPLACE_VARS_SED) |
332 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
333 |
|
334 |
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \ |
335 |
lib/cli.py $(gnt_scripts) tools/burnin |
336 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@ |
337 |
|
338 |
doc/%.png: doc/%.dot |
339 |
@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; } |
340 |
$(DOT) -Tpng -o $@ $< |
341 |
|
342 |
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) |
343 |
@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; } |
344 |
$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@ |
345 |
|
346 |
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) |
347 |
@test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; } |
348 |
$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@ |
349 |
|
350 |
man/%.7: man/%.7.in $(REPLACE_VARS_SED) |
351 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
352 |
|
353 |
man/%.8: man/%.8.in $(REPLACE_VARS_SED) |
354 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
355 |
|
356 |
man/%.html: man/%.html.in $(REPLACE_VARS_SED) |
357 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
358 |
|
359 |
lib/_autoconf.py: Makefile stamp-directories |
360 |
set -e; \ |
361 |
{ echo '# This file is automatically generated, do not edit!'; \ |
362 |
echo '#'; \ |
363 |
echo ''; \ |
364 |
echo '"""Build-time configuration for Ganeti.'; \ |
365 |
echo '';\ |
366 |
echo 'This file is autogenerated by the build process.'; \ |
367 |
echo 'For any changes you need to re-run ./configure (and'; \ |
368 |
echo 'not edit by hand).'; \ |
369 |
echo ''; \ |
370 |
echo '"""'; \ |
371 |
echo ''; \ |
372 |
echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \ |
373 |
echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \ |
374 |
echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \ |
375 |
echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \ |
376 |
echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \ |
377 |
echo "VERSION_FULL = '$(VERSION_FULL)'"; \ |
378 |
echo "LOCALSTATEDIR = '$(localstatedir)'"; \ |
379 |
echo "SYSCONFDIR = '$(sysconfdir)'"; \ |
380 |
echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \ |
381 |
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \ |
382 |
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \ |
383 |
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \ |
384 |
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \ |
385 |
echo "XEN_INITRD = '$(XEN_INITRD)'"; \ |
386 |
echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \ |
387 |
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \ |
388 |
echo "KVM_PATH = '$(KVM_PATH)'"; \ |
389 |
echo "KVM_MIGRATION_PORT = '$(KVM_MIGRATION_PORT)'"; \ |
390 |
echo "SOCAT_PATH = '$(SOCAT_PATH)'"; \ |
391 |
echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \ |
392 |
echo "TOOLSDIR = '$(toolsdir)'"; \ |
393 |
echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \ |
394 |
} > $@ |
395 |
|
396 |
$(REPLACE_VARS_SED): Makefile |
397 |
set -e; \ |
398 |
{ echo 's#@PREFIX@#$(prefix)#g'; \ |
399 |
echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \ |
400 |
echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \ |
401 |
echo 's#@BINDIR@#$(bindir)#g'; \ |
402 |
echo 's#@SBINDIR@#$(sbindir)#g'; \ |
403 |
echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \ |
404 |
echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \ |
405 |
echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \ |
406 |
echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \ |
407 |
echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \ |
408 |
echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \ |
409 |
} > $@ |
410 |
|
411 |
# We need to create symlinks because "make distcheck" will not install Python |
412 |
# files when building. |
413 |
srclinks: stamp-directories |
414 |
set -e; \ |
415 |
for i in $(srclink_files); do \ |
416 |
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \ |
417 |
$(LN_S) $(abs_top_srcdir)/$$i $$i; \ |
418 |
fi; \ |
419 |
done |
420 |
|
421 |
.PHONY: ganeti |
422 |
ganeti: |
423 |
cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; } |
424 |
|
425 |
check-local: |
426 |
$(CHECK_PYTHON_CODE) $(check_python_code) |
427 |
|
428 |
# a dist hook rule for catching revision control directories |
429 |
distcheck-hook: |
430 |
if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \ |
431 |
echo "Found revision control files in final archive" 1>&2 ; \ |
432 |
exit 1; \ |
433 |
fi |
434 |
|
435 |
install-exec-local: |
436 |
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \ |
437 |
"$(DESTDIR)${localstatedir}/log/ganeti" \ |
438 |
"$(DESTDIR)${localstatedir}/run/ganeti" |
439 |
|
440 |
stamp-directories: Makefile |
441 |
@mkdir_p@ $(DIRS) |
442 |
touch $@ |
443 |
|
444 |
.PHONY: apidoc |
445 |
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) |
446 |
test -e doc/api || mkdir doc/api |
447 |
$(RUN_IN_TEMPDIR) epydoc -v \ |
448 |
--conf $(CURDIR)/epydoc.conf \ |
449 |
--output $(CURDIR)/doc/api |
450 |
|
451 |
.PHONY: TAGS |
452 |
TAGS: |
453 |
rm -f TAGS |
454 |
find . -path './lib/*.py' -o -path 'scripts/gnt-*' -o \ |
455 |
-path 'daemons/ganeti-*' -o -path 'tools/*' | \ |
456 |
etags - |
457 |
|
458 |
# vim: set noet : |