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