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