Statistics
| Branch: | Tag: | Revision:

root / Makefile.am @ 501c95a2

History | View | Annotate | Download (6.6 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
REPLACE_VARS_SED = autotools/replace_vars.sed
15

    
16
hypervisordir = $(pkgpythondir)/hypervisor
17
toolsdir = $(pkglibdir)/tools
18
docdir = $(datadir)/doc/$(PACKAGE)
19

    
20
DIRS = \
21
	autotools \
22
	daemons \
23
	devel \
24
	doc \
25
	doc/examples \
26
	lib \
27
	lib/hypervisor \
28
	man \
29
	qa \
30
	qa/hooks \
31
	scripts \
32
	test \
33
	test/data \
34
	tools
35

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

    
54
nodist_pkgpython_PYTHON = \
55
	lib/_autoconf.py
56

    
57
pkgpython_PYTHON = \
58
	lib/__init__.py \
59
	lib/backend.py \
60
	lib/bdev.py \
61
	lib/bootstrap.py \
62
	lib/cli.py \
63
	lib/cmdlib.py \
64
	lib/config.py \
65
	lib/constants.py \
66
	lib/errors.py \
67
	lib/jqueue.py \
68
	lib/locking.py \
69
	lib/logger.py \
70
	lib/luxi.py \
71
	lib/mcpu.py \
72
	lib/objects.py \
73
	lib/opcodes.py \
74
	lib/rpc.py \
75
	lib/serializer.py \
76
	lib/ssconf.py \
77
	lib/ssh.py \
78
	lib/utils.py
79

    
80
hypervisor_PYTHON = \
81
	lib/hypervisor/__init__.py \
82
	lib/hypervisor/hv_base.py \
83
	lib/hypervisor/hv_fake.py \
84
	lib/hypervisor/hv_xen.py
85

    
86
docsgml = \
87
	doc/hooks.sgml \
88
	doc/install.sgml \
89
	doc/admin.sgml \
90
	doc/iallocator.sgml
91

    
92
doc_DATA = \
93
	$(patsubst %.sgml,%.html,$(docsgml)) \
94
	$(patsubst %.sgml,%.pdf,$(docsgml))
95

    
96
dist_sbin_SCRIPTS = \
97
	daemons/ganeti-noded \
98
	daemons/ganeti-watcher \
99
	daemons/ganeti-master \
100
	daemons/ganeti-masterd \
101
	scripts/gnt-backup \
102
	scripts/gnt-cluster \
103
	scripts/gnt-debug \
104
	scripts/gnt-instance \
105
	scripts/gnt-job \
106
	scripts/gnt-node \
107
	scripts/gnt-os
108

    
109
dist_tools_SCRIPTS = \
110
	tools/burnin \
111
	tools/cfgshell \
112
	tools/cfgupgrade \
113
	tools/lvmstrap
114

    
115
EXTRA_DIST = \
116
	NEWS \
117
	DEVNOTES \
118
	autotools/docbook-wrapper \
119
	devel/upload.in \
120
	$(docsgml) \
121
	doc/examples/ganeti.initd.in \
122
	doc/examples/ganeti.cron.in \
123
	doc/examples/dumb-allocator \
124
	qa/hooks/datehook.py \
125
	qa/hooks/loghook.py \
126
	test/testutils.py \
127
	test/mocks.py \
128
	$(dist_TESTS) \
129
	$(TEST_FILES) \
130
	man/footer.sgml \
131
	$(mansgml) \
132
	qa/ganeti-qa.py \
133
	qa/qa-sample.yaml \
134
	qa/qa_cluster.py \
135
	qa/qa_config.py \
136
	qa/qa_daemon.py \
137
	qa/qa_env.py \
138
	qa/qa_error.py \
139
	qa/qa_instance.py \
140
	qa/qa_node.py \
141
	qa/qa_os.py \
142
	qa/qa_other.py \
143
	qa/qa_tags.py \
144
	qa/qa_utils.py
145

    
146
man_MANS = \
147
	man/ganeti.7 \
148
	man/ganeti-master.8 \
149
	man/ganeti-noded.8 \
150
	man/ganeti-os-interface.7 \
151
	man/ganeti-watcher.8 \
152
	man/gnt-backup.8 \
153
	man/gnt-cluster.8 \
154
	man/gnt-instance.8 \
155
	man/gnt-node.8 \
156
	man/gnt-os.8
157

    
158
maninput = $(patsubst %.7,%.in,$(patsubst %.8,%.in,$(man_MANS)))
159
mansgml = $(patsubst %.in,%.sgml,$(maninput))
160

    
161
TEST_FILES = \
162
	test/data/bdev-both.txt \
163
	test/data/bdev-disk.txt \
164
	test/data/bdev-net.txt \
165
	test/data/proc_drbd8.txt
166

    
167
dist_TESTS = \
168
	test/ganeti.config_unittest.py \
169
	test/ganeti.hooks_unittest.py \
170
	test/ganeti.utils_unittest.py \
171
	test/ganeti.bdev_unittest.py \
172
	test/ganeti.ssh_unittest.py \
173
	test/ganeti.locking_unittest.py \
174
	test/ganeti.serializer_unittest.py \
175
	test/ganeti.constants_unittest.py
176

    
177
nodist_TESTS =
178

    
179
TESTS = $(dist_TESTS) $(nodist_TESTS)
180

    
181
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
182

    
183

    
184
all-local: stamp-directories lib/_autoconf.py devel/upload \
185
	doc/examples/ganeti.initd doc/examples/ganeti.cron
186

    
187
devel/upload: devel/upload.in stamp-directories $(REPLACE_VARS_SED)
188
	sed -f $(REPLACE_VARS_SED) < $< > $@
189
	chmod u+x $@
190

    
191
doc/examples/ganeti.%: doc/examples/ganeti.%.in stamp-directories \
192
		$(REPLACE_VARS_SED)
193
	sed -f $(REPLACE_VARS_SED) < $< > $@
194

    
195
doc/%.in: doc/%.sgml stamp-directories $(REPLACE_VARS_SED)
196
	sed -f $(REPLACE_VARS_SED) < $< > $@
197

    
198
man/%.in: man/%.sgml stamp-directories $(REPLACE_VARS_SED)
199
	sed -f $(REPLACE_VARS_SED) < $< > $@
200

    
201
doc/%.pdf: doc/%.in $(DOCBOOK_WRAPPER)
202
	$(DOCBOOK_WRAPPER) $< $@
203

    
204
doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
205
	$(DOCBOOK_WRAPPER) $< $@
206

    
207
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
208
	$(DOCBOOK_WRAPPER) $< $@
209

    
210
man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
211
	$(DOCBOOK_WRAPPER) $< $@
212

    
213
man/footer.sgml $(TESTS): srclinks
214

    
215
$(TESTS): ganeti
216

    
217
lib/_autoconf.py: Makefile stamp-directories
218
	set -e; \
219
	{ echo '# This file is automatically generated, do not edit!'; \
220
	  echo '#'; \
221
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
222
	  echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
223
	  echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
224
	  echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
225
	  echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
226
	  echo "VERSION_FULL = '$(VERSION_FULL)'"; \
227
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
228
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
229
	  echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
230
	  echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
231
	  echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
232
	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
233
	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
234
	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
235
	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
236
	} > $@
237

    
238
$(REPLACE_VARS_SED): Makefile stamp-directories
239
	set -e; \
240
	{ echo 's#@PREFIX@#$(prefix)#g'; \
241
	  echo 's#@SYSCONFDIR@#$(sysconfdir)#g'; \
242
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
243
	  echo 's#@SBINDIR@#$(sbindir)#g'; \
244
	  echo 's#@GANETI_VERSION@#$(PACKAGE_VERSION)#g'; \
245
	  echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
246
	  echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
247
	  echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
248
	} > $@
249

    
250
# We need to create symlinks because "make distcheck" will not install Python
251
# files when building.
252
#.PHONY: srclinks
253
srclinks: stamp-directories
254
	set -e; \
255
	for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON); do \
256
		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
257
			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
258
		fi; \
259
	done
260

    
261
.PHONY: ganeti
262
ganeti:
263
	cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
264

    
265
# a dist hook rule for catching revision control directories
266
distcheck-hook:
267
	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
268
		echo "Found revision control files in final archive" 1>&2 ; \
269
		exit 1; \
270
	fi
271

    
272
install-exec-local:
273
	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
274
	  "$(DESTDIR)${localstatedir}/log/ganeti" \
275
	  "$(DESTDIR)${localstatedir}/run/ganeti"
276

    
277
stamp-directories: Makefile
278
	@mkdir_p@ $(DIRS)
279
	touch $@
280

    
281
# vim: set noet :