Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ a39ec11a

History | View | Annotate | Download (7.7 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/errors.py \
70
	lib/http.py \
71
	lib/jqueue.py \
72
	lib/jstore.py \
73
	lib/locking.py \
74
	lib/logger.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/httperror.py \
96
	lib/rapi/baserlib.py \
97
	lib/rapi/connector.py \
98
	lib/rapi/rlib1.py \
99
	lib/rapi/rlib2.py
100

    
101

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

    
109
doc_DATA = \
110
	$(patsubst %.sgml,%.html,$(docsgml)) \
111
	$(patsubst %.sgml,%.pdf,$(docsgml))
112

    
113
dist_sbin_SCRIPTS = \
114
	daemons/ganeti-noded \
115
	daemons/ganeti-watcher \
116
	daemons/ganeti-masterd \
117
	daemons/ganeti-rapi \
118
	scripts/gnt-backup \
119
	scripts/gnt-cluster \
120
	scripts/gnt-debug \
121
	scripts/gnt-instance \
122
	scripts/gnt-job \
123
	scripts/gnt-node \
124
	scripts/gnt-os
125

    
126
dist_tools_SCRIPTS = \
127
	tools/burnin \
128
	tools/cfgshell \
129
	tools/cfgupgrade \
130
	tools/lvmstrap
131

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

    
162
man_MANS = \
163
	man/ganeti.7 \
164
	man/ganeti-noded.8 \
165
	man/ganeti-os-interface.7 \
166
	man/ganeti-watcher.8 \
167
	man/gnt-backup.8 \
168
	man/gnt-cluster.8 \
169
	man/gnt-instance.8 \
170
	man/gnt-node.8 \
171
	man/gnt-os.8
172

    
173
maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
174
mansgml = $(patsubst %.in,%.sgml,$(maninput))
175

    
176
TEST_FILES = \
177
	test/data/bdev-both.txt \
178
	test/data/bdev-disk.txt \
179
	test/data/bdev-net.txt \
180
	test/data/proc_drbd8.txt
181

    
182
dist_TESTS = \
183
	test/ganeti.config_unittest.py \
184
	test/ganeti.hooks_unittest.py \
185
	test/ganeti.utils_unittest.py \
186
	test/ganeti.bdev_unittest.py \
187
	test/ganeti.ssh_unittest.py \
188
	test/ganeti.locking_unittest.py \
189
	test/ganeti.serializer_unittest.py \
190
	test/ganeti.workerpool_unittest.py \
191
	test/ganeti.rapi.resources_unittest.py \
192
	test/ganeti.http_unittest.py \
193
	test/ganeti.constants_unittest.py
194

    
195
nodist_TESTS =
196

    
197
TESTS = $(dist_TESTS) $(nodist_TESTS)
198

    
199
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
200

    
201

    
202
all-local: stamp-directories lib/_autoconf.py devel/upload \
203
	doc/examples/ganeti.initd doc/examples/ganeti.cron
204

    
205
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
206
	sed -f $(REPLACE_VARS_SED) < $< > $@
207
	chmod u+x $@
208

    
209
doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
210
		$(REPLACE_VARS_SED)
211
	sed -f $(REPLACE_VARS_SED) < $< > $@
212

    
213
doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
214
	sed -f $(REPLACE_VARS_SED) < $< > $@
215

    
216
man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
217
	sed -f $(REPLACE_VARS_SED) < $< > $@
218

    
219
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
220
	$(DOCBOOK_WRAPPER) $< $@
221

    
222
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
223
	$(DOCBOOK_WRAPPER) $< $@
224

    
225
doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
226

    
227
doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
228
	PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
229

    
230
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
231
	$(DOCBOOK_WRAPPER) $< $@
232

    
233
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
234
	$(DOCBOOK_WRAPPER) $< $@
235

    
236
man/footer.sgml $(TESTS): srclinks
237

    
238
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
239

    
240
lib/_autoconf.py: Makefile stamp-directories
241
	set -e; \
242
	{ echo '# This file is automatically generated, do not edit!'; \
243
	  echo '#'; \
244
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
245
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
246
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
247
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
248
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
249
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
250
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
251
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
252
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
253
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
254
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
255
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
256
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
257
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
258
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
259
	  echo "KVM_PATH = '$(KVM_PATH)'"; \
260
	} > $@
261

    
262
$(REPLACE_VARS_SED): Makefile stamp-directories
263
	set -e; \
264
	{ echo 's#@PREFIX@#$(prefix)#g'; \
265
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
266
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
267
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
268
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
269
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
270
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
271
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
272
	  echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
273
	  echo '  r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
274
	  echo '  d'; \
275
	  echo '}'; \
276
	} > $@
277

    
278
# We need to create symlinks because "make distcheck" will not install Python
279
# files when building.
280
#.PHONY: srclinks
281
srclinks: stamp-directories
282
	set -e; \
283
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) $(rapi_PYTHON); do \
284
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
285
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
286
		fi; \
287
	done
288

    
289
.PHONY: ganeti
290
ganeti:
291
	cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
292

    
293
# a dist hook rule for catching revision control directories
294
distcheck-hook:
295
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
296
		echo "Found revision control files in final archive" 1>&2 ; \
297
		exit 1; \
298
	fi
299

    
300
install-exec-local:
301
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
302
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
303
	  "$(DESTDIR)${localstatedir}/run/ganeti"
304

    
305
stamp-directories: Makefile
306
	@mkdir_p@ $(DIRS)
307
	touch $@
308

    
309
.PHONY: apidoc
310
apidoc:
311
	test -e doc/api || mkdir doc/api
312
	TMPDIR=`mktemp -d ./temp-epydoc.XXXXXX` && { \
313
		cp -r scripts daemons lib $$TMPDIR && \
314
		( \
315
			cd $$TMPDIR && \
316
			mv lib ganeti && \
317
			epydoc --conf ../epydoc.conf \
318
		) ; \
319
		rm -rf $$TMPDIR ; \
320
	}
321

    
322
# vim: set noet :