Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ a0638838

History | View | Annotate | Download (7.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
	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/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
doc_DATA = \
111
	$(patsubst %.sgml,%.html,$(docsgml)) \
112
	$(patsubst %.sgml,%.pdf,$(docsgml))
113

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

    
128
dist_tools_SCRIPTS = \
129
	tools/burnin \
130
	tools/cfgshell \
131
	tools/cfgupgrade \
132
	tools/lvmstrap
133

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

    
167
man_MANS = \
168
	man/ganeti.7 \
169
	man/ganeti-master.8 \
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

    
201
nodist_TESTS =
202

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

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

    
207

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

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

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

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

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

    
225
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
226
	$(DOCBOOK_WRAPPER) $< $@
227

    
228
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
229
	$(DOCBOOK_WRAPPER) $< $@
230

    
231
doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
232

    
233
doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/connector.py
234
	PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
235

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

    
239
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
240
	$(DOCBOOK_WRAPPER) $< $@
241

    
242
man/footer.sgml $(TESTS): srclinks
243

    
244
$(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
245

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

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

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

    
294
.PHONY: ganeti
295
ganeti:
296
	cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
297

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

    
305
install-exec-local:
306
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
307
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
308
	  "$(DESTDIR)${localstatedir}/run/ganeti"
309

    
310
stamp-directories: Makefile
311
	@mkdir_p@ $(DIRS)
312
	touch $@
313

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

    
327
# vim: set noet :