Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ ff9efc03

History | View | Annotate | Download (8.4 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
httpdir = $(pkgpythondir)/http
19
rapidir = $(pkgpythondir)/rapi
20
toolsdir = $(pkglibdir)/tools
21
docdir = $(datadir)/doc/$(PACKAGE)
22

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

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

    
61
nodist_pkgpython_PYTHON = \
62
	lib/_autoconf.py
63

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

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

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

    
103
http_PYTHON = \
104
	lib/http/__init__.py
105

    
106

    
107
docsgml = \
108
	doc/hooks.sgml \
109
	doc/install.sgml \
110
	doc/admin.sgml \
111
	doc/rapi.sgml \
112
	doc/iallocator.sgml
113

    
114
docrst = \
115
	doc/design-2.0.rst \
116
	doc/security.rst
117

    
118
docdot = \
119
	doc/arch-2.0.dot
120

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

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

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

    
145
EXTRA_DIST = \
146
	NEWS \
147
	DEVNOTES \
148
	autotools/docbook-wrapper \
149
	devel/upload.in \
150
	$(docrst) \
151
	$(docdot) \
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.bdev_unittest.py \
200
	test/ganeti.cli_unittest.py \
201
	test/ganeti.cmdlib_unittest.py \
202
	test/ganeti.config_unittest.py \
203
	test/ganeti.constants_unittest.py \
204
	test/ganeti.hooks_unittest.py \
205
	test/ganeti.http_unittest.py \
206
	test/ganeti.locking_unittest.py \
207
	test/ganeti.rapi.resources_unittest.py \
208
	test/ganeti.serializer_unittest.py \
209
	test/ganeti.ssh_unittest.py \
210
	test/ganeti.utils_unittest.py \
211
	test/ganeti.workerpool_unittest.py
212

    
213
nodist_TESTS =
214

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

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

    
219

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

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

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

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

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

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

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

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

    
246
doc/%.png: doc/%.dot
247
	$(DOT) -Tpng -o $@ $<
248

    
249
doc/design-2.0.html: doc/design-2.0.rst doc/arch-2.0.png
250

    
251
doc/rapi.pdf doc/rapi.html doc/rapi.in: doc/rapi-resources.sgml
252

    
253
doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
254
	PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
255

    
256
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
257
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
258

    
259
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
260
	$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $@
261

    
262
man/footer.sgml $(TESTS): srclinks
263

    
264
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
265

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

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

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

    
316
.PHONY: ganeti
317
ganeti:
318
	cd $(top_builddir) && test -h "$@" || { rm -f $@ && $(LN_S) lib $@; }
319

    
320
# a dist hook rule for catching revision control directories
321
distcheck-hook:
322
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
323
		echo "Found revision control files in final archive" 1>&2 ; \
324
		exit 1; \
325
	fi
326

    
327
install-exec-local:
328
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
329
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
330
	  "$(DESTDIR)${localstatedir}/run/ganeti"
331

    
332
stamp-directories: Makefile
333
	@mkdir_p@ $(DIRS)
334
	touch $@
335

    
336
.PHONY: apidoc
337
apidoc:
338
	test -e doc/api || mkdir doc/api
339
	TMPDIR=`mktemp -d ` && { \
340
		cp -r scripts daemons lib $$TMPDIR && \
341
		( \
342
			CDIR=`pwd` && \
343
			cd $$TMPDIR && \
344
			mv lib ganeti && \
345
			epydoc --conf $$CDIR/epydoc.conf -o $$CDIR/doc/api \
346
		) ; \
347
		rm -rf $$TMPDIR ; \
348
	}
349

    
350
# vim: set noet :