Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 821d9e43

History | View | Annotate | Download (8.3 kB)

1
# Ganeti makefile
2
# - Indent with tabs only.
3
# - Keep files sorted; one line per file.
4
# - Directories in lib/ must have their own *dir variable (see hypervisor).
5
# - All directories must be listed DIRS.
6
# - Use autogen.sh to generate Makefile.in and configure script.
7

    
8
# Automake doesn't export these variables before version 1.10.
9
abs_top_builddir = @abs_top_builddir@
10
abs_top_srcdir = @abs_top_srcdir@
11

    
12
ACLOCAL_AMFLAGS = -I autotools
13
DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
14
BUILD_RAPI_RESOURCE_DOC = $(top_srcdir)/doc/build-rapi-resources-doc
15
REPLACE_VARS_SED = autotools/replace_vars.sed
16

    
17
hypervisordir = $(pkgpythondir)/hypervisor
18
rapidir = $(pkgpythondir)/rapi
19
toolsdir = $(pkglibdir)/tools
20
docdir = $(datadir)/doc/$(PACKAGE)
21

    
22
DIRS = \
23
	autotools \
24
	daemons \
25
	devel \
26
	doc \
27
	doc/examples \
28
	lib \
29
	lib/hypervisor \
30
	lib/rapi \
31
	man \
32
	qa \
33
	scripts \
34
	test \
35
	test/data \
36
	tools
37

    
38
CLEANFILES = \
39
	autotools/replace_vars.sed \
40
	devel/upload \
41
	doc/*.html \
42
	doc/*.in \
43
	doc/*.pdf \
44
	doc/rapi-resources.sgml \
45
	doc/examples/ganeti.initd \
46
	doc/examples/ganeti.cron \
47
	lib/*.py[co] \
48
	lib/hypervisor/*.py[co] \
49
	lib/rapi/*.py[co] \
50
	man/*.[78] \
51
	man/*.in \
52
	qa/*.py[co] \
53
	test/*.py[co] \
54
	stamp-directories \
55
	$(nodist_pkgpython_PYTHON)
56

    
57
nodist_pkgpython_PYTHON = \
58
	lib/_autoconf.py
59

    
60
pkgpython_PYTHON = \
61
	lib/__init__.py \
62
	lib/backend.py \
63
	lib/bdev.py \
64
	lib/bootstrap.py \
65
	lib/cli.py \
66
	lib/cmdlib.py \
67
	lib/config.py \
68
	lib/constants.py \
69
	lib/daemon.py \
70
	lib/errors.py \
71
	lib/http.py \
72
	lib/jqueue.py \
73
	lib/jstore.py \
74
	lib/locking.py \
75
	lib/logger.py \
76
	lib/luxi.py \
77
	lib/mcpu.py \
78
	lib/objects.py \
79
	lib/opcodes.py \
80
	lib/rpc.py \
81
	lib/serializer.py \
82
	lib/ssconf.py \
83
	lib/ssh.py \
84
	lib/utils.py \
85
	lib/workerpool.py
86

    
87
hypervisor_PYTHON = \
88
	lib/hypervisor/__init__.py \
89
	lib/hypervisor/hv_base.py \
90
	lib/hypervisor/hv_fake.py \
91
	lib/hypervisor/hv_kvm.py \
92
	lib/hypervisor/hv_xen.py
93

    
94
rapi_PYTHON = \
95
	lib/rapi/__init__.py \
96
	lib/rapi/httperror.py \
97
	lib/rapi/baserlib.py \
98
	lib/rapi/connector.py \
99
	lib/rapi/rlib1.py \
100
	lib/rapi/rlib2.py
101

    
102

    
103
docsgml = \
104
	doc/hooks.sgml \
105
	doc/install.sgml \
106
	doc/admin.sgml \
107
	doc/rapi.sgml \
108
	doc/iallocator.sgml
109

    
110
docrst = \
111
	doc/design-2.0-cluster-parameters.rst \
112
	doc/design-2.0-commandline-parameters.rst \
113
	doc/design-2.0-disk-handling.rst \
114
	doc/design-2.0-index.rst \
115
	doc/design-2.0-job-queue.rst \
116
	doc/design-2.0-locking.rst \
117
	doc/design-2.0-master-daemon.rst \
118
	doc/design-2.0-os-interface.rst \
119
	doc/design-2.0-rapi-changes.rst \
120
	doc/security.rst
121

    
122
doc_DATA = \
123
	$(patsubst %.rst,%.html,$(docrst)) \
124
	$(patsubst %.sgml,%.html,$(docsgml)) \
125
	$(patsubst %.sgml,%.pdf,$(docsgml))
126

    
127
dist_sbin_SCRIPTS = \
128
	daemons/ganeti-noded \
129
	daemons/ganeti-watcher \
130
	daemons/ganeti-masterd \
131
	daemons/ganeti-rapi \
132
	scripts/gnt-backup \
133
	scripts/gnt-cluster \
134
	scripts/gnt-debug \
135
	scripts/gnt-instance \
136
	scripts/gnt-job \
137
	scripts/gnt-node \
138
	scripts/gnt-os
139

    
140
dist_tools_SCRIPTS = \
141
	tools/burnin \
142
	tools/cfgshell \
143
	tools/cfgupgrade \
144
	tools/lvmstrap
145

    
146
EXTRA_DIST = \
147
	NEWS \
148
	DEVNOTES \
149
	autotools/docbook-wrapper \
150
	devel/upload.in \
151
	$(docrst) \
152
	$(docsgml) \
153
	doc/build-rapi-resources-doc \
154
	doc/examples/ganeti.initd.in \
155
	doc/examples/ganeti.cron.in \
156
	doc/examples/dumb-allocator \
157
	doc/locking.txt \
158
	test/testutils.py \
159
	test/mocks.py \
160
	$(dist_TESTS) \
161
	$(TEST_FILES) \
162
	man/footer.sgml \
163
	$(mansgml) \
164
	qa/ganeti-qa.py \
165
	qa/qa-sample.json \
166
	qa/qa_cluster.py \
167
	qa/qa_config.py \
168
	qa/qa_daemon.py \
169
	qa/qa_env.py \
170
	qa/qa_error.py \
171
	qa/qa_instance.py \
172
	qa/qa_node.py \
173
	qa/qa_os.py \
174
	qa/qa_rapi.py \
175
	qa/qa_tags.py \
176
	qa/qa_utils.py
177

    
178
man_MANS = \
179
	man/ganeti.7 \
180
	man/ganeti-noded.8 \
181
	man/ganeti-os-interface.7 \
182
	man/ganeti-watcher.8 \
183
	man/gnt-backup.8 \
184
	man/gnt-cluster.8 \
185
	man/gnt-instance.8 \
186
	man/gnt-node.8 \
187
	man/gnt-os.8
188

    
189
maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
190
mansgml = $(patsubst %.in,%.sgml,$(maninput))
191

    
192
TEST_FILES = \
193
	test/data/bdev-both.txt \
194
	test/data/bdev-disk.txt \
195
	test/data/bdev-net.txt \
196
	test/data/proc_drbd8.txt
197

    
198
dist_TESTS = \
199
	test/ganeti.config_unittest.py \
200
	test/ganeti.hooks_unittest.py \
201
	test/ganeti.utils_unittest.py \
202
	test/ganeti.bdev_unittest.py \
203
	test/ganeti.ssh_unittest.py \
204
	test/ganeti.locking_unittest.py \
205
	test/ganeti.serializer_unittest.py \
206
	test/ganeti.workerpool_unittest.py \
207
	test/ganeti.rapi.resources_unittest.py \
208
	test/ganeti.http_unittest.py \
209
	test/ganeti.constants_unittest.py \
210
	test/ganeti.cli_unittest.py
211

    
212
nodist_TESTS =
213

    
214
TESTS = $(dist_TESTS) $(nodist_TESTS)
215

    
216
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
217

    
218

    
219
all-local: stamp-directories lib/_autoconf.py devel/upload \
220
	doc/examples/ganeti.initd doc/examples/ganeti.cron
221

    
222
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
223
	sed -f $(REPLACE_VARS_SED) < $< > $@
224
	chmod u+x $@
225

    
226
doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
227
		$(REPLACE_VARS_SED)
228
	sed -f $(REPLACE_VARS_SED) < $< > $@
229

    
230
doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
231
	sed -f $(REPLACE_VARS_SED) < $< > $@
232

    
233
man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
234
	sed -f $(REPLACE_VARS_SED) < $< > $@
235

    
236
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
237
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
238

    
239
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
240
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
241

    
242
doc/%.html: doc/%.rst
243
	$(RST2HTML) $< $@
244

    
245
doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
246

    
247
doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
248
	PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
249

    
250
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
251
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
252

    
253
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
254
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
255

    
256
man/footer.sgml $(TESTS): srclinks
257

    
258
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
259

    
260
lib/_autoconf.py: Makefile stamp-directories
261
	set -e; \
262
	{ echo '# This file is automatically generated, do not edit!'; \
263
	  echo '#'; \
264
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
265
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
266
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
267
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
268
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
269
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
270
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
271
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
272
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
273
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
274
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
275
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
276
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
277
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
278
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
279
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
280
	} > $@
281

    
282
$(REPLACE_VARS_SED): Makefile stamp-directories
283
	set -e; \
284
	{ echo 's#@PREFIX@#$(prefix)#g'; \
285
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
286
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
287
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
288
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
289
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
290
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
291
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
292
	  echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
293
	  echo '  r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
294
	  echo '  d'; \
295
	  echo '}'; \
296
	} > $@
297

    
298
# We need to create symlinks because "make distcheck" will not install Python
299
# files when building.
300
#.PHONY: srclinks
301
srclinks: stamp-directories
302
	set -e; \
303
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
304
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
305
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
306
		fi; \
307
	done
308

    
309
.PHONY: ganeti
310
ganeti:
311
	cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
312

    
313
# a dist hook rule for catching revision control directories
314
distcheck-hook:
315
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
316
		echo "Found revision control files in final archive" 1>&2 ; \
317
		exit 1; \
318
	fi
319

    
320
install-exec-local:
321
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
322
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
323
	  "$(DESTDIR)${localstatedir}/run/ganeti"
324

    
325
stamp-directories: Makefile
326
	@mkdir_p@ $(DIRS)
327
	touch $@
328

    
329
.PHONY: apidoc
330
apidoc:
331
	test -e doc/api || mkdir doc/api
332
	TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
333
		cp -r scripts daemons lib $$TMPDIR && \
334
		( \
335
			cd $$TMPDIR && \
336
			mv lib ganeti && \
337
			epydoc --conf ../epydoc.conf \
338
		) ; \
339
		rm -rf $$TMPDIR ; \
340
	}
341

    
342
# vim: set noet :