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