Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ d466fd8b

History | View | Annotate | Download (56.6 kB)

1 e8230860 Michael Hanselmann
# Ganeti makefile
2 e8230860 Michael Hanselmann
# - Indent with tabs only.
3 e8230860 Michael Hanselmann
# - Keep files sorted; one line per file.
4 e8230860 Michael Hanselmann
# - Directories in lib/ must have their own *dir variable (see hypervisor).
5 e8230860 Michael Hanselmann
# - All directories must be listed DIRS.
6 0a7bed64 Michael Hanselmann
# - Use autogen.sh to generate Makefile.in and configure script.
7 e8230860 Michael Hanselmann
8 e8230860 Michael Hanselmann
# Automake doesn't export these variables before version 1.10.
9 e8230860 Michael Hanselmann
abs_top_builddir = @abs_top_builddir@
10 e8230860 Michael Hanselmann
abs_top_srcdir = @abs_top_srcdir@
11 e8230860 Michael Hanselmann
12 08366664 Michael Hanselmann
# Helper values for calling builtin functions
13 08366664 Michael Hanselmann
empty :=
14 08366664 Michael Hanselmann
space := $(empty) $(empty)
15 08366664 Michael Hanselmann
comma := ,
16 08366664 Michael Hanselmann
17 7ddd8e4c Iustin Pop
# Helper function to strip src/ and test/hs/ from a list
18 7ddd8e4c Iustin Pop
strip_hsroot = $(patsubst src/%,%,$(patsubst test/hs/%,%,$(1)))
19 7ddd8e4c Iustin Pop
20 a01dd3c6 Iustin Pop
# Use bash in order to be able to use pipefail
21 a01dd3c6 Iustin Pop
SHELL=/bin/bash
22 a01dd3c6 Iustin Pop
23 6e06b36c Iustin Pop
ACLOCAL_AMFLAGS = -I autotools
24 4f3d5b76 Michael Hanselmann
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
25 b959138f Michael Hanselmann
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
26 eed5c5df Michael Hanselmann
CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
27 5d3c30df Michael Hanselmann
CHECK_HEADER = $(top_srcdir)/autotools/check-header
28 c55cc346 Iustin Pop
CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
29 58997abb Michael Hanselmann
CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
30 73d0e218 Iustin Pop
CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
31 96602be4 Michael Hanselmann
CHECK_VERSION = $(top_srcdir)/autotools/check-version
32 7385c51d Michael Hanselmann
CHECK_NEWS = $(top_srcdir)/autotools/check-news
33 f6cbcc06 Michael Hanselmann
CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports
34 95eb4188 Michael Hanselmann
DOCPP = $(top_srcdir)/autotools/docpp
35 e8230860 Michael Hanselmann
REPLACE_VARS_SED = autotools/replace_vars.sed
36 d99d1e36 Iustin Pop
CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants
37 d5a2a550 Michael Hanselmann
BUILD_RPC = $(top_srcdir)/autotools/build-rpc
38 6e3bf290 Michael Hanselmann
SHELL_ENV_INIT = autotools/shell-env-init
39 e8230860 Michael Hanselmann
40 22c5390d Iustin Pop
# Note: these are automake-specific variables, and must be named after
41 22c5390d Iustin Pop
# the directory + 'dir' suffix
42 2d48a3a2 Michael Hanselmann
clientdir = $(pkgpythondir)/client
43 e8230860 Michael Hanselmann
hypervisordir = $(pkgpythondir)/hypervisor
44 ff9efc03 Michael Hanselmann
httpdir = $(pkgpythondir)/http
45 dc101ecc Michael Hanselmann
masterddir = $(pkgpythondir)/masterd
46 12426ae1 Guido Trotter
confddir = $(pkgpythondir)/confd
47 8c229cc7 Oleksiy Mishchenko
rapidir = $(pkgpythondir)/rapi
48 899c4d2c Michael Hanselmann
serverdir = $(pkgpythondir)/server
49 9f4bb951 Michael Hanselmann
watcherdir = $(pkgpythondir)/watcher
50 bb44b1ae Michael Hanselmann
impexpddir = $(pkgpythondir)/impexpd
51 c047a981 Michael Hanselmann
utilsdir = $(pkgpythondir)/utils
52 e8230860 Michael Hanselmann
toolsdir = $(pkglibdir)/tools
53 7617fd6b Iustin Pop
iallocatorsdir = $(pkglibdir)/iallocators
54 0d2bf835 René Nussbaumer
pytoolsdir = $(pkgpythondir)/tools
55 e8230860 Michael Hanselmann
docdir = $(datadir)/doc/$(PACKAGE)
56 b8fe7ca6 Iustin Pop
myexeclibdir = $(pkglibdir)
57 e8230860 Michael Hanselmann
58 a4f12da4 Michael Hanselmann
# Delete output file if an error occurred while building it
59 a4f12da4 Michael Hanselmann
.DELETE_ON_ERROR:
60 a4f12da4 Michael Hanselmann
61 d9a900dc Iustin Pop
HS_DIRS = \
62 3add7574 Iustin Pop
	src \
63 3add7574 Iustin Pop
	src/Ganeti \
64 3add7574 Iustin Pop
	src/Ganeti/Block \
65 3add7574 Iustin Pop
	src/Ganeti/Block/Drbd \
66 3add7574 Iustin Pop
	src/Ganeti/Confd \
67 3add7574 Iustin Pop
	src/Ganeti/DataCollectors \
68 3add7574 Iustin Pop
	src/Ganeti/HTools \
69 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend \
70 3add7574 Iustin Pop
	src/Ganeti/HTools/Program \
71 3add7574 Iustin Pop
	src/Ganeti/Query \
72 83846468 Iustin Pop
	test/hs \
73 83846468 Iustin Pop
	test/hs/Test \
74 83846468 Iustin Pop
	test/hs/Test/Ganeti \
75 83846468 Iustin Pop
	test/hs/Test/Ganeti/Block \
76 83846468 Iustin Pop
	test/hs/Test/Ganeti/Block/Drbd \
77 83846468 Iustin Pop
	test/hs/Test/Ganeti/Confd \
78 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools \
79 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Backend \
80 83846468 Iustin Pop
	test/hs/Test/Ganeti/Query
81 d5506465 Iustin Pop
82 7ddd8e4c Iustin Pop
# Haskell directories without the roots (src, test/hs)
83 7ddd8e4c Iustin Pop
HS_DIRS_NOROOT = $(filter-out src,$(filter-out test/hs,$(HS_DIRS)))
84 7ddd8e4c Iustin Pop
85 e8230860 Michael Hanselmann
DIRS = \
86 d9a900dc Iustin Pop
	$(HS_DIRS) \
87 e8230860 Michael Hanselmann
	autotools \
88 e8230860 Michael Hanselmann
	daemons \
89 e8230860 Michael Hanselmann
	devel \
90 e8230860 Michael Hanselmann
	doc \
91 596f913e Michael Hanselmann
	doc/css \
92 e8230860 Michael Hanselmann
	doc/examples \
93 c51580b3 Guido Trotter
	doc/examples/gnt-debug \
94 dad26941 Iustin Pop
	doc/examples/hooks \
95 83846468 Iustin Pop
	test/data/htools \
96 83846468 Iustin Pop
	test/data/htools/rapi \
97 83846468 Iustin Pop
	test/hs/shelltests \
98 e8230860 Michael Hanselmann
	lib \
99 f9897b6d Michael Hanselmann
	lib/build \
100 dad26941 Iustin Pop
	lib/client \
101 2f16ea8f Michael Hanselmann
	lib/confd \
102 ff9efc03 Michael Hanselmann
	lib/http \
103 e8230860 Michael Hanselmann
	lib/hypervisor \
104 bb44b1ae Michael Hanselmann
	lib/impexpd \
105 dc101ecc Michael Hanselmann
	lib/masterd \
106 8c229cc7 Oleksiy Mishchenko
	lib/rapi \
107 899c4d2c Michael Hanselmann
	lib/server \
108 0d2bf835 René Nussbaumer
	lib/tools \
109 c047a981 Michael Hanselmann
	lib/utils \
110 9f4bb951 Michael Hanselmann
	lib/watcher \
111 e8230860 Michael Hanselmann
	man \
112 e8230860 Michael Hanselmann
	qa \
113 e8230860 Michael Hanselmann
	test \
114 e8230860 Michael Hanselmann
	test/data \
115 2e076ede Stratos Psomadakis
	test/data/bdev-rbd \
116 1e6fab60 Agata Murawska
	test/data/ovfdata \
117 d92518d3 Agata Murawska
	test/data/ovfdata/other \
118 90066780 Iustin Pop
	test/py \
119 e8230860 Michael Hanselmann
	tools
120 e8230860 Michael Hanselmann
121 cbcd9144 Michele Tartara
ALL_APIDOC_HS_DIRS = \
122 22c5390d Iustin Pop
	$(APIDOC_HS_DIR) \
123 7ddd8e4c Iustin Pop
	$(patsubst %,$(APIDOC_HS_DIR)/%,$(call strip_hsroot,$(HS_DIRS_NOROOT)))
124 cbcd9144 Michele Tartara
125 cbcd9144 Michele Tartara
BUILDTIME_DIR_AUTOCREATE = \
126 cbcd9144 Michele Tartara
	scripts \
127 cbcd9144 Michele Tartara
	$(APIDOC_DIR) \
128 cbcd9144 Michele Tartara
	$(ALL_APIDOC_HS_DIRS) \
129 dad26941 Iustin Pop
	$(APIDOC_PY_DIR) \
130 22c5390d Iustin Pop
	$(COVERAGE_DIR) \
131 22c5390d Iustin Pop
	$(COVERAGE_HS_DIR) \
132 dad26941 Iustin Pop
	$(COVERAGE_PY_DIR) \
133 b91e9518 Iustin Pop
	.hpc
134 2750b299 Michael Hanselmann
135 2750b299 Michael Hanselmann
BUILDTIME_DIRS = \
136 2750b299 Michael Hanselmann
	$(BUILDTIME_DIR_AUTOCREATE) \
137 41806ef4 Michael Hanselmann
	doc/html \
138 41806ef4 Michael Hanselmann
	doc/man-html
139 6b997854 Michael Hanselmann
140 6b997854 Michael Hanselmann
DIRCHECK_EXCLUDE = \
141 6b997854 Michael Hanselmann
	$(BUILDTIME_DIRS) \
142 6b997854 Michael Hanselmann
	ganeti-[0-9]*.[0-9]*.[0-9]* \
143 a2d7ea09 Iustin Pop
	doc/html/_* \
144 41806ef4 Michael Hanselmann
	doc/man-html/_* \
145 a2d7ea09 Iustin Pop
	autom4te.cache
146 6b997854 Michael Hanselmann
147 22c5390d Iustin Pop
# some helper vars
148 22c5390d Iustin Pop
COVERAGE_DIR = doc/coverage
149 22c5390d Iustin Pop
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
150 22c5390d Iustin Pop
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
151 22c5390d Iustin Pop
APIDOC_DIR = doc/api
152 22c5390d Iustin Pop
APIDOC_PY_DIR = $(APIDOC_DIR)/py
153 22c5390d Iustin Pop
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
154 22c5390d Iustin Pop
155 2ab2b9f5 Iustin Pop
MAINTAINERCLEANFILES = \
156 b76aac08 Michael Hanselmann
	$(maninput) \
157 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
158 84a12e40 Iustin Pop
	doc/news.rst \
159 7a03d293 Michael Hanselmann
	doc/upgrade.rst \
160 84a12e40 Iustin Pop
	vcs-version
161 2ab2b9f5 Iustin Pop
162 d17e74b4 Iustin Pop
maintainer-clean-local:
163 6b997854 Michael Hanselmann
	rm -rf $(BUILDTIME_DIRS)
164 d17e74b4 Iustin Pop
165 e8230860 Michael Hanselmann
CLEANFILES = \
166 2f16ea8f Michael Hanselmann
	$(addsuffix /*.py[co],$(DIRS)) \
167 d9a900dc Iustin Pop
	$(addsuffix /*.hi,$(HS_DIRS)) \
168 d9a900dc Iustin Pop
	$(addsuffix /*.o,$(HS_DIRS)) \
169 2d48a3a2 Michael Hanselmann
	$(PYTHON_BOOTSTRAP) \
170 f774bd03 Michael Hanselmann
	epydoc.conf \
171 5098afd1 Iustin Pop
	$(REPLACE_VARS_SED) \
172 6e3bf290 Michael Hanselmann
	$(SHELL_ENV_INIT) \
173 f154a7a3 Michael Hanselmann
	daemons/daemon-util \
174 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner \
175 41806ef4 Michael Hanselmann
	$(mandocrst) \
176 41806ef4 Michael Hanselmann
	doc/manpages-enabled.rst \
177 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES) \
178 f72f8622 Iustin Pop
	doc/examples/bash_completion \
179 e80aeb89 Michael Hanselmann
	doc/examples/bash_completion-debug \
180 d5a2a550 Michael Hanselmann
	lib/_generated_rpc.py \
181 2ab2b9f5 Iustin Pop
	$(man_MANS) \
182 2ab2b9f5 Iustin Pop
	$(manhtml) \
183 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
184 cdd27f7f Michele Tartara
	tools/users-setup \
185 e5afb848 Michael Hanselmann
	tools/vcluster-setup \
186 3735787e Iustin Pop
	stamp-directories \
187 dd1dfd9a Michael Hanselmann
	stamp-srclinks \
188 d6159933 Iustin Pop
	$(nodist_pkgpython_PYTHON) \
189 c3f67183 Iustin Pop
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
190 3096524e Iustin Pop
	$(HS_BUILT_TEST_HELPERS) \
191 3add7574 Iustin Pop
	src/ganeti-confd \
192 83846468 Iustin Pop
	.hpc/*.mix src/*.tix test/hs/*.tix \
193 191ff68c Iustin Pop
	doc/hs-lint.html
194 e8230860 Michael Hanselmann
195 4c3d5fb6 Iustin Pop
GENERATED_FILES = \
196 5098afd1 Iustin Pop
	$(built_base_sources) \
197 96a7481d Michael Hanselmann
	$(BUILT_PYTHON_SOURCES) \
198 96a7481d Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
199 96a7481d Michael Hanselmann
200 d9a900dc Iustin Pop
HS_GENERATED_FILES =
201 ada0e680 Iustin Pop
if WANT_HTOOLS
202 d9a900dc Iustin Pop
HS_GENERATED_FILES += $(HS_PROGS)
203 04520998 Iustin Pop
if ENABLE_CONFD
204 d9a900dc Iustin Pop
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
205 ada0e680 Iustin Pop
endif
206 ada0e680 Iustin Pop
endif
207 ada0e680 Iustin Pop
208 96a7481d Michael Hanselmann
built_base_sources = \
209 3735787e Iustin Pop
	stamp-directories \
210 3735787e Iustin Pop
	stamp-srclinks
211 2d1f248e Michael Hanselmann
212 96a7481d Michael Hanselmann
built_python_base_sources = \
213 13aeae6a Iustin Pop
	lib/_autoconf.py \
214 96a7481d Michael Hanselmann
	lib/_vcsversion.py
215 96a7481d Michael Hanselmann
216 96a7481d Michael Hanselmann
BUILT_PYTHON_SOURCES = \
217 96a7481d Michael Hanselmann
	$(built_python_base_sources) \
218 d5a2a550 Michael Hanselmann
	lib/_generated_rpc.py
219 e8230860 Michael Hanselmann
220 5098afd1 Iustin Pop
# Generating the RPC wrappers depends on many things, so make sure
221 5098afd1 Iustin Pop
# it's built at the end of the built sources
222 96a7481d Michael Hanselmann
lib/_generated_rpc.py: | $(built_base_sources) $(built_python_base_sources)
223 96a7481d Michael Hanselmann
224 656a7fdf Iustin Pop
# these are all built from the underlying %.in sources
225 656a7fdf Iustin Pop
BUILT_EXAMPLES = \
226 656a7fdf Iustin Pop
	doc/examples/ganeti-kvm-poweroff.initd \
227 656a7fdf Iustin Pop
	doc/examples/ganeti.cron \
228 656a7fdf Iustin Pop
	doc/examples/ganeti.initd \
229 aa75500a Guido Trotter
	doc/examples/ganeti-master-role.ocf \
230 17071597 Guido Trotter
	doc/examples/ganeti-node-role.ocf \
231 656a7fdf Iustin Pop
	doc/examples/gnt-config-backup \
232 656a7fdf Iustin Pop
	doc/examples/hooks/ipsec
233 656a7fdf Iustin Pop
234 08366664 Michael Hanselmann
nodist_pkgpython_PYTHON = \
235 08366664 Michael Hanselmann
	$(BUILT_PYTHON_SOURCES)
236 08366664 Michael Hanselmann
237 f9897b6d Michael Hanselmann
noinst_PYTHON = \
238 5f43f393 Michael Hanselmann
	lib/build/__init__.py \
239 dad26941 Iustin Pop
	lib/build/shell_example_lexer.py \
240 dad26941 Iustin Pop
	lib/build/sphinx_ext.py
241 f9897b6d Michael Hanselmann
242 e8230860 Michael Hanselmann
pkgpython_PYTHON = \
243 e8230860 Michael Hanselmann
	lib/__init__.py \
244 a8a76bc2 Guido Trotter
	lib/asyncnotifier.py \
245 e8230860 Michael Hanselmann
	lib/backend.py \
246 e8230860 Michael Hanselmann
	lib/bdev.py \
247 e8230860 Michael Hanselmann
	lib/bootstrap.py \
248 e8230860 Michael Hanselmann
	lib/cli.py \
249 e8230860 Michael Hanselmann
	lib/cmdlib.py \
250 cea881e5 Michael Hanselmann
	lib/compat.py \
251 e8230860 Michael Hanselmann
	lib/config.py \
252 e8230860 Michael Hanselmann
	lib/constants.py \
253 821d9e43 Michael Hanselmann
	lib/daemon.py \
254 e8230860 Michael Hanselmann
	lib/errors.py \
255 68d95757 Guido Trotter
	lib/hooksmaster.py \
256 62e0e880 Iustin Pop
	lib/ht.py \
257 e8230860 Michael Hanselmann
	lib/jqueue.py \
258 8b537bb0 Michael Hanselmann
	lib/jstore.py \
259 e8230860 Michael Hanselmann
	lib/locking.py \
260 e8230860 Michael Hanselmann
	lib/luxi.py \
261 e8230860 Michael Hanselmann
	lib/mcpu.py \
262 a744b676 Manuel Franceschini
	lib/netutils.py \
263 e8230860 Michael Hanselmann
	lib/objects.py \
264 e8230860 Michael Hanselmann
	lib/opcodes.py \
265 473d87a3 Iustin Pop
	lib/outils.py \
266 ced78a66 Agata Murawska
	lib/ovf.py \
267 3329f4de Michael Hanselmann
	lib/pathutils.py \
268 a123dc19 Michael Hanselmann
	lib/qlang.py \
269 4ca96421 Michael Hanselmann
	lib/query.py \
270 e8230860 Michael Hanselmann
	lib/rpc.py \
271 6648cb36 Michael Hanselmann
	lib/rpc_defs.py \
272 f12e1736 René Nussbaumer
	lib/runtime.py \
273 e8230860 Michael Hanselmann
	lib/serializer.py \
274 e8230860 Michael Hanselmann
	lib/ssconf.py \
275 e8230860 Michael Hanselmann
	lib/ssh.py \
276 ac2d0fe4 Michael Hanselmann
	lib/storage.py \
277 1338f2b4 Balazs Lecz
	lib/uidpool.py \
278 05e733b4 Michael Hanselmann
	lib/vcluster.py \
279 4e4b6b7a Apollon Oikonomopoulos
	lib/network.py \
280 76094e37 Michael Hanselmann
	lib/workerpool.py
281 e8230860 Michael Hanselmann
282 2d48a3a2 Michael Hanselmann
client_PYTHON = \
283 c2855a12 Michael Hanselmann
	lib/client/__init__.py \
284 02266fe0 Michael Hanselmann
	lib/client/gnt_backup.py \
285 7b3e7d41 Michael Hanselmann
	lib/client/gnt_cluster.py \
286 6d50f5f9 Michael Hanselmann
	lib/client/gnt_debug.py \
287 667dbd6b Adeodato Simo
	lib/client/gnt_group.py \
288 e792102d Michael Hanselmann
	lib/client/gnt_instance.py \
289 a09b9e3d Michael Hanselmann
	lib/client/gnt_job.py \
290 37494fa4 Michael Hanselmann
	lib/client/gnt_node.py \
291 4e4b6b7a Apollon Oikonomopoulos
	lib/client/gnt_network.py \
292 b954f097 Constantinos Venetsanopoulos
	lib/client/gnt_os.py \
293 b954f097 Constantinos Venetsanopoulos
	lib/client/gnt_storage.py
294 2d48a3a2 Michael Hanselmann
295 e8230860 Michael Hanselmann
hypervisor_PYTHON = \
296 e8230860 Michael Hanselmann
	lib/hypervisor/__init__.py \
297 e8230860 Michael Hanselmann
	lib/hypervisor/hv_base.py \
298 48297fa2 Iustin Pop
	lib/hypervisor/hv_chroot.py \
299 e8230860 Michael Hanselmann
	lib/hypervisor/hv_fake.py \
300 eb58f9b1 Guido Trotter
	lib/hypervisor/hv_kvm.py \
301 4b5e40a5 Iustin Pop
	lib/hypervisor/hv_lxc.py \
302 e8230860 Michael Hanselmann
	lib/hypervisor/hv_xen.py
303 e8230860 Michael Hanselmann
304 8c229cc7 Oleksiy Mishchenko
rapi_PYTHON = \
305 8c229cc7 Oleksiy Mishchenko
	lib/rapi/__init__.py \
306 10b207d4 Oleksiy Mishchenko
	lib/rapi/baserlib.py \
307 95ab4de9 David Knowles
	lib/rapi/client.py \
308 20b509de Michael Hanselmann
	lib/rapi/client_utils.py \
309 10b207d4 Oleksiy Mishchenko
	lib/rapi/connector.py \
310 a85f23fa Michael Hanselmann
	lib/rapi/rlib2.py \
311 a85f23fa Michael Hanselmann
	lib/rapi/testutils.py
312 8c229cc7 Oleksiy Mishchenko
313 ff9efc03 Michael Hanselmann
http_PYTHON = \
314 02cab3e7 Michael Hanselmann
	lib/http/__init__.py \
315 be500c29 Michael Hanselmann
	lib/http/auth.py \
316 02cab3e7 Michael Hanselmann
	lib/http/client.py \
317 02cab3e7 Michael Hanselmann
	lib/http/server.py
318 ff9efc03 Michael Hanselmann
319 12426ae1 Guido Trotter
confd_PYTHON = \
320 71f27d19 Guido Trotter
	lib/confd/__init__.py \
321 b0dcdc10 Iustin Pop
	lib/confd/client.py
322 8c229cc7 Oleksiy Mishchenko
323 dc101ecc Michael Hanselmann
masterd_PYTHON = \
324 033a1d00 Michael Hanselmann
	lib/masterd/__init__.py \
325 0fcd0cad René Nussbaumer
	lib/masterd/iallocator.py \
326 033a1d00 Michael Hanselmann
	lib/masterd/instance.py
327 dc101ecc Michael Hanselmann
328 bb44b1ae Michael Hanselmann
impexpd_PYTHON = \
329 bb44b1ae Michael Hanselmann
	lib/impexpd/__init__.py
330 bb44b1ae Michael Hanselmann
331 9f4bb951 Michael Hanselmann
watcher_PYTHON = \
332 9ca87fb3 Michael Hanselmann
	lib/watcher/__init__.py \
333 adf6301e Michael Hanselmann
	lib/watcher/nodemaint.py \
334 adf6301e Michael Hanselmann
	lib/watcher/state.py
335 9f4bb951 Michael Hanselmann
336 899c4d2c Michael Hanselmann
server_PYTHON = \
337 29d91329 Michael Hanselmann
	lib/server/__init__.py \
338 5119f2ec Michael Hanselmann
	lib/server/masterd.py \
339 d9c82a4e Michael Hanselmann
	lib/server/noded.py \
340 d9c82a4e Michael Hanselmann
	lib/server/rapi.py
341 899c4d2c Michael Hanselmann
342 0d2bf835 René Nussbaumer
pytools_PYTHON = \
343 0d2bf835 René Nussbaumer
	lib/tools/__init__.py \
344 8e55e20f Michael Hanselmann
	lib/tools/burnin.py \
345 d12b9f66 Michael Hanselmann
	lib/tools/ensure_dirs.py \
346 d5fe5fa9 Michael Hanselmann
	lib/tools/node_cleanup.py \
347 69e5fefc Michael Hanselmann
	lib/tools/node_daemon_setup.py \
348 d12b9f66 Michael Hanselmann
	lib/tools/prepare_node_join.py
349 0d2bf835 René Nussbaumer
350 c047a981 Michael Hanselmann
utils_PYTHON = \
351 4fd029cf Michael Hanselmann
	lib/utils/__init__.py \
352 79d22269 Michael Hanselmann
	lib/utils/algo.py \
353 9d1b963f Michael Hanselmann
	lib/utils/filelock.py \
354 f21bb4b7 Michael Hanselmann
	lib/utils/hash.py \
355 3865ca48 Michael Hanselmann
	lib/utils/io.py \
356 1ae4c5a1 Michael Hanselmann
	lib/utils/log.py \
357 59726e15 Bernardo Dal Seno
	lib/utils/lvm.py \
358 8dc76d54 Guido Trotter
	lib/utils/mlock.py \
359 17b97ab3 Michael Hanselmann
	lib/utils/nodesetup.py \
360 a4ccecf6 Michael Hanselmann
	lib/utils/process.py \
361 7fcffe27 Michael Hanselmann
	lib/utils/retry.py \
362 7831fc5f Michael Hanselmann
	lib/utils/text.py \
363 c50645c0 Michael Hanselmann
	lib/utils/wrapper.py \
364 c50645c0 Michael Hanselmann
	lib/utils/x509.py
365 c047a981 Michael Hanselmann
366 7cf58cad Michael Hanselmann
docinput = \
367 7cf58cad Michael Hanselmann
	doc/conf.py \
368 7cf58cad Michael Hanselmann
	doc/css/style.css \
369 ffa6869f Iustin Pop
	doc/admin.rst \
370 dad26941 Iustin Pop
	doc/cluster-merge.rst \
371 5c0c1eeb Iustin Pop
	doc/design-2.0.rst \
372 4f366caf Michael Hanselmann
	doc/design-2.1.rst \
373 e56bb0e8 Guido Trotter
	doc/design-2.2.rst \
374 1eb85930 Guido Trotter
	doc/design-2.3.rst \
375 78b40c5e Michael Hanselmann
	doc/design-2.4.rst \
376 d774ce92 Michael Hanselmann
	doc/design-2.5.rst \
377 40309ed7 Michael Hanselmann
	doc/design-2.6.rst \
378 97aac894 Michael Hanselmann
	doc/design-2.7.rst \
379 dad26941 Iustin Pop
	doc/design-autorepair.rst \
380 dad26941 Iustin Pop
	doc/design-bulk-create.rst \
381 dad26941 Iustin Pop
	doc/design-chained-jobs.rst \
382 ae9b5e0f Tsachy Shacham
	doc/design-cpu-pinning.rst \
383 dad26941 Iustin Pop
	doc/design-draft.rst \
384 dad26941 Iustin Pop
	doc/design-htools-2.3.rst \
385 278ddaa9 Michael Hanselmann
	doc/design-http-server.rst \
386 1375e1d9 Michael Hanselmann
	doc/design-impexp2.rst \
387 ed9fda24 Michael Hanselmann
	doc/design-lu-generated-jobs.rst \
388 d55b80b0 Guido Trotter
	doc/design-linuxha.rst \
389 4055b109 Adeodato Simo
	doc/design-multi-reloc.rst \
390 eec83a95 Apollon Oikonomopoulos
	doc/design-network.rst \
391 7742b03c Michael Hanselmann
	doc/design-node-add.rst \
392 dad26941 Iustin Pop
	doc/design-oob.rst \
393 64ea845e Michael Hanselmann
	doc/design-ovf-support.rst \
394 0cc3f0d7 Michael Hanselmann
	doc/design-opportunistic-locking.rst \
395 dad26941 Iustin Pop
	doc/design-partitioned.rst \
396 dad26941 Iustin Pop
	doc/design-query-splitting.rst \
397 dad26941 Iustin Pop
	doc/design-query2.rst \
398 d85f01e7 Iustin Pop
	doc/design-resource-model.rst \
399 45bc4635 Iustin Pop
	doc/design-restricted-commands.rst \
400 a997cec5 Apollon Oikonomopoulos
	doc/design-shared-storage.rst \
401 109e07c2 Guido Trotter
	doc/design-monitoring-agent.rst \
402 6b898285 Iustin Pop
	doc/design-virtual-clusters.rst \
403 dad26941 Iustin Pop
	doc/design-x509-ca.rst \
404 62947ebb Michael Hanselmann
	doc/devnotes.rst \
405 e2078d28 Iustin Pop
	doc/glossary.rst \
406 4d6443f4 Iustin Pop
	doc/hooks.rst \
407 876860a3 Iustin Pop
	doc/iallocator.rst \
408 d17e74b4 Iustin Pop
	doc/index.rst \
409 cbf3d64b Michael Hanselmann
	doc/install-quick.rst \
410 28e15341 Iustin Pop
	doc/install.rst \
411 9725b53d Michael Hanselmann
	doc/locking.rst \
412 41806ef4 Michael Hanselmann
	doc/manpages-disabled.rst \
413 6bf273d5 Michael Hanselmann
	doc/move-instance.rst \
414 c71a1a3d Iustin Pop
	doc/news.rst \
415 a47dc554 René Nussbaumer
	doc/ovfconverter.rst \
416 6d81475c Iustin Pop
	doc/rapi.rst \
417 b76aac08 Michael Hanselmann
	doc/security.rst \
418 35dd762d Michael Hanselmann
	doc/upgrade.rst \
419 ab171697 Michael Hanselmann
	doc/virtual-cluster.rst \
420 c71a1a3d Iustin Pop
	doc/walkthrough.rst
421 f05c99f3 Michael Hanselmann
422 41806ef4 Michael Hanselmann
# Generates file names such as "doc/man-gnt-instance.rst"
423 41806ef4 Michael Hanselmann
mandocrst = $(addprefix doc/man-,$(notdir $(manrst)))
424 41806ef4 Michael Hanselmann
425 6249f1c2 Michele Tartara
# Haskell programs to be installed in $PREFIX/bin
426 6249f1c2 Michele Tartara
HS_BIN_PROGS=src/htools
427 6249f1c2 Michele Tartara
428 6249f1c2 Michele Tartara
# Haskell programs to be installed in the MYEXECLIB dir
429 6249f1c2 Michele Tartara
HS_MYEXECLIB_PROGS=src/mon-collector
430 6249f1c2 Michele Tartara
431 6249f1c2 Michele Tartara
# Haskell programs to compiled but not installed automatically
432 6249f1c2 Michele Tartara
# Usually they have their own specific installation rules
433 6249f1c2 Michele Tartara
HS_COMPILE_PROGS= \
434 6249f1c2 Michele Tartara
	src/hconfd \
435 6249f1c2 Michele Tartara
	src/rpc-test
436 6249f1c2 Michele Tartara
437 6249f1c2 Michele Tartara
# All Haskell non-test programs to be compiled but not automatically installed
438 6249f1c2 Michele Tartara
HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
439 6249f1c2 Michele Tartara
440 3504d6c8 Guido Trotter
HS_BIN_ROLES = hbal hscan hspace hinfo hcheck hroller
441 ada0e680 Iustin Pop
HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
442 d6159933 Iustin Pop
443 19e21a6c Iustin Pop
HS_ALL_PROGS = \
444 19e21a6c Iustin Pop
	$(HS_PROGS) \
445 83846468 Iustin Pop
	test/hs/hpc-htools \
446 83846468 Iustin Pop
	test/hs/hpc-mon-collector \
447 3e16567e Iustin Pop
	test/hs/htest \
448 6249f1c2 Michele Tartara
	$(HS_COMPILE_PROGS)
449 19e21a6c Iustin Pop
450 c3f67183 Iustin Pop
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
451 83846468 Iustin Pop
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
452 3096524e Iustin Pop
453 39f0eea5 Iustin Pop
HFLAGS = \
454 3add7574 Iustin Pop
	-O -Wall -Werror -isrc \
455 39f0eea5 Iustin Pop
	-fwarn-monomorphism-restriction \
456 39f0eea5 Iustin Pop
	-fwarn-tabs \
457 39f0eea5 Iustin Pop
	$(GHC_BYVERSION_FLAGS)
458 39f0eea5 Iustin Pop
459 74e60746 Iustin Pop
# extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
460 d6159933 Iustin Pop
HEXTRA =
461 3e16567e Iustin Pop
# internal extra flags (used for test/hs/htest mainly)
462 c7ec3025 Iustin Pop
HEXTRA_INT =
463 b91e9518 Iustin Pop
# exclude options for coverage reports
464 9822b1dd Iustin Pop
HPCEXCL = --exclude Main \
465 98b33d0e Iustin Pop
	--exclude Ganeti.Constants \
466 9822b1dd Iustin Pop
	--exclude Ganeti.HTools.QC \
467 dad26941 Iustin Pop
	--exclude Ganeti.THH \
468 2997cb0a Iustin Pop
	--exclude Ganeti.Version \
469 4349c24d Michele Tartara
	--exclude Test.Ganeti.Attoparsec \
470 2733df51 Iustin Pop
	--exclude Test.Ganeti.TestCommon \
471 e1ee7d5a Iustin Pop
	--exclude Test.Ganeti.TestHTools \
472 e1ee7d5a Iustin Pop
	--exclude Test.Ganeti.TestHelper \
473 b88fcdd0 Iustin Pop
	--exclude Test.Ganeti.TestImports \
474 3add7574 Iustin Pop
	$(patsubst src.%,--exclude Test.%,$(subst /,.,$(patsubst %.hs,%, $(HS_LIB_SRCS))))
475 d6159933 Iustin Pop
476 c3f67183 Iustin Pop
HS_LIB_SRCS = \
477 3add7574 Iustin Pop
	src/Ganeti/Block/Drbd/Types.hs \
478 3add7574 Iustin Pop
	src/Ganeti/Block/Drbd/Parser.hs \
479 3add7574 Iustin Pop
	src/Ganeti/BasicTypes.hs \
480 3add7574 Iustin Pop
	src/Ganeti/Common.hs \
481 3add7574 Iustin Pop
	src/Ganeti/Compat.hs \
482 3add7574 Iustin Pop
	src/Ganeti/Confd/Client.hs \
483 3add7574 Iustin Pop
	src/Ganeti/Confd/Server.hs \
484 3add7574 Iustin Pop
	src/Ganeti/Confd/Types.hs \
485 3add7574 Iustin Pop
	src/Ganeti/Confd/Utils.hs \
486 3add7574 Iustin Pop
	src/Ganeti/Config.hs \
487 3add7574 Iustin Pop
	src/Ganeti/Daemon.hs \
488 3add7574 Iustin Pop
	src/Ganeti/DataCollectors/CLI.hs \
489 3add7574 Iustin Pop
	src/Ganeti/DataCollectors/Drbd.hs \
490 3add7574 Iustin Pop
	src/Ganeti/DataCollectors/Program.hs \
491 13d3acab Michele Tartara
	src/Ganeti/DataCollectors/Types.hs \
492 3add7574 Iustin Pop
	src/Ganeti/Errors.hs \
493 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend/IAlloc.hs \
494 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend/Luxi.hs \
495 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend/Rapi.hs \
496 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend/Simu.hs \
497 3add7574 Iustin Pop
	src/Ganeti/HTools/Backend/Text.hs \
498 3add7574 Iustin Pop
	src/Ganeti/HTools/CLI.hs \
499 3add7574 Iustin Pop
	src/Ganeti/HTools/Cluster.hs \
500 3add7574 Iustin Pop
	src/Ganeti/HTools/Container.hs \
501 3add7574 Iustin Pop
	src/Ganeti/HTools/ExtLoader.hs \
502 3add7574 Iustin Pop
	src/Ganeti/HTools/Graph.hs \
503 3add7574 Iustin Pop
	src/Ganeti/HTools/Group.hs \
504 3add7574 Iustin Pop
	src/Ganeti/HTools/Instance.hs \
505 3add7574 Iustin Pop
	src/Ganeti/HTools/Loader.hs \
506 3add7574 Iustin Pop
	src/Ganeti/HTools/Node.hs \
507 3add7574 Iustin Pop
	src/Ganeti/HTools/PeerMap.hs \
508 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hail.hs \
509 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hbal.hs \
510 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hcheck.hs \
511 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hinfo.hs \
512 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hscan.hs \
513 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hspace.hs \
514 3add7574 Iustin Pop
	src/Ganeti/HTools/Program/Hroller.hs \
515 2fd5a116 Iustin Pop
	src/Ganeti/HTools/Program/Main.hs \
516 3add7574 Iustin Pop
	src/Ganeti/HTools/Types.hs \
517 3add7574 Iustin Pop
	src/Ganeti/Hash.hs \
518 3add7574 Iustin Pop
	src/Ganeti/JQueue.hs \
519 3add7574 Iustin Pop
	src/Ganeti/JSON.hs \
520 3add7574 Iustin Pop
	src/Ganeti/Jobs.hs \
521 3add7574 Iustin Pop
	src/Ganeti/Logging.hs \
522 3add7574 Iustin Pop
	src/Ganeti/Luxi.hs \
523 3add7574 Iustin Pop
	src/Ganeti/Network.hs \
524 3add7574 Iustin Pop
	src/Ganeti/Objects.hs \
525 3add7574 Iustin Pop
	src/Ganeti/OpCodes.hs \
526 3add7574 Iustin Pop
	src/Ganeti/OpParams.hs \
527 3add7574 Iustin Pop
	src/Ganeti/Path.hs \
528 3add7574 Iustin Pop
	src/Ganeti/Query/Common.hs \
529 3add7574 Iustin Pop
	src/Ganeti/Query/Filter.hs \
530 3add7574 Iustin Pop
	src/Ganeti/Query/Group.hs \
531 3add7574 Iustin Pop
	src/Ganeti/Query/Job.hs \
532 3add7574 Iustin Pop
	src/Ganeti/Query/Language.hs \
533 3add7574 Iustin Pop
	src/Ganeti/Query/Node.hs \
534 3add7574 Iustin Pop
	src/Ganeti/Query/Query.hs \
535 3add7574 Iustin Pop
	src/Ganeti/Query/Server.hs \
536 3add7574 Iustin Pop
	src/Ganeti/Query/Types.hs \
537 3add7574 Iustin Pop
	src/Ganeti/Rpc.hs \
538 3add7574 Iustin Pop
	src/Ganeti/Runtime.hs \
539 3add7574 Iustin Pop
	src/Ganeti/Ssconf.hs \
540 3add7574 Iustin Pop
	src/Ganeti/THH.hs \
541 3add7574 Iustin Pop
	src/Ganeti/Types.hs \
542 3add7574 Iustin Pop
	src/Ganeti/Utils.hs
543 51309138 Iustin Pop
544 51309138 Iustin Pop
HS_TEST_SRCS = \
545 83846468 Iustin Pop
	test/hs/Test/Ganeti/Attoparsec.hs \
546 83846468 Iustin Pop
	test/hs/Test/Ganeti/BasicTypes.hs \
547 83846468 Iustin Pop
	test/hs/Test/Ganeti/Block/Drbd/Parser.hs \
548 83846468 Iustin Pop
	test/hs/Test/Ganeti/Block/Drbd/Types.hs \
549 83846468 Iustin Pop
	test/hs/Test/Ganeti/Common.hs \
550 83846468 Iustin Pop
	test/hs/Test/Ganeti/Confd/Types.hs \
551 83846468 Iustin Pop
	test/hs/Test/Ganeti/Confd/Utils.hs \
552 83846468 Iustin Pop
	test/hs/Test/Ganeti/Daemon.hs \
553 83846468 Iustin Pop
	test/hs/Test/Ganeti/Errors.hs \
554 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Backend/Simu.hs \
555 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Backend/Text.hs \
556 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/CLI.hs \
557 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Cluster.hs \
558 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Container.hs \
559 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Graph.hs \
560 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Instance.hs \
561 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Loader.hs \
562 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Node.hs \
563 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/PeerMap.hs \
564 83846468 Iustin Pop
	test/hs/Test/Ganeti/HTools/Types.hs \
565 83846468 Iustin Pop
	test/hs/Test/Ganeti/JSON.hs \
566 83846468 Iustin Pop
	test/hs/Test/Ganeti/Jobs.hs \
567 83846468 Iustin Pop
	test/hs/Test/Ganeti/JQueue.hs \
568 83846468 Iustin Pop
	test/hs/Test/Ganeti/Luxi.hs \
569 83846468 Iustin Pop
	test/hs/Test/Ganeti/Network.hs \
570 83846468 Iustin Pop
	test/hs/Test/Ganeti/Objects.hs \
571 83846468 Iustin Pop
	test/hs/Test/Ganeti/OpCodes.hs \
572 83846468 Iustin Pop
	test/hs/Test/Ganeti/Query/Filter.hs \
573 83846468 Iustin Pop
	test/hs/Test/Ganeti/Query/Language.hs \
574 83846468 Iustin Pop
	test/hs/Test/Ganeti/Query/Query.hs \
575 83846468 Iustin Pop
	test/hs/Test/Ganeti/Rpc.hs \
576 ca7b4f48 Iustin Pop
	test/hs/Test/Ganeti/Runtime.hs \
577 83846468 Iustin Pop
	test/hs/Test/Ganeti/Ssconf.hs \
578 83846468 Iustin Pop
	test/hs/Test/Ganeti/THH.hs \
579 83846468 Iustin Pop
	test/hs/Test/Ganeti/TestCommon.hs \
580 83846468 Iustin Pop
	test/hs/Test/Ganeti/TestHTools.hs \
581 83846468 Iustin Pop
	test/hs/Test/Ganeti/TestHelper.hs \
582 83846468 Iustin Pop
	test/hs/Test/Ganeti/Types.hs \
583 83846468 Iustin Pop
	test/hs/Test/Ganeti/Utils.hs
584 e4cc4c11 Iustin Pop
585 51309138 Iustin Pop
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
586 d6159933 Iustin Pop
587 b88fcdd0 Iustin Pop
HS_BUILT_SRCS = \
588 83846468 Iustin Pop
	test/hs/Test/Ganeti/TestImports.hs \
589 3add7574 Iustin Pop
	src/Ganeti/Constants.hs \
590 3add7574 Iustin Pop
	src/Ganeti/Version.hs
591 c3f67183 Iustin Pop
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
592 d6159933 Iustin Pop
593 7ddd8e4c Iustin Pop
HS_LIBTESTBUILT_SRCS = $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS)
594 7ddd8e4c Iustin Pop
595 3735787e Iustin Pop
$(RUN_IN_TEMPDIR): | stamp-directories
596 c964d962 Michael Hanselmann
597 41806ef4 Michael Hanselmann
doc/html/index.html: ENABLE_MANPAGES =
598 41806ef4 Michael Hanselmann
doc/man-html/index.html: ENABLE_MANPAGES = 1
599 41806ef4 Michael Hanselmann
doc/man-html/index.html: doc/manpages-enabled.rst $(mandocrst)
600 41806ef4 Michael Hanselmann
601 a2d917f3 Iustin Pop
# Note: we use here an order-only prerequisite, as the contents of
602 a2d917f3 Iustin Pop
# _autoconf.py are not actually influencing the html build output: it
603 a2d917f3 Iustin Pop
# has to exist in order for the sphinx module to be loaded
604 a2d917f3 Iustin Pop
# successfully, but we certainly don't want the docs to be rebuilt if
605 a2d917f3 Iustin Pop
# it changes
606 41806ef4 Michael Hanselmann
doc/html/index.html doc/man-html/index.html: $(docinput) doc/conf.py \
607 41806ef4 Michael Hanselmann
	configure.ac $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
608 7142485a Iustin Pop
	lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
609 dbee5c92 Michael Hanselmann
	doc/css/style.css \
610 08366664 Michael Hanselmann
	| $(BUILT_PYTHON_SOURCES)
611 d17e74b4 Iustin Pop
	@test -n "$(SPHINX)" || \
612 d17e74b4 Iustin Pop
	    { echo 'sphinx-build' not found during configure; exit 1; }
613 41806ef4 Michael Hanselmann
if !MANPAGES_IN_DOC
614 41806ef4 Michael Hanselmann
	if test -n '$(ENABLE_MANPAGES)'; then \
615 41806ef4 Michael Hanselmann
	  echo 'Man pages in documentation were disabled at configure time' >&2; \
616 41806ef4 Michael Hanselmann
	  exit 1; \
617 41806ef4 Michael Hanselmann
	fi
618 41806ef4 Michael Hanselmann
endif
619 06a6f2cc Michael Hanselmann
## Sphinx provides little control over what content should be included. Some
620 06a6f2cc Michael Hanselmann
## mechanisms exist, but they all have drawbacks or actual issues. Since we
621 06a6f2cc Michael Hanselmann
## build two different versions of the documentation--once without man pages and
622 06a6f2cc Michael Hanselmann
## once, if enabled, with them--some control is necessary. xmpp-wrapper provides
623 06a6f2cc Michael Hanselmann
## us with this, but requires running in a temporary directory. It moves the
624 06a6f2cc Michael Hanselmann
## correct files into place depending on environment variables.
625 41806ef4 Michael Hanselmann
	dir=$(dir $@) && \
626 41806ef4 Michael Hanselmann
	@mkdir_p@ $$dir && \
627 06a6f2cc Michael Hanselmann
	PYTHONPATH=. ENABLE_MANPAGES=$(ENABLE_MANPAGES) COPY_DOC=1 \
628 06a6f2cc Michael Hanselmann
	$(RUN_IN_TEMPDIR) autotools/sphinx-wrapper $(SPHINX) -q -W -b html \
629 13de7d59 Michael Hanselmann
	    -d . \
630 d17e74b4 Iustin Pop
	    -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
631 d17e74b4 Iustin Pop
	    -D release="$(PACKAGE_VERSION)" \
632 f8e233a3 Iustin Pop
	    -D graphviz_dot="$(DOT)" \
633 41806ef4 Michael Hanselmann
	    -D enable_manpages="$(ENABLE_MANPAGES)" \
634 41806ef4 Michael Hanselmann
	    doc $(CURDIR)/$$dir && \
635 41806ef4 Michael Hanselmann
	rm -f $$dir/.buildinfo $$dir/objects.inv
636 13de7d59 Michael Hanselmann
	touch $@
637 13de7d59 Michael Hanselmann
638 c964d962 Michael Hanselmann
doc/html: doc/html/index.html
639 2ab2b9f5 Iustin Pop
640 41806ef4 Michael Hanselmann
doc/man-html: doc/man-html/index.html
641 41806ef4 Michael Hanselmann
642 cbf3d64b Michael Hanselmann
doc/install-quick.rst: INSTALL
643 b76aac08 Michael Hanselmann
doc/news.rst: NEWS
644 7a03d293 Michael Hanselmann
doc/upgrade.rst: UPGRADE
645 b76aac08 Michael Hanselmann
646 e8deef56 Michael Hanselmann
doc/install-quick.rst doc/news.rst doc/upgrade.rst:
647 cbf3d64b Michael Hanselmann
	set -e; \
648 cbf3d64b Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
649 cbf3d64b Michael Hanselmann
	  echo '.. Do not edit.'; \
650 cbf3d64b Michael Hanselmann
	  echo; \
651 cbf3d64b Michael Hanselmann
	  cat $<; \
652 cbf3d64b Michael Hanselmann
	} > $@
653 cbf3d64b Michael Hanselmann
654 41806ef4 Michael Hanselmann
doc/manpages-enabled.rst: Makefile | $(built_base_sources)
655 41806ef4 Michael Hanselmann
	{ echo '.. This file is automatically generated, do not edit!'; \
656 41806ef4 Michael Hanselmann
	  echo ''; \
657 41806ef4 Michael Hanselmann
	  echo 'Man pages'; \
658 41806ef4 Michael Hanselmann
	  echo '========='; \
659 41806ef4 Michael Hanselmann
	  echo; \
660 41806ef4 Michael Hanselmann
	  echo '.. toctree::'; \
661 41806ef4 Michael Hanselmann
	  echo '   :maxdepth: 1'; \
662 41806ef4 Michael Hanselmann
	  echo; \
663 41806ef4 Michael Hanselmann
	  for i in $(notdir $(mandocrst)); do \
664 41806ef4 Michael Hanselmann
	    echo "   $$i"; \
665 41806ef4 Michael Hanselmann
	  done | LC_ALL=C sort; \
666 41806ef4 Michael Hanselmann
	} > $@
667 41806ef4 Michael Hanselmann
668 41806ef4 Michael Hanselmann
doc/man-%.rst: man/%.gen Makefile $(REPLACE_VARS_SED) | $(built_base_sources)
669 41806ef4 Michael Hanselmann
if MANPAGES_IN_DOC
670 41806ef4 Michael Hanselmann
	{ echo '.. This file is automatically updated at build time from $<.'; \
671 41806ef4 Michael Hanselmann
	  echo '.. Do not edit.'; \
672 41806ef4 Michael Hanselmann
	  echo; \
673 41806ef4 Michael Hanselmann
	  echo "$*"; \
674 41806ef4 Michael Hanselmann
	  echo '=========================================='; \
675 41806ef4 Michael Hanselmann
	  tail -n +3 $< | sed -f $(REPLACE_VARS_SED); \
676 41806ef4 Michael Hanselmann
	} > $@
677 41806ef4 Michael Hanselmann
else
678 41806ef4 Michael Hanselmann
	echo 'Man pages in documentation were disabled at configure time' >&2; \
679 41806ef4 Michael Hanselmann
	exit 1;
680 41806ef4 Michael Hanselmann
endif
681 41806ef4 Michael Hanselmann
682 7e1ccbe0 Michael Hanselmann
# Things to build but not to install (add it to EXTRA_DIST if it should be
683 7e1ccbe0 Michael Hanselmann
# distributed)
684 7e1ccbe0 Michael Hanselmann
noinst_DATA = \
685 7e1ccbe0 Michael Hanselmann
	doc/html \
686 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES) \
687 7e1ccbe0 Michael Hanselmann
	doc/examples/bash_completion \
688 e80aeb89 Michael Hanselmann
	doc/examples/bash_completion-debug \
689 7e1ccbe0 Michael Hanselmann
	$(manhtml)
690 f29266b4 Iustin Pop
691 41806ef4 Michael Hanselmann
if MANPAGES_IN_DOC
692 41806ef4 Michael Hanselmann
noinst_DATA += doc/man-html
693 41806ef4 Michael Hanselmann
endif
694 41806ef4 Michael Hanselmann
695 4f3d5b76 Michael Hanselmann
gnt_scripts = \
696 e8230860 Michael Hanselmann
	scripts/gnt-backup \
697 e8230860 Michael Hanselmann
	scripts/gnt-cluster \
698 e8230860 Michael Hanselmann
	scripts/gnt-debug \
699 667dbd6b Adeodato Simo
	scripts/gnt-group \
700 e8230860 Michael Hanselmann
	scripts/gnt-instance \
701 e8230860 Michael Hanselmann
	scripts/gnt-job \
702 4e4b6b7a Apollon Oikonomopoulos
	scripts/gnt-network \
703 e8230860 Michael Hanselmann
	scripts/gnt-node \
704 b954f097 Constantinos Venetsanopoulos
	scripts/gnt-os \
705 b954f097 Constantinos Venetsanopoulos
	scripts/gnt-storage
706 e8230860 Michael Hanselmann
707 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP_SBIN = \
708 29d91329 Michael Hanselmann
	daemons/ganeti-masterd \
709 5119f2ec Michael Hanselmann
	daemons/ganeti-noded \
710 d9c82a4e Michael Hanselmann
	daemons/ganeti-rapi \
711 dad26941 Iustin Pop
	daemons/ganeti-watcher \
712 656a7fdf Iustin Pop
	$(gnt_scripts)
713 2d48a3a2 Michael Hanselmann
714 0d2bf835 René Nussbaumer
PYTHON_BOOTSTRAP = \
715 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
716 8e55e20f Michael Hanselmann
	tools/burnin \
717 d12b9f66 Michael Hanselmann
	tools/ensure-dirs \
718 d5fe5fa9 Michael Hanselmann
	tools/node-cleanup \
719 69e5fefc Michael Hanselmann
	tools/node-daemon-setup \
720 d12b9f66 Michael Hanselmann
	tools/prepare-node-join
721 0d2bf835 René Nussbaumer
722 a8c68e44 Michael Hanselmann
qa_scripts = \
723 a0c3e726 Michael Hanselmann
	qa/__init__.py \
724 a8c68e44 Michael Hanselmann
	qa/ganeti-qa.py \
725 a8c68e44 Michael Hanselmann
	qa/qa_cluster.py \
726 a8c68e44 Michael Hanselmann
	qa/qa_config.py \
727 a8c68e44 Michael Hanselmann
	qa/qa_daemon.py \
728 a8c68e44 Michael Hanselmann
	qa/qa_env.py \
729 a8c68e44 Michael Hanselmann
	qa/qa_error.py \
730 21bf2e2e Andrea Spadaccini
	qa/qa_group.py \
731 a8c68e44 Michael Hanselmann
	qa/qa_instance.py \
732 09470dd8 Michael Hanselmann
	qa/qa_job.py \
733 a8c68e44 Michael Hanselmann
	qa/qa_node.py \
734 a8c68e44 Michael Hanselmann
	qa/qa_os.py \
735 a8c68e44 Michael Hanselmann
	qa/qa_rapi.py \
736 a8c68e44 Michael Hanselmann
	qa/qa_tags.py \
737 a8c68e44 Michael Hanselmann
	qa/qa_utils.py
738 a8c68e44 Michael Hanselmann
739 d6159933 Iustin Pop
bin_SCRIPTS =
740 d6159933 Iustin Pop
if WANT_HTOOLS
741 6249f1c2 Michele Tartara
bin_SCRIPTS += $(HS_BIN_PROGS)
742 458a286a Iustin Pop
install-exec-hook:
743 458a286a Iustin Pop
	@mkdir_p@ $(DESTDIR)$(iallocatorsdir)
744 7fa52acd Iustin Pop
# FIXME: this is a hardcoded logic, instead of auto-resolving
745 7fa52acd Iustin Pop
	$(LN_S) -f ../../../bin/htools \
746 a2d7ea09 Iustin Pop
	  $(DESTDIR)$(iallocatorsdir)/hail
747 201b6c34 Iustin Pop
	for role in $(HS_BIN_ROLES); do \
748 a2d7ea09 Iustin Pop
	  $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
749 201b6c34 Iustin Pop
	done
750 d6159933 Iustin Pop
endif
751 d6159933 Iustin Pop
752 7ddd8e4c Iustin Pop
$(HS_ALL_PROGS): %: %.hs $(HS_LIBTESTBUILT_SRCS) Makefile
753 d9a900dc Iustin Pop
	@if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
754 21a5e56c Iustin Pop
	  echo "Error: cannot run unittests without the development" \
755 21a5e56c Iustin Pop
	       " libraries (see devnotes.rst)" 1>&2; \
756 fd0bc853 Iustin Pop
	  exit 1; \
757 49e11c49 Iustin Pop
	fi
758 f0f3a6df Iustin Pop
	@rm -f $(notdir $@).tix
759 f0f3a6df Iustin Pop
	$(GHC) --make \
760 ef958f2a Iustin Pop
	  $(HFLAGS) \
761 d9a900dc Iustin Pop
	  $(HS_NOCURL) $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
762 f0f3a6df Iustin Pop
	  -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
763 c7ec3025 Iustin Pop
	  $(HEXTRA) $(HEXTRA_INT) $@
764 70b6c284 Iustin Pop
	@touch "$@"
765 70b6c284 Iustin Pop
766 3e16567e Iustin Pop
# for the test/hs/htest binary, we need to enable profiling/coverage
767 3e16567e Iustin Pop
test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
768 b91e9518 Iustin Pop
769 896b2850 Iustin Pop
# we compile the hpc-htools binary with the program coverage
770 83846468 Iustin Pop
test/hs/hpc-htools: HEXTRA_INT=-fhpc
771 25cdf177 Iustin Pop
772 cefd4a4a Michele Tartara
# we compile the hpc-mon-collector binary with the program coverage
773 83846468 Iustin Pop
test/hs/hpc-mon-collector: HEXTRA_INT=-fhpc
774 cefd4a4a Michele Tartara
775 04d15e63 Iustin Pop
# test dependency
776 83846468 Iustin Pop
test/hs/offline-tests.sh: test/hs/hpc-htools test/hs/hpc-mon-collector
777 04d15e63 Iustin Pop
778 c7ec3025 Iustin Pop
# rules for building profiling-enabled versions of the haskell
779 c7ec3025 Iustin Pop
# programs: hs-prof does the full two-step build, whereas
780 c7ec3025 Iustin Pop
# hs-prof-quick does only the final rebuild (hs-prof must have been
781 c7ec3025 Iustin Pop
# run before)
782 c7ec3025 Iustin Pop
.PHONY: hs-prof hs-prof-quick
783 c7ec3025 Iustin Pop
hs-prof:
784 675f65b7 Iustin Pop
	@if [ -z "$(TARGET)" ]; then \
785 675f65b7 Iustin Pop
	  echo "You need to define TARGET when running this rule" 1>&2; \
786 675f65b7 Iustin Pop
	  exit 1; \
787 675f65b7 Iustin Pop
	fi
788 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) clean
789 675f65b7 Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf o"
790 c7ec3025 Iustin Pop
	rm -f $(HS_ALL_PROGS)
791 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) hs-prof-quick
792 c7ec3025 Iustin Pop
793 c7ec3025 Iustin Pop
hs-prof-quick:
794 675f65b7 Iustin Pop
	@if [ -z "$(TARGET)" ]; then \
795 675f65b7 Iustin Pop
	  echo "You need to define TARGET when running this rule" 1>&2; \
796 675f65b7 Iustin Pop
	  exit 1; \
797 675f65b7 Iustin Pop
	fi
798 675f65b7 Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) $(TARGET) HEXTRA="-osuf prof_o -prof -auto-all"
799 c7ec3025 Iustin Pop
800 da7e44ee Michael Hanselmann
dist_sbin_SCRIPTS = \
801 da7e44ee Michael Hanselmann
	tools/ganeti-listrunner
802 4f3d5b76 Michael Hanselmann
803 fc3fd894 Michael Hanselmann
nodist_sbin_SCRIPTS = \
804 0d2bf835 René Nussbaumer
	$(PYTHON_BOOTSTRAP_SBIN) \
805 46118ed2 Iustin Pop
	daemons/ganeti-cleaner
806 fc3fd894 Michael Hanselmann
807 04520998 Iustin Pop
if ENABLE_CONFD
808 3add7574 Iustin Pop
src/ganeti-confd: src/hconfd
809 b0dcdc10 Iustin Pop
	cp -f $< $@
810 b0dcdc10 Iustin Pop
811 3add7574 Iustin Pop
nodist_sbin_SCRIPTS += src/ganeti-confd
812 73b0fa69 Iustin Pop
endif
813 73b0fa69 Iustin Pop
814 cc120286 Bernardo Dal Seno
python_scripts = \
815 e8230860 Michael Hanselmann
	tools/cfgshell \
816 e8230860 Michael Hanselmann
	tools/cfgupgrade \
817 b5672ea0 Iustin Pop
	tools/cfgupgrade12 \
818 1f7d3f7d René Nussbaumer
	tools/cluster-merge \
819 4ef0399b Iustin Pop
	tools/confd-client \
820 d62cbd3a Michael Hanselmann
	tools/fmtjson \
821 ea5fd476 Iustin Pop
	tools/lvmstrap \
822 6bf273d5 Michael Hanselmann
	tools/move-instance \
823 ced78a66 Agata Murawska
	tools/ovfconverter \
824 8a670753 Michael Hanselmann
	tools/sanitize-config
825 e8230860 Michael Hanselmann
826 61631293 Stephen Shirley
dist_tools_SCRIPTS = \
827 cc120286 Bernardo Dal Seno
	$(python_scripts) \
828 7ee2098e Guido Trotter
	tools/burnin \
829 2f4c951e Stephen Shirley
	tools/kvm-console-wrapper \
830 dad26941 Iustin Pop
	tools/master-ip-setup \
831 b9612abb Iustin Pop
	tools/xen-console-wrapper
832 61631293 Stephen Shirley
833 d5fe5fa9 Michael Hanselmann
nodist_tools_python_scripts = \
834 d5fe5fa9 Michael Hanselmann
	tools/node-cleanup
835 d5fe5fa9 Michael Hanselmann
836 29386d3e Michael Hanselmann
nodist_tools_SCRIPTS = \
837 d5fe5fa9 Michael Hanselmann
	$(nodist_tools_python_scripts) \
838 cdd27f7f Michele Tartara
	tools/users-setup \
839 29386d3e Michael Hanselmann
	tools/vcluster-setup
840 29386d3e Michael Hanselmann
841 2d76b580 Michael Hanselmann
pkglib_python_scripts = \
842 c6ccba7e Michael Hanselmann
	daemons/import-export \
843 c6ccba7e Michael Hanselmann
	tools/check-cert-expired
844 2d76b580 Michael Hanselmann
845 0d2bf835 René Nussbaumer
nodist_pkglib_python_scripts = \
846 d12b9f66 Michael Hanselmann
	tools/ensure-dirs \
847 69e5fefc Michael Hanselmann
	tools/node-daemon-setup \
848 d12b9f66 Michael Hanselmann
	tools/prepare-node-join
849 0d2bf835 René Nussbaumer
850 b8fe7ca6 Iustin Pop
myexeclib_SCRIPTS = \
851 2d76b580 Michael Hanselmann
	daemons/daemon-util \
852 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup \
853 332b1340 Michele Tartara
	$(pkglib_python_scripts) \
854 6249f1c2 Michele Tartara
	$(HS_MYEXECLIB_PROGS)
855 f154a7a3 Michael Hanselmann
856 b8fe7ca6 Iustin Pop
nodist_myexeclib_SCRIPTS = \
857 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts)
858 0d2bf835 René Nussbaumer
859 e8230860 Michael Hanselmann
EXTRA_DIST = \
860 e8230860 Michael Hanselmann
	NEWS \
861 7a03d293 Michael Hanselmann
	UPGRADE \
862 f774bd03 Michael Hanselmann
	epydoc.conf.in \
863 70c771f6 Michael Hanselmann
	pylintrc \
864 bb46a96c Michael Hanselmann
	autotools/build-bash-completion \
865 d5a2a550 Michael Hanselmann
	autotools/build-rpc \
866 5d3c30df Michael Hanselmann
	autotools/check-header \
867 f6cbcc06 Michael Hanselmann
	autotools/check-imports \
868 c55cc346 Iustin Pop
	autotools/check-man-dashes \
869 58997abb Michael Hanselmann
	autotools/check-man-references \
870 73d0e218 Iustin Pop
	autotools/check-man-warnings \
871 c81ed2b2 Michael Hanselmann
	autotools/check-news \
872 dad26941 Iustin Pop
	autotools/check-python-code \
873 e627fe09 Michael Hanselmann
	autotools/check-tar \
874 96602be4 Michael Hanselmann
	autotools/check-version \
875 d99d1e36 Iustin Pop
	autotools/convert-constants \
876 95eb4188 Michael Hanselmann
	autotools/docpp \
877 208b02e3 Iustin Pop
	autotools/gen-py-coverage \
878 41806ef4 Michael Hanselmann
	autotools/sphinx-wrapper \
879 df69e0a0 Bernardo Dal Seno
	autotools/testrunner \
880 387863a5 Iustin Pop
	autotools/wrong-hardcoded-paths \
881 f3313af5 Guido Trotter
	$(RUN_IN_TEMPDIR) \
882 f154a7a3 Michael Hanselmann
	daemons/daemon-util.in \
883 fc3fd894 Michael Hanselmann
	daemons/ganeti-cleaner.in \
884 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
885 f9435bdc Iustin Pop
	devel/upload \
886 c46a9ffb Michael Hanselmann
	devel/webserver \
887 26916aad Apollon Oikonomopoulos
	tools/kvm-ifup.in \
888 cdd27f7f Michele Tartara
	tools/users-setup.in \
889 29386d3e Michael Hanselmann
	tools/vcluster-setup.in \
890 7cf58cad Michael Hanselmann
	$(docinput) \
891 d17e74b4 Iustin Pop
	doc/html \
892 656a7fdf Iustin Pop
	$(BUILT_EXAMPLES:%=%.in) \
893 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default \
894 752a8ca8 Michael Hanselmann
	doc/examples/ganeti.default-debug \
895 d6d9ce45 Guido Trotter
	doc/examples/hooks/ethers \
896 89c04c2d Guido Trotter
	doc/examples/gnt-debug/README \
897 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay0.json \
898 89c04c2d Guido Trotter
	doc/examples/gnt-debug/delay50.json \
899 90066780 Iustin Pop
	test/py/lockperf.py \
900 90066780 Iustin Pop
	test/py/testutils.py \
901 90066780 Iustin Pop
	test/py/mocks.py \
902 e8230860 Michael Hanselmann
	$(dist_TESTS) \
903 e8230860 Michael Hanselmann
	$(TEST_FILES) \
904 6be8e2bf Iustin Pop
	man/footer.rst \
905 6be8e2bf Iustin Pop
	$(manrst) \
906 f727d134 Michael Hanselmann
	$(maninput) \
907 39e0d19e Michael Hanselmann
	qa/qa-sample.json \
908 d6159933 Iustin Pop
	$(qa_scripts) \
909 51309138 Iustin Pop
	$(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS_IN) \
910 5a1e31b4 Iustin Pop
	$(HS_PROG_SRCS) \
911 3add7574 Iustin Pop
	src/lint-hints.hs \
912 83846468 Iustin Pop
	test/hs/cli-tests-defs.sh \
913 83846468 Iustin Pop
	test/hs/offline-test.sh \
914 7a07475f Iustin Pop
	.ghci
915 e8230860 Michael Hanselmann
916 e8230860 Michael Hanselmann
man_MANS = \
917 bae7e531 Michael Hanselmann
	man/ganeti-cleaner.8 \
918 b7b7cda6 Guido Trotter
	man/ganeti-confd.8 \
919 da7e44ee Michael Hanselmann
	man/ganeti-listrunner.8 \
920 320d986d Iustin Pop
	man/ganeti-masterd.8 \
921 e8230860 Michael Hanselmann
	man/ganeti-noded.8 \
922 e8230860 Michael Hanselmann
	man/ganeti-os-interface.7 \
923 95b92c34 Constantinos Venetsanopoulos
	man/ganeti-extstorage-interface.7 \
924 320d986d Iustin Pop
	man/ganeti-rapi.8 \
925 e8230860 Michael Hanselmann
	man/ganeti-watcher.8 \
926 dad26941 Iustin Pop
	man/ganeti.7 \
927 e8230860 Michael Hanselmann
	man/gnt-backup.8 \
928 e8230860 Michael Hanselmann
	man/gnt-cluster.8 \
929 d3b4cf9f Iustin Pop
	man/gnt-debug.8 \
930 667dbd6b Adeodato Simo
	man/gnt-group.8 \
931 4e4b6b7a Apollon Oikonomopoulos
	man/gnt-network.8 \
932 e8230860 Michael Hanselmann
	man/gnt-instance.8 \
933 d3b4cf9f Iustin Pop
	man/gnt-job.8 \
934 e8230860 Michael Hanselmann
	man/gnt-node.8 \
935 5a19bd35 Iustin Pop
	man/gnt-os.8 \
936 95b92c34 Constantinos Venetsanopoulos
	man/gnt-storage.8 \
937 5a19bd35 Iustin Pop
	man/hail.1 \
938 5a19bd35 Iustin Pop
	man/hbal.1 \
939 f18e4168 Iustin Pop
	man/hcheck.1 \
940 e2bdaf25 René Nussbaumer
	man/hinfo.1 \
941 5a19bd35 Iustin Pop
	man/hscan.1 \
942 d26d808a Iustin Pop
	man/hspace.1 \
943 3504d6c8 Guido Trotter
	man/hroller.1 \
944 332b1340 Michele Tartara
	man/htools.1 \
945 332b1340 Michele Tartara
	man/mon-collector.7
946 e8230860 Michael Hanselmann
947 5ce58234 Michael Hanselmann
# Remove extensions from all filenames in man_MANS
948 5ce58234 Michael Hanselmann
mannoext = $(patsubst %.1,%,$(patsubst %.7,%,$(patsubst %.8,%,$(man_MANS))))
949 5ce58234 Michael Hanselmann
950 5ce58234 Michael Hanselmann
manrst = $(patsubst %,%.rst,$(mannoext))
951 6be8e2bf Iustin Pop
manhtml = $(patsubst %.rst,%.html,$(manrst))
952 fcdb582d Michael Hanselmann
mangen = $(patsubst %.rst,%.gen,$(manrst))
953 25c92bc5 Michael Hanselmann
maninput = \
954 5a19bd35 Iustin Pop
	$(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
955 de8eea3e Iustin Pop
	$(patsubst %.html,%.html.in,$(manhtml)) \
956 6aff0514 Iustin Pop
	$(mangen)
957 e8230860 Michael Hanselmann
958 e8230860 Michael Hanselmann
TEST_FILES = \
959 83846468 Iustin Pop
	test/data/htools/clean-nonzero-score.data \
960 83846468 Iustin Pop
	test/data/htools/common-suffix.data \
961 83846468 Iustin Pop
	test/data/htools/empty-cluster.data \
962 83846468 Iustin Pop
	test/data/htools/hail-alloc-drbd.json \
963 e0d15aae Klaus Aehlig
	test/data/htools/hail-alloc-invalid-twodisks.json \
964 e0d15aae Klaus Aehlig
	test/data/htools/hail-alloc-twodisks.json \
965 83846468 Iustin Pop
	test/data/htools/hail-change-group.json \
966 83846468 Iustin Pop
	test/data/htools/hail-invalid-reloc.json \
967 83846468 Iustin Pop
	test/data/htools/hail-node-evac.json \
968 83846468 Iustin Pop
	test/data/htools/hail-reloc-drbd.json \
969 83846468 Iustin Pop
	test/data/htools/hbal-excl-tags.data \
970 83846468 Iustin Pop
	test/data/htools/hbal-split-insts.data \
971 83846468 Iustin Pop
	test/data/htools/invalid-node.data \
972 83846468 Iustin Pop
	test/data/htools/missing-resources.data \
973 83846468 Iustin Pop
	test/data/htools/n1-failure.data \
974 83846468 Iustin Pop
	test/data/htools/rapi/groups.json \
975 83846468 Iustin Pop
	test/data/htools/rapi/info.json \
976 83846468 Iustin Pop
	test/data/htools/rapi/instances.json \
977 83846468 Iustin Pop
	test/data/htools/rapi/nodes.json \
978 83846468 Iustin Pop
	test/hs/shelltests/htools-balancing.test \
979 83846468 Iustin Pop
	test/hs/shelltests/htools-basic.test \
980 83846468 Iustin Pop
	test/hs/shelltests/htools-dynutil.test \
981 83846468 Iustin Pop
	test/hs/shelltests/htools-excl.test \
982 83846468 Iustin Pop
	test/hs/shelltests/htools-hail.test \
983 83846468 Iustin Pop
	test/hs/shelltests/htools-hspace.test \
984 83846468 Iustin Pop
	test/hs/shelltests/htools-invalid.test \
985 83846468 Iustin Pop
	test/hs/shelltests/htools-multi-group.test \
986 83846468 Iustin Pop
	test/hs/shelltests/htools-no-backend.test \
987 83846468 Iustin Pop
	test/hs/shelltests/htools-rapi.test \
988 83846468 Iustin Pop
	test/hs/shelltests/htools-single-group.test \
989 83846468 Iustin Pop
	test/hs/shelltests/htools-text-backend.test \
990 83846468 Iustin Pop
	test/hs/shelltests/htools-mon-collector.test \
991 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.0.txt \
992 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-8.3.txt \
993 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-disk.txt \
994 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip4.txt \
995 5a672c30 Manuel Franceschini
	test/data/bdev-drbd-net-ip6.txt \
996 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/json_output_empty.txt \
997 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/json_output_extra_matches.txt \
998 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/json_output_no_matches.txt \
999 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/json_output_ok.txt \
1000 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_new_extra_matches.txt \
1001 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_new_no_matches.txt \
1002 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_new_ok.txt \
1003 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_old_empty.txt \
1004 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_old_extra_matches.txt \
1005 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_old_no_matches.txt \
1006 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/plain_output_old_ok.txt \
1007 2e076ede Stratos Psomadakis
	test/data/bdev-rbd/output_invalid.txt \
1008 27e46076 Michael Hanselmann
	test/data/cert1.pem \
1009 d12b9f66 Michael Hanselmann
	test/data/cert2.pem \
1010 d78970ba Michele Tartara
	test/data/instance-minor-pairing.txt \
1011 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-dummy0.txt \
1012 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-ipv4.txt \
1013 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-ipv6.txt \
1014 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline-ipv4.txt \
1015 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline-ipv6.txt \
1016 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo-oneline.txt \
1017 e5d1d1b5 Andrea Spadaccini
	test/data/ip-addr-show-lo.txt \
1018 585c8187 Guido Trotter
	test/data/kvm_0.12.5_help.txt \
1019 dad26941 Iustin Pop
	test/data/kvm_0.15.90_help.txt \
1020 585c8187 Guido Trotter
	test/data/kvm_0.9.1_help.txt \
1021 eb7a6965 Guido Trotter
	test/data/kvm_0.9.1_help_boot_test.txt \
1022 dad26941 Iustin Pop
	test/data/kvm_1.0_help.txt \
1023 eb7a6965 Guido Trotter
	test/data/kvm_1.1.2_help.txt \
1024 1e6fab60 Agata Murawska
	test/data/ovfdata/compr_disk.vmdk.gz \
1025 d92518d3 Agata Murawska
	test/data/ovfdata/config.ini \
1026 1e6fab60 Agata Murawska
	test/data/ovfdata/corrupted_resources.ovf \
1027 d92518d3 Agata Murawska
	test/data/ovfdata/empty.ini \
1028 1e6fab60 Agata Murawska
	test/data/ovfdata/empty.ovf \
1029 1e6fab60 Agata Murawska
	test/data/ovfdata/ganeti.mf \
1030 1e6fab60 Agata Murawska
	test/data/ovfdata/ganeti.ovf \
1031 1e6fab60 Agata Murawska
	test/data/ovfdata/gzip_disk.ovf \
1032 1e6fab60 Agata Murawska
	test/data/ovfdata/new_disk.vmdk \
1033 d92518d3 Agata Murawska
	test/data/ovfdata/no_disk.ini \
1034 1e6fab60 Agata Murawska
	test/data/ovfdata/no_disk_in_ref.ovf \
1035 d92518d3 Agata Murawska
	test/data/ovfdata/no_os.ini \
1036 1e6fab60 Agata Murawska
	test/data/ovfdata/no_ovf.ova \
1037 dad26941 Iustin Pop
	test/data/ovfdata/other/rawdisk.raw \
1038 1e6fab60 Agata Murawska
	test/data/ovfdata/ova.ova \
1039 d92518d3 Agata Murawska
	test/data/ovfdata/rawdisk.raw \
1040 dad26941 Iustin Pop
	test/data/ovfdata/second_disk.vmdk \
1041 d92518d3 Agata Murawska
	test/data/ovfdata/unsafe_path.ini \
1042 1e6fab60 Agata Murawska
	test/data/ovfdata/virtualbox.ovf \
1043 d92518d3 Agata Murawska
	test/data/ovfdata/wrong_config.ini \
1044 dad26941 Iustin Pop
	test/data/ovfdata/wrong_extension.ovd \
1045 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_manifest.mf \
1046 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_manifest.ovf \
1047 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_ova.ova \
1048 1e6fab60 Agata Murawska
	test/data/ovfdata/wrong_xml.ovf \
1049 dad26941 Iustin Pop
	test/data/proc_drbd8.txt \
1050 dad26941 Iustin Pop
	test/data/proc_drbd80-emptyline.txt \
1051 dad26941 Iustin Pop
	test/data/proc_drbd83.txt \
1052 dad26941 Iustin Pop
	test/data/proc_drbd83_sync.txt \
1053 a52f8e72 Michele Tartara
	test/data/proc_drbd83_sync_want.txt \
1054 dad26941 Iustin Pop
	test/data/proc_drbd83_sync_krnl2.6.39.txt \
1055 dad26941 Iustin Pop
	test/data/sys_drbd_usermode_helper.txt \
1056 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.02.txt \
1057 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.66-fail.txt \
1058 1a1e7ab3 Iustin Pop
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
1059 1a1e7ab3 Iustin Pop
	test/data/vgs-missing-pvs-2.02.02.txt \
1060 1a1e7ab3 Iustin Pop
	test/data/vgs-missing-pvs-2.02.66.txt \
1061 90066780 Iustin Pop
	test/py/ganeti-cli.test \
1062 90066780 Iustin Pop
	test/py/gnt-cli.test \
1063 90066780 Iustin Pop
	test/py/import-export_unittest-helper
1064 e8230860 Michael Hanselmann
1065 e8c8cf1a Michael Hanselmann
python_tests = \
1066 3ade0e0e Michael Hanselmann
	doc/examples/rapi_testutils.py \
1067 90066780 Iustin Pop
	test/py/cfgupgrade_unittest.py \
1068 90066780 Iustin Pop
	test/py/docs_unittest.py \
1069 90066780 Iustin Pop
	test/py/ganeti.asyncnotifier_unittest.py \
1070 90066780 Iustin Pop
	test/py/ganeti.backend_unittest-runasroot.py \
1071 90066780 Iustin Pop
	test/py/ganeti.backend_unittest.py \
1072 90066780 Iustin Pop
	test/py/ganeti.bdev_unittest.py \
1073 90066780 Iustin Pop
	test/py/ganeti.cli_unittest.py \
1074 90066780 Iustin Pop
	test/py/ganeti.client.gnt_cluster_unittest.py \
1075 90066780 Iustin Pop
	test/py/ganeti.client.gnt_instance_unittest.py \
1076 90066780 Iustin Pop
	test/py/ganeti.client.gnt_job_unittest.py \
1077 90066780 Iustin Pop
	test/py/ganeti.cmdlib_unittest.py \
1078 90066780 Iustin Pop
	test/py/ganeti.compat_unittest.py \
1079 90066780 Iustin Pop
	test/py/ganeti.confd.client_unittest.py \
1080 90066780 Iustin Pop
	test/py/ganeti.config_unittest.py \
1081 90066780 Iustin Pop
	test/py/ganeti.constants_unittest.py \
1082 90066780 Iustin Pop
	test/py/ganeti.daemon_unittest.py \
1083 90066780 Iustin Pop
	test/py/ganeti.errors_unittest.py \
1084 90066780 Iustin Pop
	test/py/ganeti.hooks_unittest.py \
1085 90066780 Iustin Pop
	test/py/ganeti.ht_unittest.py \
1086 90066780 Iustin Pop
	test/py/ganeti.http_unittest.py \
1087 90066780 Iustin Pop
	test/py/ganeti.hypervisor.hv_chroot_unittest.py \
1088 90066780 Iustin Pop
	test/py/ganeti.hypervisor.hv_fake_unittest.py \
1089 90066780 Iustin Pop
	test/py/ganeti.hypervisor.hv_kvm_unittest.py \
1090 90066780 Iustin Pop
	test/py/ganeti.hypervisor.hv_lxc_unittest.py \
1091 90066780 Iustin Pop
	test/py/ganeti.hypervisor.hv_xen_unittest.py \
1092 90066780 Iustin Pop
	test/py/ganeti.hypervisor_unittest.py \
1093 90066780 Iustin Pop
	test/py/ganeti.impexpd_unittest.py \
1094 90066780 Iustin Pop
	test/py/ganeti.jqueue_unittest.py \
1095 90066780 Iustin Pop
	test/py/ganeti.jstore_unittest.py \
1096 90066780 Iustin Pop
	test/py/ganeti.locking_unittest.py \
1097 90066780 Iustin Pop
	test/py/ganeti.luxi_unittest.py \
1098 90066780 Iustin Pop
	test/py/ganeti.masterd.iallocator_unittest.py \
1099 90066780 Iustin Pop
	test/py/ganeti.masterd.instance_unittest.py \
1100 90066780 Iustin Pop
	test/py/ganeti.mcpu_unittest.py \
1101 90066780 Iustin Pop
	test/py/ganeti.netutils_unittest.py \
1102 90066780 Iustin Pop
	test/py/ganeti.objects_unittest.py \
1103 90066780 Iustin Pop
	test/py/ganeti.opcodes_unittest.py \
1104 473d87a3 Iustin Pop
	test/py/ganeti.outils_unittest.py \
1105 90066780 Iustin Pop
	test/py/ganeti.ovf_unittest.py \
1106 90066780 Iustin Pop
	test/py/ganeti.qlang_unittest.py \
1107 90066780 Iustin Pop
	test/py/ganeti.query_unittest.py \
1108 90066780 Iustin Pop
	test/py/ganeti.rapi.baserlib_unittest.py \
1109 90066780 Iustin Pop
	test/py/ganeti.rapi.client_unittest.py \
1110 90066780 Iustin Pop
	test/py/ganeti.rapi.resources_unittest.py \
1111 90066780 Iustin Pop
	test/py/ganeti.rapi.rlib2_unittest.py \
1112 90066780 Iustin Pop
	test/py/ganeti.rapi.testutils_unittest.py \
1113 90066780 Iustin Pop
	test/py/ganeti.rpc_unittest.py \
1114 90066780 Iustin Pop
	test/py/ganeti.runtime_unittest.py \
1115 90066780 Iustin Pop
	test/py/ganeti.serializer_unittest.py \
1116 90066780 Iustin Pop
	test/py/ganeti.server.rapi_unittest.py \
1117 90066780 Iustin Pop
	test/py/ganeti.ssconf_unittest.py \
1118 90066780 Iustin Pop
	test/py/ganeti.ssh_unittest.py \
1119 90066780 Iustin Pop
	test/py/ganeti.storage_unittest.py \
1120 43a840a3 Michael Hanselmann
	test/py/ganeti.tools.burnin_unittest.py \
1121 90066780 Iustin Pop
	test/py/ganeti.tools.ensure_dirs_unittest.py \
1122 90066780 Iustin Pop
	test/py/ganeti.tools.node_daemon_setup_unittest.py \
1123 90066780 Iustin Pop
	test/py/ganeti.tools.prepare_node_join_unittest.py \
1124 90066780 Iustin Pop
	test/py/ganeti.uidpool_unittest.py \
1125 90066780 Iustin Pop
	test/py/ganeti.utils.algo_unittest.py \
1126 90066780 Iustin Pop
	test/py/ganeti.utils.filelock_unittest.py \
1127 90066780 Iustin Pop
	test/py/ganeti.utils.hash_unittest.py \
1128 90066780 Iustin Pop
	test/py/ganeti.utils.io_unittest-runasroot.py \
1129 90066780 Iustin Pop
	test/py/ganeti.utils.io_unittest.py \
1130 90066780 Iustin Pop
	test/py/ganeti.utils.log_unittest.py \
1131 23d95cff Bernardo Dal Seno
	test/py/ganeti.utils.lvm_unittest.py \
1132 90066780 Iustin Pop
	test/py/ganeti.utils.mlock_unittest.py \
1133 90066780 Iustin Pop
	test/py/ganeti.utils.nodesetup_unittest.py \
1134 90066780 Iustin Pop
	test/py/ganeti.utils.process_unittest.py \
1135 90066780 Iustin Pop
	test/py/ganeti.utils.retry_unittest.py \
1136 90066780 Iustin Pop
	test/py/ganeti.utils.text_unittest.py \
1137 90066780 Iustin Pop
	test/py/ganeti.utils.wrapper_unittest.py \
1138 90066780 Iustin Pop
	test/py/ganeti.utils.x509_unittest.py \
1139 90066780 Iustin Pop
	test/py/ganeti.utils_unittest.py \
1140 90066780 Iustin Pop
	test/py/ganeti.vcluster_unittest.py \
1141 90066780 Iustin Pop
	test/py/ganeti.workerpool_unittest.py \
1142 90066780 Iustin Pop
	test/py/pycurl_reset_unittest.py \
1143 90066780 Iustin Pop
	test/py/qa.qa_config_unittest.py \
1144 90066780 Iustin Pop
	test/py/tempfile_fork_unittest.py
1145 e8230860 Michael Hanselmann
1146 3e16567e Iustin Pop
haskell_tests = test/hs/htest
1147 b91e9518 Iustin Pop
1148 e8c8cf1a Michael Hanselmann
dist_TESTS = \
1149 90066780 Iustin Pop
	test/py/check-cert-expired_unittest.bash \
1150 90066780 Iustin Pop
	test/py/daemon-util_unittest.bash \
1151 90066780 Iustin Pop
	test/py/ganeti-cleaner_unittest.bash \
1152 90066780 Iustin Pop
	test/py/import-export_unittest.bash \
1153 90066780 Iustin Pop
	test/py/cli-test.bash \
1154 90066780 Iustin Pop
	test/py/bash_completion.bash \
1155 e8c8cf1a Michael Hanselmann
	$(python_tests)
1156 e8c8cf1a Michael Hanselmann
1157 e8230860 Michael Hanselmann
nodist_TESTS =
1158 d3cd5a3f Iustin Pop
check_SCRIPTS =
1159 d3cd5a3f Iustin Pop
1160 d9a900dc Iustin Pop
if WANT_HSTESTS
1161 b91e9518 Iustin Pop
nodist_TESTS += $(haskell_tests)
1162 83846468 Iustin Pop
dist_TESTS += test/hs/offline-test.sh
1163 cefd4a4a Michele Tartara
check_SCRIPTS += \
1164 83846468 Iustin Pop
	test/hs/hpc-htools \
1165 83846468 Iustin Pop
	test/hs/hpc-mon-collector \
1166 cefd4a4a Michele Tartara
	$(HS_BUILT_TEST_HELPERS)
1167 b91e9518 Iustin Pop
endif
1168 e8230860 Michael Hanselmann
1169 e8230860 Michael Hanselmann
TESTS = $(dist_TESTS) $(nodist_TESTS)
1170 e8230860 Michael Hanselmann
1171 27e336af Michael Hanselmann
# Environment for all tests
1172 27e336af Michael Hanselmann
PLAIN_TESTS_ENVIRONMENT = \
1173 30f2802f Iustin Pop
	PYTHONPATH=. \
1174 30f2802f Iustin Pop
	TOP_SRCDIR=$(abs_top_srcdir) TOP_BUILDDIR=$(abs_top_builddir) \
1175 30f2802f Iustin Pop
	PYTHON=$(PYTHON) FAKEROOT=$(FAKEROOT_PATH) \
1176 30f2802f Iustin Pop
	$(RUN_IN_TEMPDIR)
1177 27e336af Michael Hanselmann
1178 27e336af Michael Hanselmann
# Environment for tests run by automake
1179 f848ac00 Michael Hanselmann
TESTS_ENVIRONMENT = \
1180 e8c8cf1a Michael Hanselmann
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
1181 6e06b36c Iustin Pop
1182 eed5c5df Michael Hanselmann
all_python_code = \
1183 01a3a718 Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
1184 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1185 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
1186 0d2bf835 René Nussbaumer
	$(nodist_pkglib_python_scripts) \
1187 d5fe5fa9 Michael Hanselmann
	$(nodist_tools_python_scripts) \
1188 e8c8cf1a Michael Hanselmann
	$(python_tests) \
1189 01a3a718 Michael Hanselmann
	$(pkgpython_PYTHON) \
1190 2d48a3a2 Michael Hanselmann
	$(client_PYTHON) \
1191 01a3a718 Michael Hanselmann
	$(hypervisor_PYTHON) \
1192 01a3a718 Michael Hanselmann
	$(rapi_PYTHON) \
1193 899c4d2c Michael Hanselmann
	$(server_PYTHON) \
1194 0d2bf835 René Nussbaumer
	$(pytools_PYTHON) \
1195 01a3a718 Michael Hanselmann
	$(http_PYTHON) \
1196 01a3a718 Michael Hanselmann
	$(confd_PYTHON) \
1197 dc101ecc Michael Hanselmann
	$(masterd_PYTHON) \
1198 bb44b1ae Michael Hanselmann
	$(impexpd_PYTHON) \
1199 c047a981 Michael Hanselmann
	$(utils_PYTHON) \
1200 9f4bb951 Michael Hanselmann
	$(watcher_PYTHON) \
1201 a8c68e44 Michael Hanselmann
	$(noinst_PYTHON) \
1202 a8c68e44 Michael Hanselmann
	$(qa_scripts)
1203 01a3a718 Michael Hanselmann
1204 eed5c5df Michael Hanselmann
srclink_files = \
1205 6be8e2bf Iustin Pop
	man/footer.rst \
1206 90066780 Iustin Pop
	test/py/check-cert-expired_unittest.bash \
1207 90066780 Iustin Pop
	test/py/daemon-util_unittest.bash \
1208 90066780 Iustin Pop
	test/py/ganeti-cleaner_unittest.bash \
1209 90066780 Iustin Pop
	test/py/import-export_unittest.bash \
1210 90066780 Iustin Pop
	test/py/cli-test.bash \
1211 90066780 Iustin Pop
	test/py/bash_completion.bash \
1212 83846468 Iustin Pop
	test/hs/offline-test.sh \
1213 83846468 Iustin Pop
	test/hs/cli-tests-defs.sh \
1214 d6159933 Iustin Pop
	$(all_python_code) \
1215 7cf58cad Michael Hanselmann
	$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
1216 7cf58cad Michael Hanselmann
	$(docinput)
1217 eed5c5df Michael Hanselmann
1218 eed5c5df Michael Hanselmann
check_python_code = \
1219 e4e7c7df Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
1220 f6cbcc06 Michael Hanselmann
	$(CHECK_IMPORTS) \
1221 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1222 95eb4188 Michael Hanselmann
	$(DOCPP) \
1223 eed5c5df Michael Hanselmann
	$(all_python_code)
1224 eed5c5df Michael Hanselmann
1225 e4e7c7df Michael Hanselmann
lint_python_code = \
1226 f60d352e Michael Hanselmann
	ganeti \
1227 f1763373 Iustin Pop
	ganeti/http/server.py \
1228 f60d352e Michael Hanselmann
	$(dist_sbin_SCRIPTS) \
1229 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1230 2d76b580 Michael Hanselmann
	$(pkglib_python_scripts) \
1231 2cc8bdd0 Michael Hanselmann
	$(BUILD_BASH_COMPLETION) \
1232 f6cbcc06 Michael Hanselmann
	$(CHECK_IMPORTS) \
1233 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1234 95eb4188 Michael Hanselmann
	$(DOCPP) \
1235 2cc8bdd0 Michael Hanselmann
	$(PYTHON_BOOTSTRAP)
1236 eed5c5df Michael Hanselmann
1237 f6cbcc06 Michael Hanselmann
standalone_python_modules = \
1238 f6cbcc06 Michael Hanselmann
	lib/rapi/client.py \
1239 f6cbcc06 Michael Hanselmann
	tools/ganeti-listrunner
1240 f6cbcc06 Michael Hanselmann
1241 21bf2e2e Andrea Spadaccini
pep8_python_code = \
1242 21bf2e2e Andrea Spadaccini
	ganeti \
1243 21bf2e2e Andrea Spadaccini
	ganeti/http/server.py \
1244 21bf2e2e Andrea Spadaccini
	$(dist_sbin_SCRIPTS) \
1245 cc120286 Bernardo Dal Seno
	$(python_scripts) \
1246 21bf2e2e Andrea Spadaccini
	$(pkglib_python_scripts) \
1247 21bf2e2e Andrea Spadaccini
	$(BUILD_BASH_COMPLETION) \
1248 5d3c30df Michael Hanselmann
	$(CHECK_HEADER) \
1249 21bf2e2e Andrea Spadaccini
	$(DOCPP) \
1250 21bf2e2e Andrea Spadaccini
	$(PYTHON_BOOTSTRAP) \
1251 21bf2e2e Andrea Spadaccini
	qa
1252 21bf2e2e Andrea Spadaccini
1253 90066780 Iustin Pop
test/py/daemon-util_unittest.bash: daemons/daemon-util
1254 571b34f8 Michael Hanselmann
1255 90066780 Iustin Pop
test/py/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
1256 7172f605 Michael Hanselmann
1257 90066780 Iustin Pop
test/py/bash_completion.bash: doc/examples/bash_completion-debug
1258 92886204 Michael Hanselmann
1259 26916aad Apollon Oikonomopoulos
tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
1260 26916aad Apollon Oikonomopoulos
	sed -f $(REPLACE_VARS_SED) < $< > $@
1261 26916aad Apollon Oikonomopoulos
	chmod +x $@
1262 26916aad Apollon Oikonomopoulos
1263 cdd27f7f Michele Tartara
tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
1264 cdd27f7f Michele Tartara
	sed -f $(REPLACE_VARS_SED) < $< > $@
1265 cdd27f7f Michele Tartara
	chmod +x $@
1266 cdd27f7f Michele Tartara
1267 29386d3e Michael Hanselmann
tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
1268 29386d3e Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1269 29386d3e Michael Hanselmann
	chmod +x $@
1270 29386d3e Michael Hanselmann
1271 490bec02 Iustin Pop
daemons/%:: daemons/%.in $(REPLACE_VARS_SED)
1272 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1273 5c566e17 Michael Hanselmann
	chmod +x $@
1274 e8230860 Michael Hanselmann
1275 490bec02 Iustin Pop
doc/examples/%:: doc/examples/%.in $(REPLACE_VARS_SED)
1276 e8230860 Michael Hanselmann
	sed -f $(REPLACE_VARS_SED) < $< > $@
1277 e8230860 Michael Hanselmann
1278 e80aeb89 Michael Hanselmann
doc/examples/bash_completion: BC_ARGS = --compact
1279 e80aeb89 Michael Hanselmann
doc/examples/bash_completion-debug: BC_ARGS =
1280 e80aeb89 Michael Hanselmann
1281 e80aeb89 Michael Hanselmann
doc/examples/bash_completion doc/examples/bash_completion-debug: \
1282 e80aeb89 Michael Hanselmann
	$(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1283 4c3d5fb6 Iustin Pop
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1284 46118ed2 Iustin Pop
	daemons/ganeti-cleaner \
1285 d9a900dc Iustin Pop
	$(GENERATED_FILES) $(HS_GENERATED_FILES)
1286 e80aeb89 Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1287 e80aeb89 Michael Hanselmann
	  $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1288 4f3d5b76 Michael Hanselmann
1289 7142485a Iustin Pop
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
1290 d7772efa Iustin Pop
	lib/build/shell_example_lexer.py \
1291 a13d6911 Iustin Pop
	| $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
1292 387863a5 Iustin Pop
	@echo "Checking $< for hardcoded paths..."
1293 387863a5 Iustin Pop
	@if grep -nEf autotools/wrong-hardcoded-paths $<; then \
1294 58997abb Michael Hanselmann
	  echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
1295 387863a5 Iustin Pop
	  exit 1; \
1296 387863a5 Iustin Pop
	fi
1297 a13d6911 Iustin Pop
	set -e ; \
1298 a13d6911 Iustin Pop
	trap 'echo auto-removing $@; rm $@' EXIT; \
1299 a13d6911 Iustin Pop
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
1300 58997abb Michael Hanselmann
	$(CHECK_MAN_REFERENCES) $@; \
1301 a13d6911 Iustin Pop
	trap - EXIT
1302 fcdb582d Michael Hanselmann
1303 37cfb91f Michael Hanselmann
man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
1304 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
1305 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1306 67c15d8b Iustin Pop
	set -o pipefail -e; \
1307 9c45babb Iustin Pop
	trap 'echo auto-removing $@; rm $@' EXIT; \
1308 6aff0514 Iustin Pop
	$(PANDOC) -s -f rst -t man $< man/footer.rst | \
1309 9c45babb Iustin Pop
	  sed -e 's/\\@/@/g' > $@; \
1310 73d0e218 Iustin Pop
	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
1311 c55cc346 Iustin Pop
	$(CHECK_MAN_DASHES) $@; \
1312 9c45babb Iustin Pop
	trap - EXIT
1313 9c45babb Iustin Pop
1314 37cfb91f Michael Hanselmann
man/%.html.in: man/%.gen man/footer.rst
1315 6be8e2bf Iustin Pop
	@test -n "$(PANDOC)" || \
1316 6be8e2bf Iustin Pop
	  { echo 'pandoc' not found during configure; exit 1; }
1317 a01dd3c6 Iustin Pop
	set -o pipefail ; \
1318 74412d69 Iustin Pop
	$(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
1319 6be8e2bf Iustin Pop
	  sed -e 's/\\@/@/g' > $@
1320 6be8e2bf Iustin Pop
1321 55398706 Iustin Pop
man/%: man/%.in  $(REPLACE_VARS_SED)
1322 2ab2b9f5 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
1323 f29266b4 Iustin Pop
1324 fc1282b8 Iustin Pop
epydoc.conf: epydoc.conf.in $(REPLACE_VARS_SED)
1325 fc1282b8 Iustin Pop
	sed -f $(REPLACE_VARS_SED) < $< > $@
1326 f774bd03 Michael Hanselmann
1327 84a12e40 Iustin Pop
vcs-version:
1328 84a12e40 Iustin Pop
	if test -d .git; then \
1329 84a12e40 Iustin Pop
	  git describe > $@; \
1330 84a12e40 Iustin Pop
	elif test ! -f $@ ; then \
1331 84a12e40 Iustin Pop
	  echo "Cannot auto-generate $@ file"; exit 1; \
1332 84a12e40 Iustin Pop
	fi
1333 84a12e40 Iustin Pop
1334 316dc1ff Iustin Pop
.PHONY: clean-vcs-version
1335 316dc1ff Iustin Pop
clean-vcs-version:
1336 316dc1ff Iustin Pop
	rm -f vcs-version
1337 316dc1ff Iustin Pop
1338 84a12e40 Iustin Pop
.PHONY: regen-vcs-version
1339 84a12e40 Iustin Pop
regen-vcs-version:
1340 6376dcc0 Iustin Pop
	@set -e; \
1341 84a12e40 Iustin Pop
	cd $(srcdir); \
1342 84a12e40 Iustin Pop
	if test -d .git; then \
1343 6376dcc0 Iustin Pop
	  T=`mktemp` ; trap 'rm -f $$T' EXIT; \
1344 6376dcc0 Iustin Pop
	  git describe > $$T; \
1345 6376dcc0 Iustin Pop
	  if ! cmp --quiet $$T vcs-version; then \
1346 6376dcc0 Iustin Pop
	    mv $$T vcs-version; \
1347 6376dcc0 Iustin Pop
	  fi; \
1348 84a12e40 Iustin Pop
	fi
1349 84a12e40 Iustin Pop
1350 3add7574 Iustin Pop
src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
1351 4c3d5fb6 Iustin Pop
	vcs-version $(built_base_sources)
1352 d6159933 Iustin Pop
	set -e; \
1353 d6159933 Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1354 d6159933 Iustin Pop
	sed -e "s/%ver%/$$VCSVER/" < $< > $@
1355 d6159933 Iustin Pop
1356 3add7574 Iustin Pop
src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
1357 94811696 Michael Hanselmann
	lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
1358 27a19bf6 Michael Hanselmann
	lib/jstore.py $(RUN_IN_TEMPDIR) \
1359 4c3d5fb6 Iustin Pop
	$(CONVERT_CONSTANTS) $(built_base_sources) \
1360 ef958f2a Iustin Pop
	| lib/_vcsversion.py
1361 11fd5a86 Iustin Pop
	set -e; \
1362 acaf3ca7 Iustin Pop
	{ cat $< ; \
1363 acaf3ca7 Iustin Pop
	  PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CONVERT_CONSTANTS); \
1364 acaf3ca7 Iustin Pop
	} > $@
1365 d99d1e36 Iustin Pop
1366 83846468 Iustin Pop
test/hs/Test/Ganeti/TestImports.hs: test/hs/Test/Ganeti/TestImports.hs.in \
1367 b88fcdd0 Iustin Pop
	$(built_base_sources)
1368 b88fcdd0 Iustin Pop
	set -e; \
1369 b88fcdd0 Iustin Pop
	{ cat $< ; \
1370 b88fcdd0 Iustin Pop
	  echo ; \
1371 3add7574 Iustin Pop
	  for name in $(filter-out Ganeti.THH,$(subst /,.,$(patsubst %.hs,%,$(patsubst src/%,%,$(HS_LIB_SRCS))))) ; do \
1372 b88fcdd0 Iustin Pop
	    echo "import $$name ()" ; \
1373 b88fcdd0 Iustin Pop
	  done ; \
1374 b88fcdd0 Iustin Pop
	} > $@
1375 b88fcdd0 Iustin Pop
1376 3735787e Iustin Pop
lib/_autoconf.py: Makefile | stamp-directories
1377 84a12e40 Iustin Pop
	set -e; \
1378 e8230860 Michael Hanselmann
	{ echo '# This file is automatically generated, do not edit!'; \
1379 e8230860 Michael Hanselmann
	  echo '#'; \
1380 67047322 Iustin Pop
	  echo ''; \
1381 67047322 Iustin Pop
	  echo '"""Build-time configuration for Ganeti.'; \
1382 67047322 Iustin Pop
	  echo '';\
1383 67047322 Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
1384 67047322 Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
1385 67047322 Iustin Pop
	  echo 'not edit by hand).'; \
1386 67047322 Iustin Pop
	  echo ''; \
1387 67047322 Iustin Pop
	  echo '"""'; \
1388 67047322 Iustin Pop
	  echo ''; \
1389 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0301,C0324'; \
1390 0a4e7f24 Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
1391 0a4e7f24 Iustin Pop
	  echo '# style warnings' ; \
1392 0a4e7f24 Iustin Pop
	  echo ''; \
1393 e8230860 Michael Hanselmann
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
1394 e8230860 Michael Hanselmann
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
1395 e8230860 Michael Hanselmann
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
1396 e8230860 Michael Hanselmann
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
1397 e8230860 Michael Hanselmann
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
1398 e8230860 Michael Hanselmann
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
1399 e8230860 Michael Hanselmann
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
1400 e8230860 Michael Hanselmann
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
1401 553bd93f Vitaly Kuznetsov
	  echo "SSH_CONFIG_DIR = '$(SSH_CONFIG_DIR)'"; \
1402 052783ff Michael Hanselmann
	  echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
1403 052783ff Michael Hanselmann
	  echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
1404 e8230860 Michael Hanselmann
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
1405 e8230860 Michael Hanselmann
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
1406 376631d1 Constantinos Venetsanopoulos
	  echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
1407 2f2dbb4b Jun Futagawa
	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
1408 a8e8c0c6 Michael Hanselmann
	  echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
1409 e8230860 Michael Hanselmann
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
1410 e8230860 Michael Hanselmann
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
1411 b8203e1e Iustin Pop
	  echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
1412 e8230860 Michael Hanselmann
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
1413 cb7c0198 Iustin Pop
	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
1414 4b97f902 Apollon Oikonomopoulos
	  echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
1415 4b97f902 Apollon Oikonomopoulos
	  echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
1416 e8230860 Michael Hanselmann
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
1417 7e2c5b9e Guido Trotter
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
1418 c4dfb0b6 Andrea Spadaccini
	  echo "IP_PATH = '$(IP_PATH)'"; \
1419 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_PATH = '$(SOCAT)'"; \
1420 fe5b0c42 Michael Hanselmann
	  echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
1421 e90739d6 Michael Hanselmann
	  echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
1422 bea60381 Michael Hanselmann
	  echo "LVM_STRIPECOUNT = $(LVM_STRIPECOUNT)"; \
1423 bea60381 Michael Hanselmann
	  echo "TOOLSDIR = '$(toolsdir)'"; \
1424 4f3d5b76 Michael Hanselmann
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
1425 ada0e680 Iustin Pop
	  echo "HTOOLS_PROGS = [$(foreach i,$(HS_HTOOLS_PROGS),'$(i)',)]"; \
1426 f154a7a3 Michael Hanselmann
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
1427 8a69b3a8 Andrea Spadaccini
	  echo "DRBD_BARRIERS = '$(DRBD_BARRIERS)'"; \
1428 8a69b3a8 Andrea Spadaccini
	  echo "DRBD_NO_META_FLUSH = $(DRBD_NO_META_FLUSH)"; \
1429 551b6283 Iustin Pop
	  echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
1430 8b72b05c René Nussbaumer
	  echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
1431 f12e1736 René Nussbaumer
	  echo "ADMIN_GROUP = '$(ADMIN_GROUP)'"; \
1432 8b72b05c René Nussbaumer
	  echo "MASTERD_USER = '$(MASTERD_USER)'"; \
1433 f12e1736 René Nussbaumer
	  echo "MASTERD_GROUP = '$(MASTERD_GROUP)'"; \
1434 8b72b05c René Nussbaumer
	  echo "RAPI_USER = '$(RAPI_USER)'"; \
1435 f12e1736 René Nussbaumer
	  echo "RAPI_GROUP = '$(RAPI_GROUP)'"; \
1436 f12e1736 René Nussbaumer
	  echo "CONFD_USER = '$(CONFD_USER)'"; \
1437 f12e1736 René Nussbaumer
	  echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
1438 f12e1736 René Nussbaumer
	  echo "NODED_USER = '$(NODED_USER)'"; \
1439 03881cb0 René Nussbaumer
	  echo "NODED_GROUP = '$(NODED_GROUP)'"; \
1440 3536c792 Iustin Pop
	  echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
1441 a002ed79 Agata Murawska
	  echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
1442 21a5e56c Iustin Pop
	  echo "HTOOLS = True"; \
1443 cd8b0072 Iustin Pop
	  echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
1444 1eb37421 René Nussbaumer
	  echo "XEN_CMD = '$(XEN_CMD)'"; \
1445 42ab9ac4 Iustin Pop
	  echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1446 1fdeb284 Michael Hanselmann
	  echo "ENABLE_RESTRICTED_COMMANDS = $(ENABLE_RESTRICTED_COMMANDS)"; \
1447 988dc5ca Iustin Pop
	  echo "ENABLE_MONITORING = $(ENABLE_MONITORING)"; \
1448 5ce58234 Michael Hanselmann
## Write dictionary with man page name as the key and the section number as the
1449 5ce58234 Michael Hanselmann
## value
1450 5ce58234 Michael Hanselmann
	  echo "MAN_PAGES = {"; \
1451 5ce58234 Michael Hanselmann
	  for i in $(notdir $(man_MANS)); do \
1452 5ce58234 Michael Hanselmann
	    echo "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/  "\1": \2,/g'; \
1453 5ce58234 Michael Hanselmann
	  done; \
1454 5ce58234 Michael Hanselmann
	  echo "}"; \
1455 e8230860 Michael Hanselmann
	} > $@
1456 e8230860 Michael Hanselmann
1457 3735787e Iustin Pop
lib/_vcsversion.py: Makefile vcs-version | stamp-directories
1458 13aeae6a Iustin Pop
	set -e; \
1459 13aeae6a Iustin Pop
	VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
1460 13aeae6a Iustin Pop
	{ echo '# This file is automatically generated, do not edit!'; \
1461 13aeae6a Iustin Pop
	  echo '#'; \
1462 13aeae6a Iustin Pop
	  echo ''; \
1463 13aeae6a Iustin Pop
	  echo '"""Build-time VCS version number for Ganeti.'; \
1464 13aeae6a Iustin Pop
	  echo '';\
1465 13aeae6a Iustin Pop
	  echo 'This file is autogenerated by the build process.'; \
1466 13aeae6a Iustin Pop
	  echo 'For any changes you need to re-run ./configure (and'; \
1467 13aeae6a Iustin Pop
	  echo 'not edit by hand).'; \
1468 13aeae6a Iustin Pop
	  echo ''; \
1469 13aeae6a Iustin Pop
	  echo '"""'; \
1470 13aeae6a Iustin Pop
	  echo ''; \
1471 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0301,C0324'; \
1472 13aeae6a Iustin Pop
	  echo '# because this is autogenerated, we do not want'; \
1473 13aeae6a Iustin Pop
	  echo '# style warnings' ; \
1474 13aeae6a Iustin Pop
	  echo ''; \
1475 13aeae6a Iustin Pop
	  echo "VCS_VERSION = '$$VCSVER'"; \
1476 13aeae6a Iustin Pop
	} > $@
1477 13aeae6a Iustin Pop
1478 96a7481d Michael Hanselmann
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
1479 96a7481d Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(BUILD_RPC) lib/rpc_defs.py > $@
1480 d5a2a550 Michael Hanselmann
1481 6e3bf290 Michael Hanselmann
$(SHELL_ENV_INIT): Makefile stamp-directories
1482 6e3bf290 Michael Hanselmann
	set -e; \
1483 6e3bf290 Michael Hanselmann
	{ echo '# Allow overriding for tests'; \
1484 6e3bf290 Michael Hanselmann
	  echo 'readonly LOCALSTATEDIR=$${LOCALSTATEDIR:-$${GANETI_ROOTDIR:-}$(localstatedir)}'; \
1485 6e3bf290 Michael Hanselmann
	  echo 'readonly SYSCONFDIR=$${SYSCONFDIR:-$${GANETI_ROOTDIR:-}$(sysconfdir)}'; \
1486 6e3bf290 Michael Hanselmann
	  echo; \
1487 6e3bf290 Michael Hanselmann
	  echo 'readonly PKGLIBDIR=$(pkglibdir)'; \
1488 6e3bf290 Michael Hanselmann
	  echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
1489 6e3bf290 Michael Hanselmann
	  echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
1490 6e3bf290 Michael Hanselmann
	  echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
1491 6e3bf290 Michael Hanselmann
	  echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
1492 6e3bf290 Michael Hanselmann
	} > $@
1493 6e3bf290 Michael Hanselmann
1494 df1d5c8f Michael Hanselmann
## Writes sed script to replace placeholders with build-time values. The
1495 df1d5c8f Michael Hanselmann
## additional quotes after the first @ sign are necessary to stop configure
1496 df1d5c8f Michael Hanselmann
## from replacing those values as well.
1497 6e3bf290 Michael Hanselmann
$(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
1498 e8230860 Michael Hanselmann
	set -e; \
1499 df1d5c8f Michael Hanselmann
	{ echo 's#@''PREFIX@#$(prefix)#g'; \
1500 df1d5c8f Michael Hanselmann
	  echo 's#@''SYSCONFDIR@#$(sysconfdir)#g'; \
1501 df1d5c8f Michael Hanselmann
	  echo 's#@''LOCALSTATEDIR@#$(localstatedir)#g'; \
1502 df1d5c8f Michael Hanselmann
	  echo 's#@''BINDIR@#$(bindir)#g'; \
1503 df1d5c8f Michael Hanselmann
	  echo 's#@''SBINDIR@#$(sbindir)#g'; \
1504 df1d5c8f Michael Hanselmann
	  echo 's#@''LIBDIR@#$(libdir)#g'; \
1505 df1d5c8f Michael Hanselmann
	  echo 's#@''GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
1506 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_XEN_BOOTLOADER@#$(XEN_BOOTLOADER)#g'; \
1507 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
1508 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
1509 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_IALLOCATOR_SEARCH_PATH@#$(IALLOCATOR_SEARCH_PATH)#g'; \
1510 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_EXPORT_DIR@#$(EXPORT_DIR)#g'; \
1511 df1d5c8f Michael Hanselmann
	  echo 's#@''RPL_FILE_STORAGE_DIR@#$(FILE_STORAGE_DIR)#g'; \
1512 df1d5c8f Michael Hanselmann
	  echo 's#@''RPL_SSH_INITD_SCRIPT@#$(SSH_INITD_SCRIPT)#g'; \
1513 df1d5c8f Michael Hanselmann
	  echo 's#@''PKGLIBDIR@#$(pkglibdir)#g'; \
1514 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTMASTERUSER@#$(MASTERD_USER)#g'; \
1515 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTRAPIUSER@#$(RAPI_USER)#g'; \
1516 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTCONFDUSER@#$(CONFD_USER)#g'; \
1517 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTNODEDUSER@#$(NODED_USER)#g'; \
1518 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTRAPIGROUP@#$(RAPI_GROUP)#g'; \
1519 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTADMINGROUP@#$(ADMIN_GROUP)#g'; \
1520 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTCONFDGROUP@#$(CONFD_GROUP)#g'; \
1521 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
1522 df1d5c8f Michael Hanselmann
	  echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1523 df1d5c8f Michael Hanselmann
	  echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1524 df1d5c8f Michael Hanselmann
	  echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
1525 a8e8c0c6 Michael Hanselmann
	  echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
1526 6e3bf290 Michael Hanselmann
	  echo; \
1527 6e3bf290 Michael Hanselmann
	  echo '/^@SHELL_ENV_INIT@$$/ {'; \
1528 6e3bf290 Michael Hanselmann
	  echo '  r $(SHELL_ENV_INIT)'; \
1529 6e3bf290 Michael Hanselmann
	  echo '  d'; \
1530 6e3bf290 Michael Hanselmann
	  echo '}'; \
1531 e8230860 Michael Hanselmann
	} > $@
1532 e8230860 Michael Hanselmann
1533 67313146 Michael Hanselmann
# Using deferred evaluation
1534 899c4d2c Michael Hanselmann
daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
1535 9f4bb951 Michael Hanselmann
daemons/ganeti-watcher: MODULE = ganeti.watcher
1536 67313146 Michael Hanselmann
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
1537 8e55e20f Michael Hanselmann
tools/burnin: MODULE = ganeti.tools.burnin
1538 0d2bf835 René Nussbaumer
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
1539 69e5fefc Michael Hanselmann
tools/node-daemon-setup: MODULE = ganeti.tools.node_daemon_setup
1540 d12b9f66 Michael Hanselmann
tools/prepare-node-join: MODULE = ganeti.tools.prepare_node_join
1541 d5fe5fa9 Michael Hanselmann
tools/node-cleanup: MODULE = ganeti.tools.node_cleanup
1542 83846468 Iustin Pop
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/hs/%,%,$@)
1543 67313146 Michael Hanselmann
1544 3735787e Iustin Pop
$(PYTHON_BOOTSTRAP): Makefile | stamp-directories
1545 67313146 Michael Hanselmann
	test -n "$(MODULE)" || { echo Missing module; exit 1; }
1546 2d48a3a2 Michael Hanselmann
	set -e; \
1547 d75e738e Michael Hanselmann
	{ echo '#!/usr/bin/python'; \
1548 2d48a3a2 Michael Hanselmann
	  echo '# This file is automatically generated, do not edit!'; \
1549 67313146 Michael Hanselmann
	  echo "# Edit $(MODULE) instead."; \
1550 2d48a3a2 Michael Hanselmann
	  echo; \
1551 67313146 Michael Hanselmann
	  echo '"""Bootstrap script for L{$(MODULE)}"""'; \
1552 2d48a3a2 Michael Hanselmann
	  echo; \
1553 55766d34 Andrea Spadaccini
	  echo '# pylint: disable=C0103'; \
1554 2d48a3a2 Michael Hanselmann
	  echo '# C0103: Invalid name'; \
1555 2d48a3a2 Michael Hanselmann
	  echo; \
1556 2d48a3a2 Michael Hanselmann
	  echo 'import sys'; \
1557 67313146 Michael Hanselmann
	  echo 'import $(MODULE) as main'; \
1558 2d48a3a2 Michael Hanselmann
	  echo; \
1559 2d48a3a2 Michael Hanselmann
	  echo '# Temporarily alias commands until bash completion'; \
1560 2d48a3a2 Michael Hanselmann
	  echo '# generator is changed'; \
1561 67313146 Michael Hanselmann
	  echo 'if hasattr(main, "commands"):'; \
1562 55766d34 Andrea Spadaccini
	  echo '  commands = main.commands # pylint: disable=E1101'; \
1563 3f42b4f6 Michael Hanselmann
	  echo 'if hasattr(main, "aliases"):'; \
1564 55766d34 Andrea Spadaccini
	  echo '  aliases = main.aliases # pylint: disable=E1101'; \
1565 2d48a3a2 Michael Hanselmann
	  echo; \
1566 2d48a3a2 Michael Hanselmann
	  echo 'if __name__ == "__main__":'; \
1567 67313146 Michael Hanselmann
	  echo '  sys.exit(main.Main())'; \
1568 2d48a3a2 Michael Hanselmann
	} > $@
1569 2d48a3a2 Michael Hanselmann
	chmod u+x $@
1570 2d48a3a2 Michael Hanselmann
1571 3096524e Iustin Pop
$(HS_BUILT_TEST_HELPERS): Makefile
1572 3096524e Iustin Pop
	@test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
1573 3096524e Iustin Pop
	set -e; \
1574 3096524e Iustin Pop
	{ echo '#!/bin/sh'; \
1575 3096524e Iustin Pop
	  echo '# This file is automatically generated, do not edit!'; \
1576 3096524e Iustin Pop
	  echo "# Edit Makefile.am instead."; \
1577 3096524e Iustin Pop
	  echo; \
1578 83846468 Iustin Pop
	  echo "HTOOLS=$(TESTROLE) exec ./test/hs/hpc-htools \"\$$@\""; \
1579 3096524e Iustin Pop
	} > $@
1580 3096524e Iustin Pop
	chmod u+x $@
1581 3096524e Iustin Pop
1582 3735787e Iustin Pop
stamp-directories: Makefile
1583 924ecd85 Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) ganeti
1584 3735787e Iustin Pop
	@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
1585 3735787e Iustin Pop
	touch $@
1586 3735787e Iustin Pop
1587 e8230860 Michael Hanselmann
# We need to create symlinks because "make distcheck" will not install Python
1588 e8230860 Michael Hanselmann
# files when building.
1589 3735787e Iustin Pop
stamp-srclinks: Makefile | stamp-directories
1590 e8230860 Michael Hanselmann
	set -e; \
1591 01a3a718 Michael Hanselmann
	for i in $(srclink_files); do \
1592 a2d7ea09 Iustin Pop
	  if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
1593 a2d7ea09 Iustin Pop
	    $(LN_S) $(abs_top_srcdir)/$$i $$i; \
1594 a2d7ea09 Iustin Pop
	  fi; \
1595 e8230860 Michael Hanselmann
	done
1596 dd1dfd9a Michael Hanselmann
	touch $@
1597 97a37b3f Michael Hanselmann
1598 9ff7e35c Michael Hanselmann
.PHONY: ganeti
1599 9ff7e35c Michael Hanselmann
ganeti:
1600 01f3e7b1 Iustin Pop
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
1601 9ff7e35c Michael Hanselmann
1602 6b997854 Michael Hanselmann
.PHONY: check-dirs
1603 4c3d5fb6 Iustin Pop
check-dirs: $(GENERATED_FILES)
1604 0c1103d6 Iustin Pop
	@set -e; \
1605 a2d7ea09 Iustin Pop
	find . -type d \( -name . -o -name .git -prune -o -print \) | { \
1606 a2d7ea09 Iustin Pop
	  error=; \
1607 a2d7ea09 Iustin Pop
	  while read dir; do \
1608 a2d7ea09 Iustin Pop
	    case "$$dir" in \
1609 a2d7ea09 Iustin Pop
	      $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
1610 a2d7ea09 Iustin Pop
	      *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
1611 a2d7ea09 Iustin Pop
	    esac; \
1612 a2d7ea09 Iustin Pop
	  done; \
1613 a2d7ea09 Iustin Pop
	  for dir in $(DIRS); do \
1614 a2d7ea09 Iustin Pop
	    if ! test -d "$$dir"; then \
1615 a2d7ea09 Iustin Pop
	      echo "Directory $$dir listed in DIRS does not exist" >&2; \
1616 a2d7ea09 Iustin Pop
	      error=1; \
1617 a2d7ea09 Iustin Pop
	    fi \
1618 a2d7ea09 Iustin Pop
	  done; \
1619 a2d7ea09 Iustin Pop
	  test -z "$$error"; \
1620 6b997854 Michael Hanselmann
	}
1621 6b997854 Michael Hanselmann
1622 f6cbcc06 Michael Hanselmann
.PHONY: check-local
1623 4c3d5fb6 Iustin Pop
check-local: check-dirs $(GENERATED_FILES)
1624 eed5c5df Michael Hanselmann
	$(CHECK_PYTHON_CODE) $(check_python_code)
1625 5d3c30df Michael Hanselmann
	PYTHONPATH=. $(CHECK_HEADER) $(check_python_code)
1626 35576615 Michael Hanselmann
	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
1627 d466fd8b Guido Trotter
	RELEASE=$(PACKAGE_VERSION) $(CHECK_NEWS) < $(top_srcdir)/NEWS
1628 83ea5145 Michael Hanselmann
	PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(CHECK_IMPORTS) . $(standalone_python_modules)
1629 dad26941 Iustin Pop
	@expver=$(VERSION_MAJOR).$(VERSION_MINOR); \
1630 a5b0694f Michael Hanselmann
	error= ; \
1631 154d7ba5 Michael Hanselmann
	if test "`head -n 1 $(top_srcdir)/README`" != "Ganeti $$expver"; then \
1632 a5b0694f Michael Hanselmann
	  echo "Incorrect version in README, expected $$expver" >&2; \
1633 a5b0694f Michael Hanselmann
	  error=1; \
1634 7ecb3d0e Michael Hanselmann
	fi; \
1635 04c998a5 Michael Hanselmann
	for file in doc/iallocator.rst doc/hooks.rst doc/virtual-cluster.rst \
1636 a2d7ea09 Iustin Pop
	    doc/security.rst; do \
1637 a2d7ea09 Iustin Pop
	  if test "`sed -ne '4 p' $(top_srcdir)/$$file`" != \
1638 a2d7ea09 Iustin Pop
	    "Documents Ganeti version $$expver"; then \
1639 a5b0694f Michael Hanselmann
	    echo "Incorrect version in $$file, expected $$expver" >&2; \
1640 a5b0694f Michael Hanselmann
	    error=1; \
1641 a2d7ea09 Iustin Pop
	  fi; \
1642 7a962ecc Michael Hanselmann
	done; \
1643 fc07a14e Michael Hanselmann
	if ! test -f $(top_srcdir)/doc/design-$$expver.rst; then \
1644 a5b0694f Michael Hanselmann
	  echo "File $(top_srcdir)/doc/design-$$expver.rst not found" >&2; \
1645 a5b0694f Michael Hanselmann
	  error=1; \
1646 52fca4ba Michael Hanselmann
	fi; \
1647 924d9134 Michael Hanselmann
	if test "`sed -ne '5 p' $(top_srcdir)/doc/design-draft.rst`" != \
1648 924d9134 Michael Hanselmann
	  ".. Last updated for Ganeti $$expver"; then \
1649 924d9134 Michael Hanselmann
	  echo "doc/design-draft.rst was not updated for version $$expver" >&2; \
1650 924d9134 Michael Hanselmann
	  error=1; \
1651 924d9134 Michael Hanselmann
	fi; \
1652 9cda4d6a Iustin Pop
	for file in configure.ac $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS); do \
1653 9cda4d6a Iustin Pop
	  if test $$(wc --max-line-length < $(top_srcdir)/$$file) -gt 80; then \
1654 9cda4d6a Iustin Pop
	    echo "Longest line in $$file is longer than 80 characters" >&2; \
1655 9cda4d6a Iustin Pop
	    error=1; \
1656 9cda4d6a Iustin Pop
	  fi; \
1657 9cda4d6a Iustin Pop
	done; \
1658 9cda4d6a Iustin Pop
	test -z "$$error"
1659 eed5c5df Michael Hanselmann
1660 784e77f0 Iustin Pop
.PHONY: hs-tests
1661 784e77f0 Iustin Pop
hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1662 784e77f0 Iustin Pop
	@rm -f htest.tix
1663 3e16567e Iustin Pop
	./test/hs/htest
1664 784e77f0 Iustin Pop
1665 784e77f0 Iustin Pop
.PHONY: hs-shell
1666 784e77f0 Iustin Pop
hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
1667 784e77f0 Iustin Pop
	@rm -f hpc-htools.tix hpc-mon-collector.tix
1668 83846468 Iustin Pop
	HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
1669 49e11c49 Iustin Pop
1670 784e77f0 Iustin Pop
.PHONY: hs-check
1671 784e77f0 Iustin Pop
hs-check: hs-tests hs-shell
1672 784e77f0 Iustin Pop
1673 08366664 Michael Hanselmann
# E111: indentation is not a multiple of four
1674 5ae4945a Iustin Pop
# E121: continuation line indentation is not a multiple of four
1675 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1676 5ae4945a Iustin Pop
# E125: continuation line does not distinguish itself from next logical line
1677 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1678 5ae4945a Iustin Pop
# E127: continuation line over-indented for visual indent
1679 5ae4945a Iustin Pop
#       (since our indent level is not 4)
1680 5ae4945a Iustin Pop
# note: do NOT add E128 here; it's a valid style error in most cases!
1681 5ae4945a Iustin Pop
# I've seen real errors, but also some cases were we indent wrongly
1682 5ae4945a Iustin Pop
# due to line length; try to rework the cases where it is triggered,
1683 5ae4945a Iustin Pop
# instead of silencing it
1684 08366664 Michael Hanselmann
# E261: at least two spaces before inline comment
1685 08366664 Michael Hanselmann
# E501: line too long (80 characters)
1686 5ae4945a Iustin Pop
PEP8_IGNORE = E111,E121,E125,E127,E261,E501
1687 08366664 Michael Hanselmann
1688 08366664 Michael Hanselmann
# For excluding pep8 expects filenames only, not whole paths
1689 08366664 Michael Hanselmann
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1690 08366664 Michael Hanselmann
1691 6e4c8f68 Iustin Pop
LINT_TARGETS = pylint pylint-qa
1692 6e4c8f68 Iustin Pop
if HAS_PEP8
1693 6e4c8f68 Iustin Pop
LINT_TARGETS += pep8
1694 6e4c8f68 Iustin Pop
endif
1695 6e4c8f68 Iustin Pop
if HAS_HLINT
1696 6e4c8f68 Iustin Pop
LINT_TARGETS += hlint
1697 6e4c8f68 Iustin Pop
endif
1698 6e4c8f68 Iustin Pop
1699 e0098923 Iustin Pop
.PHONY: lint
1700 6e4c8f68 Iustin Pop
lint: $(LINT_TARGETS)
1701 6e4c8f68 Iustin Pop
1702 6e4c8f68 Iustin Pop
.PHONY: pylint
1703 4c3d5fb6 Iustin Pop
pylint: $(GENERATED_FILES)
1704 6d7cc5ff Michael Hanselmann
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1705 6d7cc5ff Michael Hanselmann
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1706 6e4c8f68 Iustin Pop
1707 6e4c8f68 Iustin Pop
.PHONY: pylint-qa
1708 4c3d5fb6 Iustin Pop
pylint-qa: $(GENERATED_FILES)
1709 6e4c8f68 Iustin Pop
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1710 3582eef6 Iustin Pop
	cd $(top_srcdir)/qa && \
1711 3582eef6 Iustin Pop
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1712 3582eef6 Iustin Pop
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1713 e0098923 Iustin Pop
1714 6e4c8f68 Iustin Pop
.PHONY: pep8
1715 4c3d5fb6 Iustin Pop
pep8: $(GENERATED_FILES)
1716 6e4c8f68 Iustin Pop
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1717 6e4c8f68 Iustin Pop
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1718 a2d7ea09 Iustin Pop
	  --repeat $(pep8_python_code)
1719 6e4c8f68 Iustin Pop
1720 2cdaf225 Iustin Pop
# FIXME: remove ignore "Use void" when GHC 6.x is deprecated
1721 83846468 Iustin Pop
HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
1722 191ff68c Iustin Pop
.PHONY: hlint
1723 3add7574 Iustin Pop
hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
1724 6e4c8f68 Iustin Pop
	@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1725 1cced301 Iustin Pop
	@rm -f doc/hs-lint.html
1726 191ff68c Iustin Pop
	if tty -s; then C="-c"; else C=""; fi; \
1727 488a5b2e Michele Tartara
	$(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
1728 3603605a Iustin Pop
	  --ignore "Use first" \
1729 2cdaf225 Iustin Pop
	  --ignore "Use &&&" \
1730 2cdaf225 Iustin Pop
	  --ignore "Use void" \
1731 86aa9ba3 Iustin Pop
	  --ignore "Reduce duplication" \
1732 3add7574 Iustin Pop
	  --hint src/lint-hints \
1733 af42ffb6 Iustin Pop
	  $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
1734 1cced301 Iustin Pop
	@if [ ! -f doc/hs-lint.html ]; then \
1735 1cced301 Iustin Pop
	  echo "All good" > doc/hs-lint.html; \
1736 1cced301 Iustin Pop
	fi
1737 191ff68c Iustin Pop
1738 84a12e40 Iustin Pop
# a dist hook rule for updating the vcs-version file; this is
1739 84a12e40 Iustin Pop
# hardcoded due to where it needs to build the file...
1740 84a12e40 Iustin Pop
dist-hook:
1741 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) regen-vcs-version
1742 316dc1ff Iustin Pop
	rm -f $(top_distdir)/vcs-version
1743 84a12e40 Iustin Pop
	cp -p $(srcdir)/vcs-version $(top_distdir)
1744 84a12e40 Iustin Pop
1745 84a12e40 Iustin Pop
# a distcheck hook rule for catching revision control directories
1746 b6f2e47f Iustin Pop
distcheck-hook:
1747 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
1748 a2d7ea09 Iustin Pop
	  echo "Found revision control files in final archive." 1>&2; \
1749 a2d7ea09 Iustin Pop
	  exit 1; \
1750 c6aa0c42 Michael Hanselmann
	fi
1751 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*.py[co]' | grep .; then \
1752 a2d7ea09 Iustin Pop
	  echo "Found Python byte code in final archive." 1>&2; \
1753 a2d7ea09 Iustin Pop
	  exit 1; \
1754 c6aa0c42 Michael Hanselmann
	fi
1755 c6aa0c42 Michael Hanselmann
	if find $(top_distdir) -name '*~' | grep .; then \
1756 a2d7ea09 Iustin Pop
	  echo "Found backup files in final archive." 1>&2; \
1757 a2d7ea09 Iustin Pop
	  exit 1; \
1758 b6f2e47f Iustin Pop
	fi
1759 bf0b21da Michael Hanselmann
# Empty files or directories should not be distributed. They can cause
1760 bf0b21da Michael Hanselmann
# unnecessary warnings for packagers. Directories used by automake during
1761 bf0b21da Michael Hanselmann
# distcheck must be excluded.
1762 bf0b21da Michael Hanselmann
	if find $(top_distdir) -empty -and -not \( \
1763 a2d7ea09 Iustin Pop
	    -path $(top_distdir)/_build -or \
1764 a2d7ea09 Iustin Pop
	    -path $(top_distdir)/_inst \) | grep .; then \
1765 a2d7ea09 Iustin Pop
	  echo "Found empty files or directories in final archive." 1>&2; \
1766 a2d7ea09 Iustin Pop
	  exit 1; \
1767 bf0b21da Michael Hanselmann
	fi
1768 9d02edc6 Michael Hanselmann
	if test -e $(top_distdir)/doc/man-html; then \
1769 9d02edc6 Michael Hanselmann
	  echo "Found documentation including man pages in final archive" >&2; \
1770 9d02edc6 Michael Hanselmann
	  exit 1; \
1771 9d02edc6 Michael Hanselmann
	fi
1772 c7b86f6c Michael Hanselmann
1773 d466fd8b Guido Trotter
# Backwards compatible distcheck-release target
1774 c7b86f6c Michael Hanselmann
distcheck-release: distcheck
1775 b6f2e47f Iustin Pop
1776 7213dded René Nussbaumer
distrebuildcheck: dist
1777 7213dded René Nussbaumer
	set -e; \
1778 7213dded René Nussbaumer
	builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \
1779 7213dded René Nussbaumer
	trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \
1780 7213dded René Nussbaumer
	cd $$builddir; \
1781 7213dded René Nussbaumer
	tar xzf $(abs_srcdir)/$(distdir).tar.gz; \
1782 7213dded René Nussbaumer
	cd $(distdir); \
1783 7213dded René Nussbaumer
	./configure; \
1784 7213dded René Nussbaumer
	$(MAKE) maintainer-clean; \
1785 7213dded René Nussbaumer
	cp $(abs_srcdir)/vcs-version .; \
1786 7213dded René Nussbaumer
	./configure; \
1787 7213dded René Nussbaumer
	$(MAKE) $(AM_MAKEFLAGS)
1788 7213dded René Nussbaumer
1789 e627fe09 Michael Hanselmann
dist-release: dist
1790 e627fe09 Michael Hanselmann
	set -e; \
1791 e627fe09 Michael Hanselmann
	for i in $(DIST_ARCHIVES); do \
1792 a2d7ea09 Iustin Pop
	  echo -n "Checking $$i ... "; \
1793 a2d7ea09 Iustin Pop
	  autotools/check-tar < $$i; \
1794 a2d7ea09 Iustin Pop
	  echo OK; \
1795 e627fe09 Michael Hanselmann
	done
1796 e627fe09 Michael Hanselmann
1797 8925faaa Iustin Pop
install-exec-local:
1798 0d93b082 Michael Hanselmann
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
1799 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
1800 2fa9f1dd Michael Hanselmann
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1801 e8230860 Michael Hanselmann
1802 d128fdb6 Iustin Pop
.PHONY: apidoc
1803 d9a900dc Iustin Pop
if WANT_HSAPIDOC
1804 a38bfce5 Iustin Pop
apidoc: py-apidoc hs-apidoc
1805 a38bfce5 Iustin Pop
else
1806 a38bfce5 Iustin Pop
apidoc: py-apidoc
1807 a38bfce5 Iustin Pop
endif
1808 a38bfce5 Iustin Pop
1809 a38bfce5 Iustin Pop
.PHONY: py-apidoc
1810 4c3d5fb6 Iustin Pop
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(GENERATED_FILES)
1811 de645b5b Michael Hanselmann
	env - PATH="$$PATH" PYTHONPATH="$$PYTHONPATH" \
1812 b959138f Michael Hanselmann
	$(RUN_IN_TEMPDIR) epydoc -v \
1813 a2d7ea09 Iustin Pop
	  --conf $(CURDIR)/epydoc.conf \
1814 a2d7ea09 Iustin Pop
	  --output $(CURDIR)/$(APIDOC_PY_DIR)
1815 a38bfce5 Iustin Pop
1816 a38bfce5 Iustin Pop
.PHONY: hs-apidoc
1817 7ddd8e4c Iustin Pop
hs-apidoc: $(APIDOC_HS_DIR)/index.html
1818 7ddd8e4c Iustin Pop
1819 7ddd8e4c Iustin Pop
$(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
1820 a38bfce5 Iustin Pop
	@test -n "$(HSCOLOUR)" || \
1821 a38bfce5 Iustin Pop
	    { echo 'HsColour' not found during configure; exit 1; }
1822 a38bfce5 Iustin Pop
	@test -n "$(HADDOCK)" || \
1823 a38bfce5 Iustin Pop
	    { echo 'haddock' not found during configure; exit 1; }
1824 22c5390d Iustin Pop
	rm -rf $(APIDOC_HS_DIR)/*
1825 cbcd9144 Michele Tartara
	for i in $(ALL_APIDOC_HS_DIRS); do \
1826 a2d7ea09 Iustin Pop
	  @mkdir_p@ $$i; \
1827 e61db4b2 Iustin Pop
	  $(HSCOLOUR) -print-css > $$i/hscolour.css; \
1828 cbcd9144 Michele Tartara
	done
1829 a38bfce5 Iustin Pop
	set -e ; \
1830 7ddd8e4c Iustin Pop
	export LC_ALL=en_US.UTF-8; \
1831 7ddd8e4c Iustin Pop
	OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
1832 d9a900dc Iustin Pop
	if [ "$(HS_NOCURL)" ]; \
1833 7ddd8e4c Iustin Pop
	then OPTGHC="$$OPTGHC --optghc=$(HS_NOCURL)"; \
1834 c478f837 Iustin Pop
	fi; \
1835 d9a900dc Iustin Pop
	if [ "$(HS_PARALLEL3)" ]; \
1836 d9a900dc Iustin Pop
	then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
1837 1adec4be Iustin Pop
	fi; \
1838 d9a900dc Iustin Pop
	if [ "$(HS_REGEX_PCRE)" ]; \
1839 d9a900dc Iustin Pop
	then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
1840 21a5e56c Iustin Pop
	fi; \
1841 7ddd8e4c Iustin Pop
	for file in $(HS_LIBTESTBUILT_SRCS); do \
1842 7ddd8e4c Iustin Pop
	  f_nosrc=$${file##src/}; \
1843 7ddd8e4c Iustin Pop
	  f_notst=$${f_nosrc##test/hs/}; \
1844 7ddd8e4c Iustin Pop
	  f_html=$${f_notst%%.hs}.html; \
1845 7ddd8e4c Iustin Pop
	  $(HSCOLOUR) -css -anchor $$file > $(APIDOC_HS_DIR)/$$f_html ; \
1846 a38bfce5 Iustin Pop
	done ; \
1847 7ddd8e4c Iustin Pop
	$(HADDOCK) --odir $(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1848 7ddd8e4c Iustin Pop
	  -t ganeti -p src/haddock-prologue \
1849 a2d7ea09 Iustin Pop
	  --source-module="%{MODULE/.//}.html" \
1850 a2d7ea09 Iustin Pop
	  --source-entity="%{MODULE/.//}.html#%{NAME}" \
1851 a2d7ea09 Iustin Pop
	  $$OPTGHC \
1852 7ddd8e4c Iustin Pop
	  $(HS_LIBTESTBUILT_SRCS)
1853 d128fdb6 Iustin Pop
1854 13e720f1 Iustin Pop
.PHONY: TAGS
1855 4c3d5fb6 Iustin Pop
TAGS: $(GENERATED_FILES)
1856 13e720f1 Iustin Pop
	rm -f TAGS
1857 6b84f036 Iustin Pop
	$(GHC) -e ":etags" -v0 \
1858 6b84f036 Iustin Pop
	  $(filter-out -O -Werror,$(HFLAGS)) \
1859 d9a900dc Iustin Pop
	  $(HS_NOCURL) $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
1860 6b84f036 Iustin Pop
	  $(HS_LIBTEST_SRCS)
1861 74fa8200 Iustin Pop
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1862 74fa8200 Iustin Pop
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
1863 74fa8200 Iustin Pop
	  -path './qa/*.py' | \
1864 2db53645 Iustin Pop
	  etags -l python -a -
1865 13e720f1 Iustin Pop
1866 27e336af Michael Hanselmann
.PHONY: coverage
1867 b91e9518 Iustin Pop
if WANT_HTOOLS
1868 b91e9518 Iustin Pop
coverage: py-coverage hs-coverage
1869 b91e9518 Iustin Pop
else
1870 b91e9518 Iustin Pop
coverage: py-coverage
1871 b91e9518 Iustin Pop
endif
1872 b91e9518 Iustin Pop
1873 b91e9518 Iustin Pop
.PHONY: py-coverage
1874 4c3d5fb6 Iustin Pop
py-coverage: $(GENERATED_FILES) $(python_tests)
1875 141c8421 Michael Hanselmann
	@test -n "$(PYCOVERAGE)" || \
1876 141c8421 Michael Hanselmann
	    { echo 'python-coverage' not found during configure; exit 1; }
1877 27e336af Michael Hanselmann
	set -e; \
1878 141c8421 Michael Hanselmann
	COVERAGE=$(PYCOVERAGE) \
1879 22c5390d Iustin Pop
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1880 22c5390d Iustin Pop
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1881 22c5390d Iustin Pop
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1882 208b02e3 Iustin Pop
	$(PLAIN_TESTS_ENVIRONMENT) \
1883 208b02e3 Iustin Pop
	$(abs_top_srcdir)/autotools/gen-py-coverage \
1884 e8c8cf1a Michael Hanselmann
	$(python_tests)
1885 27e336af Michael Hanselmann
1886 b91e9518 Iustin Pop
.PHONY: hs-coverage
1887 83846468 Iustin Pop
hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
1888 316dc1ff Iustin Pop
	rm -f *.tix
1889 b0b8458a Iustin Pop
	$(MAKE) $(AM_MAKEFLAGS) hs-check
1890 48f12e73 Iustin Pop
	@mkdir_p@ $(COVERAGE_HS_DIR)
1891 5f2cdb2a Michele Tartara
	hpc sum --union $(HPCEXCL) \
1892 208b02e3 Iustin Pop
	  htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
1893 208b02e3 Iustin Pop
	hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
1894 208b02e3 Iustin Pop
	hpc report coverage-hs.tix
1895 82888134 Michael Hanselmann
	$(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
1896 b91e9518 Iustin Pop
1897 ec8379bd Iustin Pop
# Special "kind-of-QA" target for htools, needs special setup (all
1898 ec8379bd Iustin Pop
# tools compiled with -fhpc)
1899 ec8379bd Iustin Pop
.PHONY: live-test
1900 ec8379bd Iustin Pop
live-test: all
1901 ec8379bd Iustin Pop
	set -e ; \
1902 3add7574 Iustin Pop
	cd src; \
1903 82888134 Michael Hanselmann
	rm -f .hpc; $(LN_S) ../.hpc .hpc; \
1904 ec8379bd Iustin Pop
	rm -f *.tix *.mix; \
1905 ec8379bd Iustin Pop
	./live-test.sh; \
1906 3add7574 Iustin Pop
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:src/%=%)) \
1907 ec8379bd Iustin Pop
	  --output=live-test.tix ; \
1908 22c5390d Iustin Pop
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1909 22c5390d Iustin Pop
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1910 a2d7ea09 Iustin Pop
	  --srcdir=.. $(HPCEXCL) ; \
1911 ec8379bd Iustin Pop
	hpc report --srcdir=.. live-test $(HPCEXCL)
1912 b91e9518 Iustin Pop
1913 b341b9ca Guido Trotter
commit-check: distcheck lint apidoc
1914 b341b9ca Guido Trotter
1915 6438e259 Iustin Pop
.PHONY: gitignore-check
1916 6438e259 Iustin Pop
gitignore-check:
1917 6438e259 Iustin Pop
	@if [ -n "`git status --short`" ]; then \
1918 6438e259 Iustin Pop
	  echo "Git status is not clean!" 1>&2 ; \
1919 6438e259 Iustin Pop
	  git status --short; \
1920 6438e259 Iustin Pop
	  exit 1; \
1921 6438e259 Iustin Pop
	fi
1922 6438e259 Iustin Pop
1923 6aff0514 Iustin Pop
# target to rebuild all man pages (both groff and html output)
1924 6aff0514 Iustin Pop
.PHONY: man
1925 6aff0514 Iustin Pop
man: $(man_MANS) $(manhtml)
1926 6aff0514 Iustin Pop
1927 37519c09 Iustin Pop
# Target that builds all binaries (including those that are not
1928 37519c09 Iustin Pop
# rebuilt except when running the tests)
1929 37519c09 Iustin Pop
.PHONY: really-all
1930 af42ffb6 Iustin Pop
really-all: all $(check_SCRIPTS) $(haskell_tests) $(HS_ALL_PROGS)
1931 37519c09 Iustin Pop
1932 1d45f7a0 Iustin Pop
# we don't need the ancient implicit rules:
1933 1d45f7a0 Iustin Pop
%: %,v
1934 1d45f7a0 Iustin Pop
%: RCS/%,v
1935 1d45f7a0 Iustin Pop
%: RCS/%
1936 1d45f7a0 Iustin Pop
%: s.%
1937 1d45f7a0 Iustin Pop
%: SCCS/s.%
1938 1d45f7a0 Iustin Pop
1939 3baa809c Michael Hanselmann
-include ./Makefile.local
1940 3baa809c Michael Hanselmann
1941 e8230860 Michael Hanselmann
# vim: set noet :