Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 5c0c1eeb

History | View | Annotate | Download (8 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/luxi.py \
76
	lib/mcpu.py \
77
	lib/objects.py \
78
	lib/opcodes.py \
79
	lib/rpc.py \
80
	lib/serializer.py \
81
	lib/ssconf.py \
82
	lib/ssh.py \
83
	lib/utils.py \
84
	lib/workerpool.py
85

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

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

    
100

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

    
108
docrst = \
109
	doc/design-2.0.rst \
110
	doc/security.rst
111

    
112
doc_DATA = \
113
	$(patsubst %.rst,%.html,$(docrst)) \
114
	$(patsubst %.sgml,%.html,$(docsgml)) \
115
	$(patsubst %.sgml,%.pdf,$(docsgml))
116

    
117
dist_sbin_SCRIPTS = \
118
	daemons/ganeti-noded \
119
	daemons/ganeti-watcher \
120
	daemons/ganeti-masterd \
121
	daemons/ganeti-rapi \
122
	scripts/gnt-backup \
123
	scripts/gnt-cluster \
124
	scripts/gnt-debug \
125
	scripts/gnt-instance \
126
	scripts/gnt-job \
127
	scripts/gnt-node \
128
	scripts/gnt-os
129

    
130
dist_tools_SCRIPTS = \
131
	tools/burnin \
132
	tools/cfgshell \
133
	tools/cfgupgrade \
134
	tools/lvmstrap
135

    
136
EXTRA_DIST = \
137
	NEWS \
138
	DEVNOTES \
139
	autotools/docbook-wrapper \
140
	devel/upload.in \
141
	$(docrst) \
142
	$(docsgml) \
143
	doc/build-rapi-resources-doc \
144
	doc/examples/ganeti.initd.in \
145
	doc/examples/ganeti.cron.in \
146
	doc/examples/dumb-allocator \
147
	doc/locking.txt \
148
	test/testutils.py \
149
	test/mocks.py \
150
	$(dist_TESTS) \
151
	$(TEST_FILES) \
152
	man/footer.sgml \
153
	$(mansgml) \
154
	qa/ganeti-qa.py \
155
	qa/qa-sample.json \
156
	qa/qa_cluster.py \
157
	qa/qa_config.py \
158
	qa/qa_daemon.py \
159
	qa/qa_env.py \
160
	qa/qa_error.py \
161
	qa/qa_instance.py \
162
	qa/qa_node.py \
163
	qa/qa_os.py \
164
	qa/qa_rapi.py \
165
	qa/qa_tags.py \
166
	qa/qa_utils.py
167

    
168
man_MANS = \
169
	man/ganeti.7 \
170
	man/ganeti-noded.8 \
171
	man/ganeti-os-interface.7 \
172
	man/ganeti-watcher.8 \
173
	man/gnt-backup.8 \
174
	man/gnt-cluster.8 \
175
	man/gnt-instance.8 \
176
	man/gnt-node.8 \
177
	man/gnt-os.8
178

    
179
maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
180
mansgml = $(patsubst %.in,%.sgml,$(maninput))
181

    
182
TEST_FILES = \
183
	test/data/bdev-both.txt \
184
	test/data/bdev-disk.txt \
185
	test/data/bdev-net.txt \
186
	test/data/proc_drbd8.txt
187

    
188
dist_TESTS = \
189
	test/ganeti.config_unittest.py \
190
	test/ganeti.hooks_unittest.py \
191
	test/ganeti.utils_unittest.py \
192
	test/ganeti.bdev_unittest.py \
193
	test/ganeti.ssh_unittest.py \
194
	test/ganeti.locking_unittest.py \
195
	test/ganeti.serializer_unittest.py \
196
	test/ganeti.workerpool_unittest.py \
197
	test/ganeti.rapi.resources_unittest.py \
198
	test/ganeti.http_unittest.py \
199
	test/ganeti.constants_unittest.py \
200
	test/ganeti.cli_unittest.py
201

    
202
nodist_TESTS =
203

    
204
TESTS = $(dist_TESTS) $(nodist_TESTS)
205

    
206
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
207

    
208

    
209
all-local: stamp-directories lib/_autoconf.py devel/upload \
210
	doc/examples/ganeti.initd doc/examples/ganeti.cron
211

    
212
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
213
	sed -f $(REPLACE_VARS_SED) < $< > $@
214
	chmod u+x $@
215

    
216
doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
217
		$(REPLACE_VARS_SED)
218
	sed -f $(REPLACE_VARS_SED) < $< > $@
219

    
220
doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
221
	sed -f $(REPLACE_VARS_SED) < $< > $@
222

    
223
man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
224
	sed -f $(REPLACE_VARS_SED) < $< > $@
225

    
226
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
227
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2PDF)" $< $@
228

    
229
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
230
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $@
231

    
232
doc/%.html: doc/%.rst
233
	$(RST2HTML) $< $@
234

    
235
doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
236

    
237
doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
238
	PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
239

    
240
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
241
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
242

    
243
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
244
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
245

    
246
man/footer.sgml $(TESTS): srclinks
247

    
248
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
249

    
250
lib/_autoconf.py: Makefile stamp-directories
251
	set -e; \
252
	{ echo '# This file is automatically generated, do not edit!'; \
253
	  echo '#'; \
254
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
255
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
256
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
257
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
258
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
259
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
260
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
261
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
262
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
263
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
264
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
265
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
266
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
267
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
268
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
269
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
270
	} > $@
271

    
272
$(REPLACE_VARS_SED): Makefile stamp-directories
273
	set -e; \
274
	{ echo 's#@PREFIX@#$(prefix)#g'; \
275
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
276
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
277
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
278
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
279
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
280
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
281
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
282
	  echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
283
	  echo '  r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
284
	  echo '  d'; \
285
	  echo '}'; \
286
	} > $@
287

    
288
# We need to create symlinks because "make distcheck" will not install Python
289
# files when building.
290
#.PHONY: srclinks
291
srclinks: stamp-directories
292
	set -e; \
293
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
294
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
295
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
296
		fi; \
297
	done
298

    
299
.PHONY: ganeti
300
ganeti:
301
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
302

    
303
# a dist hook rule for catching revision control directories
304
distcheck-hook:
305
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
306
		echo "Found revision control files in final archive" 1>&2 ; \
307
		exit 1; \
308
	fi
309

    
310
install-exec-local:
311
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
312
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
313
	  "$(DESTDIR)${localstatedir}/run/ganeti"
314

    
315
stamp-directories: Makefile
316
	@mkdir_p@ $(DIRS)
317
	touch $@
318

    
319
.PHONY: apidoc
320
apidoc:
321
	test -e doc/api || mkdir doc/api
322
	TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
323
		cp -r scripts daemons lib $$TMPDIR && \
324
		( \
325
			cd $$TMPDIR && \
326
			mv lib ganeti && \
327
			epydoc --conf ../epydoc.conf \
328
		) ; \
329
		rm -rf $$TMPDIR ; \
330
	}
331

    
332
# vim: set noet :