Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 22c5390d

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