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