blob: ed158bc3c41f425adc21e9469e1a1baca465c7e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
## Process this file with automake to produce Makefile.in
## Copyright (C) 2005-2018 Red Hat, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
# that actually use them.
BUILT_SOURCES =
nodist_conf_DATA =
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
INSTALL_DATA_DIRS =
INSTALL_DATA_LOCAL =
UNINSTALL_LOCAL =
SYM_FILES =
USED_SYM_FILES =
augeas_DATA =
augeastest_DATA =
conf_DATA =
if WITH_DTRACE_PROBES
tapset_DATA =
endif WITH_DTRACE_PROBES
RPC_PROBE_FILES =
LOGROTATE_FILES_IN =
SYSTEMD_UNIT_FILES =
SYSTEMD_UNIT_FILES_IN =
OPENRC_INIT_FILES =
OPENRC_INIT_FILES_IN =
OPENRC_CONF_FILES =
SYSCONF_FILES =
COMMON_UNIT_VARS = \
-e 's|[@]runstatedir[@]|$(runstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
$(NULL)
include security/Makefile.inc.am
include access/Makefile.inc.am
include logging/Makefile.inc.am
include locking/Makefile.inc.am
include admin/Makefile.inc.am
include vbox/Makefile.inc.am
include qemu/Makefile.inc.am
include bhyve/Makefile.inc.am
include libxl/Makefile.inc.am
include vz/Makefile.inc.am
include lxc/Makefile.inc.am
include interface/Makefile.inc.am
include network/Makefile.inc.am
include nwfilter/Makefile.inc.am
include node_device/Makefile.inc.am
include secret/Makefile.inc.am
include storage/Makefile.inc.am
include remote/Makefile.inc.am
BUILT_SOURCES += $(nodist_conf_DATA)
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
# rule for libvirt.la. However, checking symbols relies on Linux ELF layout
if WITH_LINUX
check-symfile: libvirt.syms libvirt.la
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \
libvirt.syms .libs/libvirt.so
else ! WITH_LINUX
check-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symsorting.py \
$(srcdir) $(SYM_FILES)
# Keep this list synced with RPC_PROBE_FILES
PROTOCOL_STRUCTS = \
$(srcdir)/remote_protocol-structs \
$(srcdir)/lxc_protocol-structs \
$(srcdir)/qemu_protocol-structs \
$(srcdir)/virnetprotocol-structs \
$(srcdir)/virkeepaliveprotocol-structs \
$(srcdir)/lxc_monitor_protocol-structs \
$(srcdir)/lock_protocol-structs \
$(srcdir)/admin_protocol-structs \
$(NULL)
if WITH_REMOTE
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
# Ensure that we don't change the struct or member names or member ordering
# in remote_protocol.x The check-remote-protocol.py script post-processes
# output to extract the bits we want.
CHECK_REMOTE_PROTOCOL = $(top_srcdir)/scripts/check-remote-protocol.py
# The .o file that pdwtags parses is created as a side effect of running
# libtool; but from make's perspective we depend on the .lo file.
$(srcdir)/remote_protocol-struct \
$(srcdir)/qemu_protocol-struct \
$(srcdir)/lxc_protocol-struct: \
$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \
"$(CC)" $< $(@)s
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \
"$(CC)" $< $(@)s
if WITH_LXC
$(srcdir)/lxc_monitor_protocol-struct: \
$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \
"$(CC)" $< $(@)s
endif WITH_LXC
$(srcdir)/lock_protocol-struct: \
$(srcdir)/%-struct: locking/lockd_la-%.lo
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \
"$(CC)" $< $(@)s
$(srcdir)/admin_protocol-struct: \
$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \
"$(CC)" $< $(@)s
else !WITH_REMOTE
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
endif !WITH_REMOTE
DRIVERS = \
$(srcdir)/driver-hypervisor.h \
$(srcdir)/driver-interface.h \
$(srcdir)/driver-network.h \
$(srcdir)/driver-nodedev.h \
$(srcdir)/driver-nwfilter.h \
$(srcdir)/driver-secret.h \
$(srcdir)/driver-state.h \
$(srcdir)/driver-storage.h \
$(srcdir)/driver-stream.h \
$(NULL)
check-drivername:
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-drivername.py \
$(DRIVERS) \
$(srcdir)/libvirt_public.syms \
$(srcdir)/libvirt_qemu.syms \
$(srcdir)/libvirt_lxc.syms
check-driverimpls:
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-driverimpls.py \
$(DRIVER_SOURCE_FILES)
check-aclrules:
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclrules.py \
$(REMOTE_PROTOCOL) \
$(STATEFUL_DRIVER_SOURCE_FILES)
check-aclperms:
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclperms.py \
$(srcdir)/access/viraccessperm.h \
$(srcdir)/access/viraccessperm.c
check-local: check-protocol check-symfile check-symsorting \
check-drivername check-driverimpls check-aclrules \
check-aclperms check-admin
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
# All .syms files should be placed in exactly one of these three lists,
# depending on whether they are stored in git and/or used in the build.
SYM_FILES += $(USED_SYM_FILES)
check-local: check-augeas
check-augeas: $(augeas_DATA) $(augeastest_DATA)
$(AM_V_GEN) \
if test -x "$(AUGPARSE)"; then \
for f in $(augeastest_DATA); do \
DIR=$$(dirname "$$f"); \
FILE=$$(basename "$$f"); \
"$(AUGPARSE)" \
-I "$(srcdir)/$$DIR" -I "$(builddir)/$$DIR" \
"$$DIR/$$FILE" || exit 1; \
done; \
fi
.PHONY: check-augeas
AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py
AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT)
if WITH_DTRACE_PROBES
BUILT_SOURCES += libvirt_functions.stp
tapset_DATA += libvirt_functions.stp
# Keep this list synced with PROTOCOL_STRUCTS
RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \
$(srcdir)/rpc/virkeepaliveprotocol.x \
$(srcdir)/remote/remote_protocol.x \
$(srcdir)/remote/lxc_protocol.x \
$(srcdir)/remote/qemu_protocol.x \
$(srcdir)/admin/admin_protocol.x
libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/gensystemtap.py \
$(RPC_PROBE_FILES) > $@
endif WITH_DTRACE_PROBES
install-sysconfig:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
for f in $(SYSCONF_FILES:%.sysconf=%) ; \
do \
tgt=`basename $$f`; \
$(INSTALL_DATA) $(srcdir)/$$f.sysconf \
$(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
uninstall-sysconfig:
for f in $(SYSCONF_FILES:%.sysconf=%) ; \
do \
tgt=`basename $$f`; \
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
OPENRC_CONF_DIR = $(sysconfdir)/conf.d
install-openrc-conf:
$(MKDIR_P) $(DESTDIR)$(OPENRC_CONF_DIR)
for f in $(OPENRC_CONF_FILES:%.confd=%) ; \
do \
tgt=`basename $$f`; \
$(INSTALL_DATA) $(srcdir)/$$f.confd \
$(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \
done
uninstall-openrc-conf:
for f in $(OPENRC_CONF_FILES:%.confd=%) ; \
do \
tgt=`basename $$f`; \
rm -f $(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \
done
rmdir $(DESTDIR)$(OPENRC_CONF_DIR) || :
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)
BUILT_SOURCES += $(LOGROTATE_FILES)
%.logrotate: remote/%.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
if WITH_LIBVIRTD
install-logrotate: $(LOGROTATE_FILES)
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/logrotate.d/
for f in $(LOGROTATE_FILES) ; \
do \
tgt=`echo $$f | sed -e 's/.logrotate//'`; \
$(INSTALL_DATA) $$f \
$(DESTDIR)$(sysconfdir)/logrotate.d/$$tgt; \
done
uninstall-logrotate:
rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%)
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
INSTALL_DATA_LOCAL += install-logrotate
UNINSTALL_LOCAL += uninstall-logrotate
endif WITH_LIBVIRTD
if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
for f in $(SYSTEMD_UNIT_FILES); \
do \
$(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
done
uninstall-systemd: uninstall-sysconfig
rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
INSTALL_DATA_LOCAL += install-systemd
UNINSTALL_LOCAL += uninstall-systemd
endif LIBVIRT_INIT_SCRIPT_SYSTEMD
if LIBVIRT_INIT_SCRIPT_OPENRC
OPENRC_INIT_DIR = $(sysconfdir)/init.d
BUILT_SOURCES += $(OPENRC_INIT_FILES)
install-openrc: $(OPENRC_INIT_FILES) install-openrc-conf
$(MKDIR_P) $(DESTDIR)$(OPENRC_INIT_DIR)
for f in $(OPENRC_INIT_FILES:%.init=%) ; \
do \
tgt=`basename $$f`; \
$(INSTALL_SCRIPT) $$f.init \
$(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \
done
uninstall-openrc: uninstall-openrc-conf
for f in $(OPENRC_INIT_FILES:%.init=%) ; \
do \
tgt=`basename $$f`; \
rm -f $(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \
done
rmdir $(DESTDIR)$(OPENRC_INIT_DIR) || :
INSTALL_DATA_LOCAL += install-openrc
UNINSTALL_LOCAL += uninstall-openrc
endif LIBVIRT_INIT_SCRIPT_OPENRC
endif WITH_LIBVIRTD
generated-sources: $(BUILT_SOURCES)
install-data-local: $(INSTALL_DATA_LOCAL) \
$(INSTALL_DATA_DIRS:%=install-data-%)
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
uninstall-local: $(UNINSTALL_LOCAL) \
$(INSTALL_DATA_DIRS:%=uninstall-data-%)
rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
|