Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 191ff68c

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