Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ a47f574c

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
	qa/hooks \
34
	scripts \
35
	test \
36
	test/data \
37
	tools
38

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

    
59
nodist_pkgpython_PYTHON = \
60
	lib/_autoconf.py
61

    
62
pkgpython_PYTHON = \
63
	lib/__init__.py \
64
	lib/backend.py \
65
	lib/bdev.py \
66
	lib/bootstrap.py \
67
	lib/cli.py \
68
	lib/cmdlib.py \
69
	lib/config.py \
70
	lib/constants.py \
71
	lib/errors.py \
72
	lib/http.py \
73
	lib/jqueue.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_xen.py
92

    
93
rapi_PYTHON = \
94
	lib/rapi/__init__.py \
95
	lib/rapi/RESTHTTPServer.py \
96
	lib/rapi/httperror.py \
97
	lib/rapi/resources.py
98

    
99

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

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

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

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

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

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

    
176
maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
177
mansgml = $(patsubst %.in,%.sgml,$(maninput))
178

    
179
TEST_FILES = \
180
	test/data/bdev-both.txt \
181
	test/data/bdev-disk.txt \
182
	test/data/bdev-net.txt \
183
	test/data/proc_drbd8.txt
184

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

    
197
nodist_TESTS =
198

    
199
TESTS = $(dist_TESTS) $(nodist_TESTS)
200

    
201
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
202

    
203

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

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

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

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

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

    
221
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
222
	$(DOCBOOK_WRAPPER) $< $@
223

    
224
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
225
	$(DOCBOOK_WRAPPER) $< $@
226

    
227
doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
228

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

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

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

    
238
man/footer.sgml $(TESTS): srclinks
239

    
240
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
241

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

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

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

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

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

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

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

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

    
323
# vim: set noet :