root / Makefile.am @ ae1a845c
History | View | Annotate | Download (33.5 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 |
# Use bash in order to be able to use pipefail |
13 |
SHELL=/bin/bash |
14 |
|
15 |
ACLOCAL_AMFLAGS = -I autotools |
16 |
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion |
17 |
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir |
18 |
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code |
19 |
CHECK_MAN = $(top_srcdir)/autotools/check-man |
20 |
CHECK_VERSION = $(top_srcdir)/autotools/check-version |
21 |
CHECK_NEWS = $(top_srcdir)/autotools/check-news |
22 |
DOCPP = $(top_srcdir)/autotools/docpp |
23 |
REPLACE_VARS_SED = autotools/replace_vars.sed |
24 |
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants |
25 |
|
26 |
# Note: these are automake-specific variables, and must be named after |
27 |
# the directory + 'dir' suffix |
28 |
clientdir = $(pkgpythondir)/client |
29 |
hypervisordir = $(pkgpythondir)/hypervisor |
30 |
httpdir = $(pkgpythondir)/http |
31 |
masterddir = $(pkgpythondir)/masterd |
32 |
confddir = $(pkgpythondir)/confd |
33 |
rapidir = $(pkgpythondir)/rapi |
34 |
serverdir = $(pkgpythondir)/server |
35 |
watcherdir = $(pkgpythondir)/watcher |
36 |
impexpddir = $(pkgpythondir)/impexpd |
37 |
utilsdir = $(pkgpythondir)/utils |
38 |
toolsdir = $(pkglibdir)/tools |
39 |
iallocatorsdir = $(pkglibdir)/iallocators |
40 |
pytoolsdir = $(pkgpythondir)/tools |
41 |
docdir = $(datadir)/doc/$(PACKAGE) |
42 |
|
43 |
# Delete output file if an error occurred while building it |
44 |
.DELETE_ON_ERROR: |
45 |
|
46 |
HTOOLS_DIRS = \ |
47 |
htools \ |
48 |
htools/Ganeti \ |
49 |
htools/Ganeti/HTools \ |
50 |
htools/Ganeti/HTools/Program |
51 |
|
52 |
DIRS = \ |
53 |
autotools \ |
54 |
daemons \ |
55 |
devel \ |
56 |
doc \ |
57 |
doc/examples \ |
58 |
doc/examples/hooks \ |
59 |
doc/examples/gnt-debug \ |
60 |
$(HTOOLS_DIRS) \ |
61 |
lib \ |
62 |
lib/client \ |
63 |
lib/build \ |
64 |
lib/confd \ |
65 |
lib/http \ |
66 |
lib/hypervisor \ |
67 |
lib/impexpd \ |
68 |
lib/masterd \ |
69 |
lib/rapi \ |
70 |
lib/server \ |
71 |
lib/tools \ |
72 |
lib/utils \ |
73 |
lib/watcher \ |
74 |
man \ |
75 |
qa \ |
76 |
test \ |
77 |
test/data \ |
78 |
tools |
79 |
|
80 |
BUILDTIME_DIR_AUTOCREATE = \ |
81 |
scripts \ |
82 |
$(APIDOC_DIR) \ |
83 |
$(APIDOC_PY_DIR) \ |
84 |
$(APIDOC_HS_DIR) \ |
85 |
$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \ |
86 |
$(APIDOC_HS_DIR)/Ganeti/HTools/Program \ |
87 |
$(COVERAGE_DIR) \ |
88 |
$(COVERAGE_PY_DIR) \ |
89 |
$(COVERAGE_HS_DIR) \ |
90 |
.hpc |
91 |
|
92 |
BUILDTIME_DIRS = \ |
93 |
$(BUILDTIME_DIR_AUTOCREATE) \ |
94 |
doc/html |
95 |
|
96 |
DIRCHECK_EXCLUDE = \ |
97 |
$(BUILDTIME_DIRS) \ |
98 |
ganeti-[0-9]*.[0-9]*.[0-9]* \ |
99 |
doc/html/_* |
100 |
|
101 |
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE)) |
102 |
|
103 |
# some helper vars |
104 |
COVERAGE_DIR = doc/coverage |
105 |
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py |
106 |
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs |
107 |
APIDOC_DIR = doc/api |
108 |
APIDOC_PY_DIR = $(APIDOC_DIR)/py |
109 |
APIDOC_HS_DIR = $(APIDOC_DIR)/hs |
110 |
|
111 |
MAINTAINERCLEANFILES = \ |
112 |
$(docpng) \ |
113 |
$(maninput) \ |
114 |
doc/install-quick.rst \ |
115 |
doc/news.rst \ |
116 |
doc/upgrade.rst \ |
117 |
vcs-version |
118 |
|
119 |
maintainer-clean-local: |
120 |
rm -rf $(BUILDTIME_DIRS) |
121 |
|
122 |
CLEANFILES = \ |
123 |
$(addsuffix /*.py[co],$(DIRS)) \ |
124 |
$(addsuffix /*.hi,$(HTOOLS_DIRS)) \ |
125 |
$(addsuffix /*.o,$(HTOOLS_DIRS)) \ |
126 |
$(all_dirfiles) \ |
127 |
$(PYTHON_BOOTSTRAP) \ |
128 |
epydoc.conf \ |
129 |
autotools/replace_vars.sed \ |
130 |
daemons/daemon-util \ |
131 |
daemons/ganeti-cleaner \ |
132 |
devel/upload \ |
133 |
doc/examples/bash_completion \ |
134 |
doc/examples/ganeti.initd \ |
135 |
doc/examples/ganeti-kvm-poweroff.initd \ |
136 |
doc/examples/ganeti.cron \ |
137 |
doc/examples/gnt-config-backup \ |
138 |
doc/examples/hooks/ipsec \ |
139 |
$(man_MANS) \ |
140 |
$(manhtml) \ |
141 |
tools/kvm-ifup \ |
142 |
stamp-srclinks \ |
143 |
$(nodist_pkgpython_PYTHON) \ |
144 |
$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \ |
145 |
.hpc/*.mix htools/*.tix \ |
146 |
doc/hs-lint.html |
147 |
|
148 |
# BUILT_SOURCES should only be used as a dependency on phony targets. Otherwise |
149 |
# it'll cause the target to rebuild every time. |
150 |
BUILT_SOURCES = \ |
151 |
ganeti \ |
152 |
stamp-srclinks \ |
153 |
lib/_autoconf.py \ |
154 |
lib/_vcsversion.py \ |
155 |
$(all_dirfiles) \ |
156 |
$(PYTHON_BOOTSTRAP) |
157 |
|
158 |
nodist_pkgpython_PYTHON = \ |
159 |
lib/_autoconf.py \ |
160 |
lib/_vcsversion.py |
161 |
|
162 |
noinst_PYTHON = \ |
163 |
lib/build/__init__.py \ |
164 |
lib/build/sphinx_ext.py |
165 |
|
166 |
pkgpython_PYTHON = \ |
167 |
lib/__init__.py \ |
168 |
lib/asyncnotifier.py \ |
169 |
lib/backend.py \ |
170 |
lib/bdev.py \ |
171 |
lib/bootstrap.py \ |
172 |
lib/cli.py \ |
173 |
lib/cmdlib.py \ |
174 |
lib/compat.py \ |
175 |
lib/config.py \ |
176 |
lib/constants.py \ |
177 |
lib/daemon.py \ |
178 |
lib/errors.py \ |
179 |
lib/ht.py \ |
180 |
lib/jqueue.py \ |
181 |
lib/jstore.py \ |
182 |
lib/locking.py \ |
183 |
lib/luxi.py \ |
184 |
lib/mcpu.py \ |
185 |
lib/netutils.py \ |
186 |
lib/objects.py \ |
187 |
lib/opcodes.py \ |
188 |
lib/qlang.py \ |
189 |
lib/query.py \ |
190 |
lib/rpc.py \ |
191 |
lib/runtime.py \ |
192 |
lib/serializer.py \ |
193 |
lib/ssconf.py \ |
194 |
lib/ssh.py \ |
195 |
lib/storage.py \ |
196 |
lib/uidpool.py \ |
197 |
lib/workerpool.py |
198 |
|
199 |
client_PYTHON = \ |
200 |
lib/client/__init__.py \ |
201 |
lib/client/gnt_backup.py \ |
202 |
lib/client/gnt_cluster.py \ |
203 |
lib/client/gnt_debug.py \ |
204 |
lib/client/gnt_group.py \ |
205 |
lib/client/gnt_instance.py \ |
206 |
lib/client/gnt_job.py \ |
207 |
lib/client/gnt_node.py \ |
208 |
lib/client/gnt_os.py |
209 |
|
210 |
hypervisor_PYTHON = \ |
211 |
lib/hypervisor/__init__.py \ |
212 |
lib/hypervisor/hv_base.py \ |
213 |
lib/hypervisor/hv_chroot.py \ |
214 |
lib/hypervisor/hv_fake.py \ |
215 |
lib/hypervisor/hv_kvm.py \ |
216 |
lib/hypervisor/hv_lxc.py \ |
217 |
lib/hypervisor/hv_xen.py |
218 |
|
219 |
rapi_PYTHON = \ |
220 |
lib/rapi/__init__.py \ |
221 |
lib/rapi/baserlib.py \ |
222 |
lib/rapi/client.py \ |
223 |
lib/rapi/client_utils.py \ |
224 |
lib/rapi/connector.py \ |
225 |
lib/rapi/rlib2.py |
226 |
|
227 |
http_PYTHON = \ |
228 |
lib/http/__init__.py \ |
229 |
lib/http/auth.py \ |
230 |
lib/http/client.py \ |
231 |
lib/http/server.py |
232 |
|
233 |
confd_PYTHON = \ |
234 |
lib/confd/__init__.py \ |
235 |
lib/confd/client.py \ |
236 |
lib/confd/querylib.py \ |
237 |
lib/confd/server.py |
238 |
|
239 |
masterd_PYTHON = \ |
240 |
lib/masterd/__init__.py \ |
241 |
lib/masterd/instance.py |
242 |
|
243 |
impexpd_PYTHON = \ |
244 |
lib/impexpd/__init__.py |
245 |
|
246 |
watcher_PYTHON = \ |
247 |
lib/watcher/__init__.py |
248 |
|
249 |
server_PYTHON = \ |
250 |
lib/server/__init__.py \ |
251 |
lib/server/confd.py \ |
252 |
lib/server/masterd.py \ |
253 |
lib/server/noded.py \ |
254 |
lib/server/rapi.py |
255 |
|
256 |
pytools_PYTHON = \ |
257 |
lib/tools/__init__.py \ |
258 |
lib/tools/ensure_dirs.py |
259 |
|
260 |
utils_PYTHON = \ |
261 |
lib/utils/__init__.py \ |
262 |
lib/utils/algo.py \ |
263 |
lib/utils/filelock.py \ |
264 |
lib/utils/hash.py \ |
265 |
lib/utils/io.py \ |
266 |
lib/utils/log.py \ |
267 |
lib/utils/mlock.py \ |
268 |
lib/utils/nodesetup.py \ |
269 |
lib/utils/process.py \ |
270 |
lib/utils/retry.py \ |
271 |
lib/utils/text.py \ |
272 |
lib/utils/wrapper.py \ |
273 |
lib/utils/x509.py |
274 |
|
275 |
docrst = \ |
276 |
doc/admin.rst \ |
277 |
doc/design-2.0.rst \ |
278 |
doc/design-2.1.rst \ |
279 |
doc/design-2.2.rst \ |
280 |
doc/design-2.3.rst \ |
281 |
doc/design-htools-2.3.rst \ |
282 |
doc/design-2.4.rst \ |
283 |
doc/design-draft.rst \ |
284 |
doc/design-oob.rst \ |
285 |
doc/design-cpu-pinning.rst \ |
286 |
doc/design-query2.rst \ |
287 |
doc/design-x509-ca.rst \ |
288 |
doc/design-http-server.rst \ |
289 |
doc/design-impexp2.rst \ |
290 |
doc/design-lu-generated-jobs.rst \ |
291 |
doc/design-multi-reloc.rst \ |
292 |
doc/design-network.rst \ |
293 |
doc/design-chained-jobs.rst \ |
294 |
doc/cluster-merge.rst \ |
295 |
doc/design-shared-storage.rst \ |
296 |
doc/devnotes.rst \ |
297 |
doc/glossary.rst \ |
298 |
doc/hooks.rst \ |
299 |
doc/iallocator.rst \ |
300 |
doc/index.rst \ |
301 |
doc/install-quick.rst \ |
302 |
doc/install.rst \ |
303 |
doc/locking.rst \ |
304 |
doc/move-instance.rst \ |
305 |
doc/news.rst \ |
306 |
doc/rapi.rst \ |
307 |
doc/security.rst \ |
308 |
doc/upgrade.rst \ |
309 |
doc/walkthrough.rst |
310 |
|
311 |
HS_PROGS = htools/htools |
312 |
HS_BIN_ROLES = hbal hscan hspace |
313 |
|
314 |
HS_ALL_PROGS = $(HS_PROGS) htools/test |
315 |
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS)) |
316 |
# we don't add -Werror by default |
317 |
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools |
318 |
# extra flags that can be overriden on the command line |
319 |
HEXTRA = |
320 |
# exclude options for coverage reports |
321 |
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC \ |
322 |
--exclude Ganeti.Constants \ |
323 |
--exclude Ganeti.HTools.Version |
324 |
|
325 |
HS_LIB_SRCS = \ |
326 |
htools/Ganeti/HTools/CLI.hs \ |
327 |
htools/Ganeti/HTools/Cluster.hs \ |
328 |
htools/Ganeti/HTools/Compat.hs \ |
329 |
htools/Ganeti/HTools/Container.hs \ |
330 |
htools/Ganeti/HTools/ExtLoader.hs \ |
331 |
htools/Ganeti/HTools/Group.hs \ |
332 |
htools/Ganeti/HTools/IAlloc.hs \ |
333 |
htools/Ganeti/HTools/Instance.hs \ |
334 |
htools/Ganeti/HTools/Loader.hs \ |
335 |
htools/Ganeti/HTools/Luxi.hs \ |
336 |
htools/Ganeti/HTools/Node.hs \ |
337 |
htools/Ganeti/HTools/PeerMap.hs \ |
338 |
htools/Ganeti/HTools/QC.hs \ |
339 |
htools/Ganeti/HTools/Rapi.hs \ |
340 |
htools/Ganeti/HTools/Simu.hs \ |
341 |
htools/Ganeti/HTools/Text.hs \ |
342 |
htools/Ganeti/HTools/Types.hs \ |
343 |
htools/Ganeti/HTools/Utils.hs \ |
344 |
htools/Ganeti/HTools/Program/Hail.hs \ |
345 |
htools/Ganeti/HTools/Program/Hbal.hs \ |
346 |
htools/Ganeti/HTools/Program/Hscan.hs \ |
347 |
htools/Ganeti/HTools/Program/Hspace.hs \ |
348 |
htools/Ganeti/Jobs.hs \ |
349 |
htools/Ganeti/Luxi.hs \ |
350 |
htools/Ganeti/OpCodes.hs |
351 |
|
352 |
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs htools/Ganeti/Constants.hs |
353 |
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS)) |
354 |
|
355 |
$(RUN_IN_TEMPDIR): | $(all_dirfiles) |
356 |
|
357 |
# Note: we use here an order-only prerequisite, as the contents of |
358 |
# _autoconf.py are not actually influencing the html build output: it |
359 |
# has to exist in order for the sphinx module to be loaded |
360 |
# successfully, but we certainly don't want the docs to be rebuilt if |
361 |
# it changes |
362 |
doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \ |
363 |
$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \ |
364 |
| lib/_autoconf.py lib/_vcsversion.py |
365 |
@test -n "$(SPHINX)" || \ |
366 |
{ echo 'sphinx-build' not found during configure; exit 1; } |
367 |
@mkdir_p@ $(dir $@) |
368 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \ |
369 |
-d . \ |
370 |
-D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \ |
371 |
-D release="$(PACKAGE_VERSION)" \ |
372 |
$(abs_top_srcdir)/doc $(CURDIR)/doc/html |
373 |
rm -f doc/html/.buildinfo doc/html/objects.inv |
374 |
touch $@ |
375 |
|
376 |
doc/html: doc/html/index.html |
377 |
|
378 |
doc/install-quick.rst: INSTALL |
379 |
doc/news.rst: NEWS |
380 |
doc/upgrade.rst: UPGRADE |
381 |
|
382 |
doc/install-quick.rst doc/news.rst doc/upgrade.rst: |
383 |
set -e; \ |
384 |
{ echo '.. This file is automatically updated at build time from $<.'; \ |
385 |
echo '.. Do not edit.'; \ |
386 |
echo; \ |
387 |
cat $<; \ |
388 |
} > $@ |
389 |
|
390 |
docdot = \ |
391 |
doc/arch-2.0.dot \ |
392 |
doc/design-2.1-lock-acquire.dot \ |
393 |
doc/design-2.1-lock-release.dot |
394 |
|
395 |
docpng = $(patsubst %.dot,%.png,$(docdot)) |
396 |
|
397 |
# Things to build but not to install (add it to EXTRA_DIST if it should be |
398 |
# distributed) |
399 |
noinst_DATA = \ |
400 |
devel/upload \ |
401 |
doc/html \ |
402 |
doc/examples/bash_completion \ |
403 |
doc/examples/ganeti.cron \ |
404 |
doc/examples/ganeti.initd \ |
405 |
doc/examples/ganeti-kvm-poweroff.initd \ |
406 |
doc/examples/gnt-config-backup \ |
407 |
doc/examples/hooks/ipsec \ |
408 |
$(manhtml) |
409 |
|
410 |
gnt_scripts = \ |
411 |
scripts/gnt-backup \ |
412 |
scripts/gnt-cluster \ |
413 |
scripts/gnt-debug \ |
414 |
scripts/gnt-group \ |
415 |
scripts/gnt-instance \ |
416 |
scripts/gnt-job \ |
417 |
scripts/gnt-node \ |
418 |
scripts/gnt-os |
419 |
|
420 |
PYTHON_BOOTSTRAP_SBIN = \ |
421 |
daemons/ganeti-confd \ |
422 |
daemons/ganeti-masterd \ |
423 |
daemons/ganeti-noded \ |
424 |
daemons/ganeti-watcher \ |
425 |
daemons/ganeti-rapi \ |
426 |
scripts/gnt-backup \ |
427 |
scripts/gnt-cluster \ |
428 |
scripts/gnt-debug \ |
429 |
scripts/gnt-group \ |
430 |
scripts/gnt-instance \ |
431 |
scripts/gnt-job \ |
432 |
scripts/gnt-node \ |
433 |
scripts/gnt-os |
434 |
|
435 |
PYTHON_BOOTSTRAP = \ |
436 |
$(PYTHON_BOOTSTRAP_SBIN) \ |
437 |
tools/ensure-dirs |
438 |
|
439 |
qa_scripts = \ |
440 |
qa/ganeti-qa.py \ |
441 |
qa/qa_cluster.py \ |
442 |
qa/qa_config.py \ |
443 |
qa/qa_daemon.py \ |
444 |
qa/qa_env.py \ |
445 |
qa/qa_error.py \ |
446 |
qa/qa_instance.py \ |
447 |
qa/qa_node.py \ |
448 |
qa/qa_os.py \ |
449 |
qa/qa_rapi.py \ |
450 |
qa/qa_tags.py \ |
451 |
qa/qa_utils.py |
452 |
|
453 |
bin_SCRIPTS = |
454 |
if WANT_HTOOLS |
455 |
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS)) |
456 |
install-exec-hook: |
457 |
@mkdir_p@ $(DESTDIR)$(iallocatorsdir) |
458 |
$(LN_S) -f $(DESTDIR)$(bindir)/htools \ |
459 |
$(DESTDIR)$(iallocatorsdir)/hail |
460 |
for role in $(HS_BIN_ROLES); do \ |
461 |
$(LN_S) -f $(DESTDIR)$(bindir)/htools \ |
462 |
$(DESTDIR)$(bindir)/$$role ; \ |
463 |
done |
464 |
endif |
465 |
|
466 |
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile |
467 |
@if [ -z "$(HTOOLS)" ]; then \ |
468 |
echo "Error: htools compilation disabled at configure time" 1>&2 ;\ |
469 |
exit 1; \ |
470 |
fi |
471 |
@BINARY=$(@:htools/%=%); \ |
472 |
if [ "$BINARY" = "test" ] && [ -z "$(GHC_PKG_QUICKCHECK)" ]; then \ |
473 |
echo "Error: cannot run unittests without the QuickCheck library (see devnotes.rst)" 1>&2; \ |
474 |
exit 1; \ |
475 |
fi |
476 |
BINARY=$(@:htools/%=%); $(GHC) --make \ |
477 |
$(HFLAGS) $(HEXTRA) \ |
478 |
$(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \ |
479 |
-osuf $$BINARY.o -hisuf $$BINARY.hi $@ |
480 |
|
481 |
# for the htools/test binary, we need to enable profiling/coverage |
482 |
htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \ |
483 |
-fno-warn-monomorphism-restriction -fno-warn-orphans \ |
484 |
-fno-warn-missing-methods -fno-warn-unused-imports |
485 |
|
486 |
dist_sbin_SCRIPTS = \ |
487 |
tools/ganeti-listrunner |
488 |
|
489 |
nodist_sbin_SCRIPTS = \ |
490 |
$(PYTHON_BOOTSTRAP_SBIN) \ |
491 |
daemons/ganeti-cleaner |
492 |
|
493 |
dist_tools_PYTHON = \ |
494 |
tools/burnin \ |
495 |
tools/cfgshell \ |
496 |
tools/cfgupgrade \ |
497 |
tools/cfgupgrade12 \ |
498 |
tools/cluster-merge \ |
499 |
tools/lvmstrap \ |
500 |
tools/move-instance \ |
501 |
tools/setup-ssh \ |
502 |
tools/sanitize-config |
503 |
|
504 |
dist_tools_SCRIPTS = \ |
505 |
$(dist_tools_PYTHON) \ |
506 |
tools/kvm-console-wrapper \ |
507 |
tools/xm-console-wrapper |
508 |
|
509 |
pkglib_python_scripts = \ |
510 |
daemons/import-export \ |
511 |
tools/check-cert-expired |
512 |
|
513 |
nodist_pkglib_python_scripts = \ |
514 |
tools/ensure-dirs |
515 |
|
516 |
pkglib_SCRIPTS = \ |
517 |
daemons/daemon-util \ |
518 |
tools/kvm-ifup \ |
519 |
$(pkglib_python_scripts) |
520 |
|
521 |
nodist_pkglib_SCRIPTS = \ |
522 |
$(nodist_pkglib_python_scripts) |
523 |
|
524 |
EXTRA_DIST = \ |
525 |
NEWS \ |
526 |
UPGRADE \ |
527 |
epydoc.conf.in \ |
528 |
pylintrc \ |
529 |
autotools/build-bash-completion \ |
530 |
autotools/check-python-code \ |
531 |
autotools/check-man \ |
532 |
autotools/check-news \ |
533 |
autotools/check-tar \ |
534 |
autotools/check-version \ |
535 |
autotools/convert-constants \ |
536 |
autotools/docpp \ |
537 |
autotools/gen-coverage \ |
538 |
autotools/testrunner \ |
539 |
$(RUN_IN_TEMPDIR) \ |
540 |
daemons/daemon-util.in \ |
541 |
daemons/ganeti-cleaner.in \ |
542 |
$(pkglib_python_scripts) \ |
543 |
devel/upload.in \ |
544 |
tools/kvm-ifup.in \ |
545 |
$(docdot) \ |
546 |
$(docpng) \ |
547 |
$(docrst) \ |
548 |
doc/conf.py \ |
549 |
doc/html \ |
550 |
doc/examples/ganeti.initd.in \ |
551 |
doc/examples/ganeti-kvm-poweroff.initd.in \ |
552 |
doc/examples/ganeti.cron.in \ |
553 |
doc/examples/gnt-config-backup.in \ |
554 |
doc/examples/ganeti.default \ |
555 |
doc/examples/ganeti.default-debug \ |
556 |
doc/examples/hooks/ethers \ |
557 |
doc/examples/hooks/ipsec.in \ |
558 |
doc/examples/gnt-debug/README \ |
559 |
doc/examples/gnt-debug/delay0.json \ |
560 |
doc/examples/gnt-debug/delay50.json \ |
561 |
test/testutils.py \ |
562 |
test/mocks.py \ |
563 |
$(dist_TESTS) \ |
564 |
$(TEST_FILES) \ |
565 |
man/footer.rst \ |
566 |
$(manrst) \ |
567 |
$(maninput) \ |
568 |
qa/qa-sample.json \ |
569 |
$(qa_scripts) \ |
570 |
$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \ |
571 |
$(HS_PROG_SRCS) |
572 |
|
573 |
man_MANS = \ |
574 |
man/ganeti.7 \ |
575 |
man/ganeti-cleaner.8 \ |
576 |
man/ganeti-confd.8 \ |
577 |
man/ganeti-listrunner.8 \ |
578 |
man/ganeti-masterd.8 \ |
579 |
man/ganeti-noded.8 \ |
580 |
man/ganeti-os-interface.7 \ |
581 |
man/ganeti-rapi.8 \ |
582 |
man/ganeti-watcher.8 \ |
583 |
man/gnt-backup.8 \ |
584 |
man/gnt-cluster.8 \ |
585 |
man/gnt-debug.8 \ |
586 |
man/gnt-group.8 \ |
587 |
man/gnt-instance.8 \ |
588 |
man/gnt-job.8 \ |
589 |
man/gnt-node.8 \ |
590 |
man/gnt-os.8 \ |
591 |
man/hail.1 \ |
592 |
man/hbal.1 \ |
593 |
man/hscan.1 \ |
594 |
man/hspace.1 \ |
595 |
man/htools.1 |
596 |
|
597 |
manrst = $(patsubst %.1,%.rst,$(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))) |
598 |
manhtml = $(patsubst %.rst,%.html,$(manrst)) |
599 |
mangen = $(patsubst %.rst,%.gen,$(manrst)) |
600 |
maninput = \ |
601 |
$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \ |
602 |
$(patsubst %.html,%.html.in,$(manhtml)) \ |
603 |
man/footer.man man/footer.html $(mangen) |
604 |
|
605 |
TEST_FILES = \ |
606 |
test/data/bdev-drbd-8.0.txt \ |
607 |
test/data/bdev-drbd-8.3.txt \ |
608 |
test/data/bdev-drbd-disk.txt \ |
609 |
test/data/bdev-drbd-net-ip4.txt \ |
610 |
test/data/bdev-drbd-net-ip6.txt \ |
611 |
test/data/cert1.pem \ |
612 |
test/data/proc_drbd8.txt \ |
613 |
test/data/proc_drbd80-emptyline.txt \ |
614 |
test/data/proc_drbd83.txt \ |
615 |
test/data/sys_drbd_usermode_helper.txt \ |
616 |
test/import-export_unittest-helper |
617 |
|
618 |
python_tests = \ |
619 |
test/ganeti.asyncnotifier_unittest.py \ |
620 |
test/ganeti.backend_unittest.py \ |
621 |
test/ganeti.bdev_unittest.py \ |
622 |
test/ganeti.cli_unittest.py \ |
623 |
test/ganeti.client.gnt_cluster_unittest.py \ |
624 |
test/ganeti.client.gnt_instance_unittest.py \ |
625 |
test/ganeti.daemon_unittest.py \ |
626 |
test/ganeti.cmdlib_unittest.py \ |
627 |
test/ganeti.compat_unittest.py \ |
628 |
test/ganeti.confd.client_unittest.py \ |
629 |
test/ganeti.config_unittest.py \ |
630 |
test/ganeti.constants_unittest.py \ |
631 |
test/ganeti.errors_unittest.py \ |
632 |
test/ganeti.hooks_unittest.py \ |
633 |
test/ganeti.ht_unittest.py \ |
634 |
test/ganeti.http_unittest.py \ |
635 |
test/ganeti.hypervisor_unittest.py \ |
636 |
test/ganeti.hypervisor.hv_chroot_unittest.py \ |
637 |
test/ganeti.hypervisor.hv_fake_unittest.py \ |
638 |
test/ganeti.hypervisor.hv_kvm_unittest.py \ |
639 |
test/ganeti.hypervisor.hv_lxc_unittest.py \ |
640 |
test/ganeti.hypervisor.hv_xen_unittest.py \ |
641 |
test/ganeti.impexpd_unittest.py \ |
642 |
test/ganeti.jqueue_unittest.py \ |
643 |
test/ganeti.locking_unittest.py \ |
644 |
test/ganeti.luxi_unittest.py \ |
645 |
test/ganeti.masterd.instance_unittest.py \ |
646 |
test/ganeti.mcpu_unittest.py \ |
647 |
test/ganeti.netutils_unittest.py \ |
648 |
test/ganeti.objects_unittest.py \ |
649 |
test/ganeti.opcodes_unittest.py \ |
650 |
test/ganeti.qlang_unittest.py \ |
651 |
test/ganeti.query_unittest.py \ |
652 |
test/ganeti.rapi.baserlib_unittest.py \ |
653 |
test/ganeti.rapi.client_unittest.py \ |
654 |
test/ganeti.rapi.resources_unittest.py \ |
655 |
test/ganeti.rapi.rlib2_unittest.py \ |
656 |
test/ganeti.rpc_unittest.py \ |
657 |
test/ganeti.runtime_unittest.py \ |
658 |
test/ganeti.serializer_unittest.py \ |
659 |
test/ganeti.ssh_unittest.py \ |
660 |
test/ganeti.tools.ensure_dirs_unittest.py \ |
661 |
test/ganeti.uidpool_unittest.py \ |
662 |
test/ganeti.utils.algo_unittest.py \ |
663 |
test/ganeti.utils.filelock_unittest.py \ |
664 |
test/ganeti.utils.hash_unittest.py \ |
665 |
test/ganeti.utils.io_unittest.py \ |
666 |
test/ganeti.utils.log_unittest.py \ |
667 |
test/ganeti.utils.mlock_unittest.py \ |
668 |
test/ganeti.utils.nodesetup_unittest.py \ |
669 |
test/ganeti.utils.process_unittest.py \ |
670 |
test/ganeti.utils.retry_unittest.py \ |
671 |
test/ganeti.utils.text_unittest.py \ |
672 |
test/ganeti.utils.wrapper_unittest.py \ |
673 |
test/ganeti.utils.x509_unittest.py \ |
674 |
test/ganeti.utils_unittest.py \ |
675 |
test/ganeti.workerpool_unittest.py \ |
676 |
test/cfgupgrade_unittest.py \ |
677 |
test/docs_unittest.py \ |
678 |
test/tempfile_fork_unittest.py |
679 |
|
680 |
haskell_tests = htools/test |
681 |
|
682 |
dist_TESTS = \ |
683 |
test/check-cert-expired_unittest.bash \ |
684 |
test/daemon-util_unittest.bash \ |
685 |
test/ganeti-cleaner_unittest.bash \ |
686 |
test/import-export_unittest.bash \ |
687 |
$(python_tests) |
688 |
|
689 |
nodist_TESTS = |
690 |
if WANT_HTOOLSTESTS |
691 |
nodist_TESTS += $(haskell_tests) |
692 |
endif |
693 |
|
694 |
TESTS = $(dist_TESTS) $(nodist_TESTS) |
695 |
|
696 |
# Environment for all tests |
697 |
PLAIN_TESTS_ENVIRONMENT = \ |
698 |
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR) |
699 |
|
700 |
# Environment for tests run by automake |
701 |
TESTS_ENVIRONMENT = \ |
702 |
$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner |
703 |
|
704 |
all_python_code = \ |
705 |
$(dist_sbin_SCRIPTS) \ |
706 |
$(dist_tools_PYTHON) \ |
707 |
$(pkglib_python_scripts) \ |
708 |
$(nodist_pkglib_python_scripts) \ |
709 |
$(python_tests) \ |
710 |
$(pkgpython_PYTHON) \ |
711 |
$(client_PYTHON) \ |
712 |
$(hypervisor_PYTHON) \ |
713 |
$(rapi_PYTHON) \ |
714 |
$(server_PYTHON) \ |
715 |
$(pytools_PYTHON) \ |
716 |
$(http_PYTHON) \ |
717 |
$(confd_PYTHON) \ |
718 |
$(masterd_PYTHON) \ |
719 |
$(impexpd_PYTHON) \ |
720 |
$(utils_PYTHON) \ |
721 |
$(watcher_PYTHON) \ |
722 |
$(noinst_PYTHON) \ |
723 |
$(qa_scripts) |
724 |
|
725 |
srclink_files = \ |
726 |
man/footer.rst \ |
727 |
test/check-cert-expired_unittest.bash \ |
728 |
test/daemon-util_unittest.bash \ |
729 |
test/ganeti-cleaner_unittest.bash \ |
730 |
test/import-export_unittest.bash \ |
731 |
$(all_python_code) \ |
732 |
$(HS_LIB_SRCS) $(HS_PROG_SRCS) |
733 |
|
734 |
check_python_code = \ |
735 |
$(BUILD_BASH_COMPLETION) \ |
736 |
$(DOCPP) \ |
737 |
$(all_python_code) |
738 |
|
739 |
lint_python_code = \ |
740 |
ganeti \ |
741 |
ganeti/http/server.py \ |
742 |
$(dist_sbin_SCRIPTS) \ |
743 |
$(dist_tools_PYTHON) \ |
744 |
$(pkglib_python_scripts) \ |
745 |
$(BUILD_BASH_COMPLETION) \ |
746 |
$(DOCPP) \ |
747 |
$(PYTHON_BOOTSTRAP) |
748 |
|
749 |
test/daemon-util_unittest.bash: daemons/daemon-util |
750 |
|
751 |
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner |
752 |
|
753 |
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED) |
754 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
755 |
chmod +x $@ |
756 |
|
757 |
devel/upload: devel/upload.in $(REPLACE_VARS_SED) |
758 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
759 |
chmod u+x $@ |
760 |
|
761 |
daemons/%: daemons/%.in $(REPLACE_VARS_SED) |
762 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
763 |
chmod +x $@ |
764 |
|
765 |
doc/examples/%: doc/examples/%.in $(REPLACE_VARS_SED) |
766 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
767 |
|
768 |
doc/examples/hooks/%: doc/examples/hooks/%.in $(REPLACE_VARS_SED) |
769 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
770 |
|
771 |
doc/examples/bash_completion: $(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \ |
772 |
lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin |
773 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_BASH_COMPLETION) > $@ |
774 |
|
775 |
doc/%.png: doc/%.dot |
776 |
@test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; } |
777 |
$(DOT) -Tpng -o $@ $< |
778 |
|
779 |
man/footer.man: man/footer.rst |
780 |
@test -n "$(PANDOC)" || \ |
781 |
{ echo 'pandoc' not found during configure; exit 1; } |
782 |
$(PANDOC) -f rst -t man -o $@ $< |
783 |
|
784 |
man/footer.html: man/footer.rst |
785 |
@test -n "$(PANDOC)" || \ |
786 |
{ echo 'pandoc' not found during configure; exit 1; } |
787 |
$(PANDOC) -f rst -t html -o $@ $< |
788 |
|
789 |
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py |
790 |
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ |
791 |
|
792 |
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man |
793 |
@test -n "$(PANDOC)" || \ |
794 |
{ echo 'pandoc' not found during configure; exit 1; } |
795 |
set -o pipefail ; \ |
796 |
$(PANDOC) -s -f rst -t man -A man/footer.man $< | \ |
797 |
sed -e 's/\\@/@/g' > $@ |
798 |
if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi |
799 |
|
800 |
man/%.html.in: man/%.gen man/footer.html |
801 |
@test -n "$(PANDOC)" || \ |
802 |
{ echo 'pandoc' not found during configure; exit 1; } |
803 |
set -o pipefail ; \ |
804 |
$(PANDOC) -s -f rst -t html -A man/footer.html $< | \ |
805 |
sed -e 's/\\@/@/g' > $@ |
806 |
|
807 |
man/%.1: man/%.1.in $(REPLACE_VARS_SED) |
808 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
809 |
|
810 |
man/%.7: man/%.7.in $(REPLACE_VARS_SED) |
811 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
812 |
|
813 |
man/%.8: man/%.8.in $(REPLACE_VARS_SED) |
814 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
815 |
|
816 |
man/%.html: man/%.html.in $(REPLACE_VARS_SED) |
817 |
sed -f $(REPLACE_VARS_SED) < $< > $@ |
818 |
|
819 |
epydoc.conf: epydoc.conf.in Makefile |
820 |
sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@ |
821 |
|
822 |
vcs-version: |
823 |
if test -d .git; then \ |
824 |
git describe > $@; \ |
825 |
elif test ! -f $@ ; then \ |
826 |
echo "Cannot auto-generate $@ file"; exit 1; \ |
827 |
fi |
828 |
|
829 |
.PHONY: regen-vcs-version |
830 |
regen-vcs-version: |
831 |
set -e; \ |
832 |
cd $(srcdir); \ |
833 |
if test -d .git; then \ |
834 |
rm -f vcs-version; \ |
835 |
$(MAKE) vcs-version; \ |
836 |
fi |
837 |
|
838 |
htools/Ganeti/HTools/Version.hs: htools/Ganeti/HTools/Version.hs.in vcs-version |
839 |
set -e; \ |
840 |
VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \ |
841 |
sed -e "s/%ver%/$$VCSVER/" < $< > $@ |
842 |
|
843 |
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \ |
844 |
lib/constants.py lib/_autoconf.py $(CONVERT_CONSTANTS) |
845 |
set -e; \ |
846 |
{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@ |
847 |
|
848 |
lib/_autoconf.py: Makefile | lib/.dir |
849 |
set -e; \ |
850 |
{ echo '# This file is automatically generated, do not edit!'; \ |
851 |
echo '#'; \ |
852 |
echo ''; \ |
853 |
echo '"""Build-time configuration for Ganeti.'; \ |
854 |
echo '';\ |
855 |
echo 'This file is autogenerated by the build process.'; \ |
856 |
echo 'For any changes you need to re-run ./configure (and'; \ |
857 |
echo 'not edit by hand).'; \ |
858 |
echo ''; \ |
859 |
echo '"""'; \ |
860 |
echo ''; \ |
861 |
echo '# pylint: disable-msg=C0301,C0324'; \ |
862 |
echo '# because this is autogenerated, we do not want'; \ |
863 |
echo '# style warnings' ; \ |
864 |
echo ''; \ |
865 |
echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \ |
866 |
echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \ |
867 |
echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \ |
868 |
echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \ |
869 |
echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \ |
870 |
echo "VERSION_FULL = '$(VERSION_FULL)'"; \ |
871 |
echo "LOCALSTATEDIR = '$(localstatedir)'"; \ |
872 |
echo "SYSCONFDIR = '$(sysconfdir)'"; \ |
873 |
echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \ |
874 |
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \ |
875 |
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \ |
876 |
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \ |
877 |
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \ |
878 |
echo "XEN_INITRD = '$(XEN_INITRD)'"; \ |
879 |
echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \ |
880 |
echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \ |
881 |
echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \ |
882 |
echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \ |
883 |
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \ |
884 |
echo "KVM_PATH = '$(KVM_PATH)'"; \ |
885 |
echo "SOCAT_PATH = '$(SOCAT)'"; \ |
886 |
echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \ |
887 |
echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \ |
888 |
echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \ |
889 |
echo "TOOLSDIR = '$(toolsdir)'"; \ |
890 |
echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \ |
891 |
echo "PKGLIBDIR = '$(pkglibdir)'"; \ |
892 |
echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \ |
893 |
echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \ |
894 |
echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \ |
895 |
echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \ |
896 |
echo "MASTERD_USER = '$(MASTERD_USER)'"; \ |
897 |
echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \ |
898 |
echo "RAPI_USER = '$(RAPI_USER)'"; \ |
899 |
echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \ |
900 |
echo "CONFD_USER = '$(CONFD_USER)'"; \ |
901 |
echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \ |
902 |
echo "NODED_USER = '$(NODED_USER)'"; \ |
903 |
echo "NODED_GROUP = '$(NODED_GROUP)'"; \ |
904 |
echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \ |
905 |
if [ "$(HTOOLS)" ]; then \ |
906 |
echo "HTOOLS = True"; \ |
907 |
else \ |
908 |
echo "HTOOLS = False"; \ |
909 |
fi; \ |
910 |
} > $@ |
911 |
|
912 |
lib/_vcsversion.py: Makefile vcs-version | lib/.dir |
913 |
set -e; \ |
914 |
VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \ |
915 |
{ echo '# This file is automatically generated, do not edit!'; \ |
916 |
echo '#'; \ |
917 |
echo ''; \ |
918 |
echo '"""Build-time VCS version number for Ganeti.'; \ |
919 |
echo '';\ |
920 |
echo 'This file is autogenerated by the build process.'; \ |
921 |
echo 'For any changes you need to re-run ./configure (and'; \ |
922 |
echo 'not edit by hand).'; \ |
923 |
echo ''; \ |
924 |
echo '"""'; \ |
925 |
echo ''; \ |
926 |
echo '# pylint: disable-msg=C0301,C0324'; \ |
927 |
echo '# because this is autogenerated, we do not want'; \ |
928 |
echo '# style warnings' ; \ |
929 |
echo ''; \ |
930 |
echo "VCS_VERSION = '$$VCSVER'"; \ |
931 |
} > $@ |
932 |
|
933 |
$(REPLACE_VARS_SED): Makefile |
934 |
set -e; \ |
935 |
{ echo 's#@PREFIX@#$(prefix)#g'; \ |
936 |
echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \ |
937 |
echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \ |
938 |
echo 's#@BINDIR@#$(bindir)#g'; \ |
939 |
echo 's#@SBINDIR@#$(sbindir)#g'; \ |
940 |
echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \ |
941 |
echo 's#@CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \ |
942 |
echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \ |
943 |
echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \ |
944 |
echo 's#@CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \ |
945 |
echo 's#@CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \ |
946 |
echo 's#@RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \ |
947 |
echo 's#@RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \ |
948 |
echo 's#@PKGLIBDIR@#$(pkglibdir)#g'; \ |
949 |
echo 's#@GNTMASTERUSER@#$(MASTERD_USER)#g'; \ |
950 |
echo 's#@GNTRAPIUSER@#$(RAPI_USER)#g'; \ |
951 |
echo 's#@GNTCONFDUSER@#$(CONFD_USER)#g'; \ |
952 |
echo 's#@GNTNODEDUSER@#$(NODED_USER)#g'; \ |
953 |
echo 's#@GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \ |
954 |
echo 's#@GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \ |
955 |
echo 's#@GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \ |
956 |
echo 's#@GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \ |
957 |
echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \ |
958 |
} > $@ |
959 |
|
960 |
# Using deferred evaluation |
961 |
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@)) |
962 |
daemons/ganeti-watcher: MODULE = ganeti.watcher |
963 |
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@)) |
964 |
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs |
965 |
|
966 |
$(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles) |
967 |
test -n "$(MODULE)" || { echo Missing module; exit 1; } |
968 |
set -e; \ |
969 |
{ echo '#!/usr/bin/python'; \ |
970 |
echo '# This file is automatically generated, do not edit!'; \ |
971 |
echo "# Edit $(MODULE) instead."; \ |
972 |
echo; \ |
973 |
echo '"""Bootstrap script for L{$(MODULE)}"""'; \ |
974 |
echo; \ |
975 |
echo '# pylint: disable-msg=C0103'; \ |
976 |
echo '# C0103: Invalid name'; \ |
977 |
echo; \ |
978 |
echo 'import sys'; \ |
979 |
echo 'import $(MODULE) as main'; \ |
980 |
echo; \ |
981 |
echo '# Temporarily alias commands until bash completion'; \ |
982 |
echo '# generator is changed'; \ |
983 |
echo 'if hasattr(main, "commands"):'; \ |
984 |
echo ' commands = main.commands # pylint: disable-msg=E1101'; \ |
985 |
echo 'if hasattr(main, "aliases"):'; \ |
986 |
echo ' aliases = main.aliases # pylint: disable-msg=E1101'; \ |
987 |
echo; \ |
988 |
echo 'if __name__ == "__main__":'; \ |
989 |
echo ' sys.exit(main.Main())'; \ |
990 |
} > $@ |
991 |
chmod u+x $@ |
992 |
|
993 |
# We need to create symlinks because "make distcheck" will not install Python |
994 |
# files when building. |
995 |
stamp-srclinks: Makefile | $(all_dirfiles) |
996 |
set -e; \ |
997 |
for i in $(srclink_files); do \ |
998 |
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \ |
999 |
$(LN_S) $(abs_top_srcdir)/$$i $$i; \ |
1000 |
fi; \ |
1001 |
done |
1002 |
touch $@ |
1003 |
|
1004 |
.PHONY: ganeti |
1005 |
ganeti: |
1006 |
cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; } |
1007 |
|
1008 |
.PHONY: check-dirs |
1009 |
check-dirs: $(BUILT_SOURCES) |
1010 |
@set -e; \ |
1011 |
find . -type d \( \( -name . \) -o \( \ |
1012 |
-name .git -o \ |
1013 |
-name autom4te.cache \ |
1014 |
\) -prune -o -print \) | { \ |
1015 |
error=; \ |
1016 |
while read dir; do \ |
1017 |
case "$$dir" in \ |
1018 |
$(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \ |
1019 |
*) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \ |
1020 |
esac; \ |
1021 |
done; \ |
1022 |
for dir in $(DIRS); do \ |
1023 |
if ! test -d "$$dir"; then \ |
1024 |
echo "Directory $$dir listed in DIRS does not exist" >&2; \ |
1025 |
error=1; \ |
1026 |
fi \ |
1027 |
done; \ |
1028 |
if test -n "$$error"; then exit 1; else exit 0; fi; \ |
1029 |
} |
1030 |
|
1031 |
check-local: check-dirs |
1032 |
$(CHECK_PYTHON_CODE) $(check_python_code) |
1033 |
$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS |
1034 |
$(CHECK_NEWS) < $(top_srcdir)/NEWS |
1035 |
expver=$(VERSION_MAJOR).$(VERSION_MINOR); \ |
1036 |
if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \ |
1037 |
echo "Incorrect version in README, expected $$expver"; \ |
1038 |
exit 1; \ |
1039 |
fi; \ |
1040 |
if test "`sed -ne '4 p' $(top_srcdir)/doc/iallocator.rst`" != \ |
1041 |
"Documents Ganeti version $$expver"; then \ |
1042 |
echo "Incorrect version in iallocator.rst, expected $$expver"; \ |
1043 |
exit 1; \ |
1044 |
fi |
1045 |
|
1046 |
.PHONY: hs-check |
1047 |
hs-check: htools/test |
1048 |
@rm -f test.tix |
1049 |
./htools/test |
1050 |
|
1051 |
.PHONY: lint |
1052 |
lint: $(BUILT_SOURCES) |
1053 |
@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; } |
1054 |
$(PYLINT) $(LINT_OPTS) $(lint_python_code) |
1055 |
cd $(top_srcdir)/qa && \ |
1056 |
PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \ |
1057 |
--rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts)) |
1058 |
|
1059 |
.PHONY: hlint |
1060 |
hlint: $(HS_BUILT_SRCS) |
1061 |
if tty -s; then C="-c"; else C=""; fi; \ |
1062 |
hlint --report=doc/hs-lint.html $$C htools |
1063 |
|
1064 |
# a dist hook rule for updating the vcs-version file; this is |
1065 |
# hardcoded due to where it needs to build the file... |
1066 |
dist-hook: |
1067 |
$(MAKE) regen-vcs-version && \ |
1068 |
rm -f $(top_distdir)/vcs-version && \ |
1069 |
cp -p $(srcdir)/vcs-version $(top_distdir) |
1070 |
|
1071 |
# a distcheck hook rule for catching revision control directories |
1072 |
distcheck-hook: |
1073 |
if find $(top_distdir) -name .svn -or -name .git | grep .; then \ |
1074 |
echo "Found revision control files in final archive." 1>&2; \ |
1075 |
exit 1; \ |
1076 |
fi |
1077 |
if find $(top_distdir) -name '*.py[co]' | grep .; then \ |
1078 |
echo "Found Python byte code in final archive." 1>&2; \ |
1079 |
exit 1; \ |
1080 |
fi |
1081 |
if find $(top_distdir) -name '*~' | grep .; then \ |
1082 |
echo "Found backup files in final archive." 1>&2; \ |
1083 |
exit 1; \ |
1084 |
fi |
1085 |
# Empty files or directories should not be distributed. They can cause |
1086 |
# unnecessary warnings for packagers. Directories used by automake during |
1087 |
# distcheck must be excluded. |
1088 |
if find $(top_distdir) -empty -and -not \( \ |
1089 |
-path $(top_distdir)/_build -or \ |
1090 |
-path $(top_distdir)/_inst \) | grep .; then \ |
1091 |
echo "Found empty files or directories in final archive." 1>&2; \ |
1092 |
exit 1; \ |
1093 |
fi |
1094 |
if test -n "$(BUILD_RELEASE)" && \ |
1095 |
grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \ |
1096 |
echo "Found unreleased version in NEWS." >&2; \ |
1097 |
exit 1; \ |
1098 |
fi |
1099 |
|
1100 |
# When building a release, stricter checks should be used |
1101 |
distcheck-release dist-release: export BUILD_RELEASE = 1 |
1102 |
distcheck-release: distcheck |
1103 |
|
1104 |
dist-release: dist |
1105 |
set -e; \ |
1106 |
for i in $(DIST_ARCHIVES); do \ |
1107 |
echo -n "Checking $$i ... "; \ |
1108 |
autotools/check-tar < $$i; \ |
1109 |
echo OK; \ |
1110 |
done |
1111 |
|
1112 |
install-exec-local: |
1113 |
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \ |
1114 |
"$(DESTDIR)${localstatedir}/log/ganeti" \ |
1115 |
"$(DESTDIR)${localstatedir}/run/ganeti" |
1116 |
|
1117 |
# To avoid conflicts between directory names and other targets, a file inside |
1118 |
# the directory is used to ensure its existence. |
1119 |
%.dir: |
1120 |
@mkdir_p@ $* && touch $@ |
1121 |
|
1122 |
.PHONY: apidoc |
1123 |
if WANT_HTOOLSAPIDOC |
1124 |
apidoc: py-apidoc hs-apidoc |
1125 |
else |
1126 |
apidoc: py-apidoc |
1127 |
endif |
1128 |
|
1129 |
.PHONY: py-apidoc |
1130 |
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES) |
1131 |
$(RUN_IN_TEMPDIR) epydoc -v \ |
1132 |
--conf $(CURDIR)/epydoc.conf \ |
1133 |
--output $(CURDIR)/$(APIDOC_PY_DIR) |
1134 |
|
1135 |
.PHONY: hs-apidoc |
1136 |
hs-apidoc: $(HS_BUILT_SRCS) |
1137 |
@test -n "$(HSCOLOUR)" || \ |
1138 |
{ echo 'HsColour' not found during configure; exit 1; } |
1139 |
@test -n "$(HADDOCK)" || \ |
1140 |
{ echo 'haddock' not found during configure; exit 1; } |
1141 |
rm -rf $(APIDOC_HS_DIR)/* |
1142 |
@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools/Program |
1143 |
$(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css |
1144 |
ln -s ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css |
1145 |
set -e ; \ |
1146 |
cd htools; \ |
1147 |
if [ "$(HTOOLS_NOCURL)" ]; \ |
1148 |
then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \ |
1149 |
else OPTGHC=""; \ |
1150 |
fi; \ |
1151 |
if [ "$(HTOOLS_PARALLEL3)" ]; \ |
1152 |
then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \ |
1153 |
fi; \ |
1154 |
RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \ |
1155 |
for file in $$RELSRCS; do \ |
1156 |
hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \ |
1157 |
$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \ |
1158 |
done ; \ |
1159 |
$(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \ |
1160 |
-t ganeti-htools -p haddock-prologue \ |
1161 |
--source-module="%{MODULE/.//}.html" \ |
1162 |
--source-entity="%{MODULE/.//}.html#%{NAME}" \ |
1163 |
$$OPTGHC \ |
1164 |
$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%)) |
1165 |
|
1166 |
.PHONY: TAGS |
1167 |
TAGS: $(BUILT_SOURCES) |
1168 |
rm -f TAGS |
1169 |
find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \ |
1170 |
-path './daemons/ganeti-*' -o -path './tools/*' -o \ |
1171 |
-path './qa/*.py' | \ |
1172 |
etags -l python - |
1173 |
|
1174 |
.PHONY: coverage |
1175 |
if WANT_HTOOLS |
1176 |
coverage: py-coverage hs-coverage |
1177 |
else |
1178 |
coverage: py-coverage |
1179 |
endif |
1180 |
|
1181 |
.PHONY: py-coverage |
1182 |
py-coverage: $(BUILT_SOURCES) $(python_tests) |
1183 |
set -e; \ |
1184 |
COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \ |
1185 |
TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \ |
1186 |
HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \ |
1187 |
$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \ |
1188 |
$(python_tests) |
1189 |
|
1190 |
.PHONY: hs-coverage |
1191 |
hs-coverage: $(haskell_tests) |
1192 |
cd htools && rm -f *.tix *.mix && ./test |
1193 |
@mkdir_p@ $(COVERAGE_HS_DIR) |
1194 |
hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL) |
1195 |
hpc report htools/test $(HPCEXCL) |
1196 |
ln -sf hpc_index.html $(COVERAGE_HS_DIR)/index.html |
1197 |
|
1198 |
# Special "kind-of-QA" target for htools, needs special setup (all |
1199 |
# tools compiled with -fhpc) |
1200 |
.PHONY: live-test |
1201 |
live-test: all |
1202 |
set -e ; \ |
1203 |
cd htools; \ |
1204 |
rm -f .hpc; ln -s ../.hpc .hpc; \ |
1205 |
rm -f *.tix *.mix; \ |
1206 |
./live-test.sh; \ |
1207 |
hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \ |
1208 |
--output=live-test.tix ; \ |
1209 |
@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \ |
1210 |
hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \ |
1211 |
--srcdir=.. $(HPCEXCL) ; \ |
1212 |
hpc report --srcdir=.. live-test $(HPCEXCL) |
1213 |
|
1214 |
commit-check: distcheck lint apidoc |
1215 |
|
1216 |
-include ./Makefile.local |
1217 |
|
1218 |
# vim: set noet : |