Makefile.am 9.7 KB
Newer Older
D
Daniel P. Berrange 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4
CLEANFILES =

5
DAEMON_SOURCES =					\
D
Daniel P. Berrange 已提交
6
		libvirtd.c libvirtd.h			\
7 8
		remote.c remote.h			\
		dispatch.c dispatch.h			\
9
		stream.c stream.h			\
10
		remote_dispatch_prototypes.h		\
11 12 13
		remote_dispatch_table.h			\
		remote_dispatch_args.h			\
		remote_dispatch_ret.h			\
E
Eric Blake 已提交
14 15 16 17
		qemu_dispatch_prototypes.h		\
		qemu_dispatch_table.h			\
		qemu_dispatch_args.h			\
		qemu_dispatch_ret.h			\
C
Chris Lalancette 已提交
18 19
		../src/remote/remote_protocol.c		\
		../src/remote/qemu_protocol.c
20 21 22 23

AVAHI_SOURCES =						\
		mdns.c mdns.h

24
DISTCLEANFILES =
25
EXTRA_DIST =						\
26
	remote_generate_stubs.pl			\
27 28
	libvirtd.conf					\
	libvirtd.init.in				\
29 30
	libvirtd.policy-0				\
	libvirtd.policy-1				\
31 32
	libvirtd.sasl					\
	libvirtd.sysconf				\
33
	libvirtd.aug                                    \
34
	libvirtd.logrotate.in                           \
35 36 37
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
38
	test_libvirtd.aug                               \
39
	THREADING.txt					\
40
	libvirtd.pod.in					\
41
	libvirtd.8.in					\
42
	libvirtd.stp					\
43 44
	$(AVAHI_SOURCES)				\
	$(DAEMON_SOURCES)
45

46
BUILT_SOURCES =
47

48 49
if WITH_LIBVIRTD

50
man8_MANS = libvirtd.8
51

52 53 54 55
sbin_PROGRAMS = libvirtd

confdir = $(sysconfdir)/libvirt/
conf_DATA = libvirtd.conf
56

57
augeasdir = $(datadir)/augeas/lenses
58
augeas_DATA = libvirtd.aug
59 60

augeastestsdir = $(datadir)/augeas/lenses/tests
61
augeastests_DATA = test_libvirtd.aug
62

63
libvirtd.8: $(srcdir)/libvirtd.8.in
64 65 66 67 68 69 70
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

71
libvirtd_SOURCES = $(DAEMON_SOURCES)
72

D
Daniel P. Berrange 已提交
73
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
74
libvirtd_CFLAGS = \
75 76
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
77
	-I$(top_srcdir)/src \
78
	-I$(top_srcdir)/src/util \
79
	-I$(top_srcdir)/src/conf \
80
	-I$(top_srcdir)/src/remote \
81 82
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(POLKIT_CFLAGS) \
83
	$(WARN_CFLAGS) \
84
	$(COVERAGE_CFLAGS) \
85
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
86
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
87

E
Eric Blake 已提交
88 89
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
90
	$(COVERAGE_LDFLAGS)
91

92
libvirtd_LDADD =					\
93 94 95
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
96
	$(POLKIT_LIBS)
97

98
libvirtd_LDADD += ../src/libvirt-qemu.la
C
Chris Lalancette 已提交
99

100
if ! WITH_DRIVER_MODULES
101
if WITH_QEMU
102
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
103
endif
104

105
if WITH_LXC
106
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
107
endif
108

J
Jim Fehlig 已提交
109 110 111 112
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

113
if WITH_UML
114
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
115
endif
116

117
if WITH_STORAGE_DIR
118
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
119
endif
120

121
if WITH_NETWORK
122
    libvirtd_LDADD += ../src/libvirt_driver_network.la
123
endif
124

125 126 127 128
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

129
if WITH_NODE_DEVICES
130
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
131
endif
132 133 134 135

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
136 137 138 139

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
140
endif
141 142

libvirtd_LDADD += ../src/libvirt.la
D
Daniel P. Berrange 已提交
143

144
if HAVE_POLKIT
145
if HAVE_POLKIT0
146
policydir = $(datadir)/PolicyKit/policy
147 148 149 150 151
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
152 153
endif

154
if HAVE_AVAHI
155
libvirtd_SOURCES += $(AVAHI_SOURCES)
156 157 158 159
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS)
endif

160 161 162 163
EXTRA_DIST += probes.d libvirtd.stp

if WITH_DTRACE
libvirtd_LDADD += probes.o
164
nodist_libvirtd_SOURCES = probes.h
165 166 167 168 169 170 171 172 173 174 175 176 177 178

BUILT_SOURCES += probes.h

tapsetdir = $(datadir)/systemtap/tapsets
tapset_DATA = libvirtd.stp

probes.h: probes.d
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

probes.o: probes.d
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

CLEANFILES += probes.h probes.o
endif
179

G
Guido Günther 已提交
180 181
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
182
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
183
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
184
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
185

186 187
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
188
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
189
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
190

191 192 193
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
194
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
195 196 197 198 199 200 201 202
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


203 204 205 206 207 208 209 210 211 212 213
remote.c: \
	remote_dispatch_prototypes.h \
	remote_dispatch_table.h \
	qemu_dispatch_prototypes.h \
	qemu_dispatch_table.h

remote.h: \
	remote_dispatch_args.h \
	remote_dispatch_ret.h \
	qemu_dispatch_args.h \
	qemu_dispatch_ret.h
214

215
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
C
Chris Lalancette 已提交
216
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
217 218

remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
219
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -c -p remote $(REMOTE_PROTOCOL) > $@
220

221
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
222
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -c -t remote $(REMOTE_PROTOCOL) > $@
223

224
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
225
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -c -a remote $(REMOTE_PROTOCOL) > $@
226

227
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
228 229 230 231 232 233 234 235 236 237 238 239 240
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -c -r remote $(REMOTE_PROTOCOL) > $@

qemu_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(QEMU_PROTOCOL)
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -p qemu $(QEMU_PROTOCOL) > $@

qemu_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(QEMU_PROTOCOL)
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -t qemu $(QEMU_PROTOCOL) > $@

qemu_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(QEMU_PROTOCOL)
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -a qemu $(QEMU_PROTOCOL) > $@

qemu_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(QEMU_PROTOCOL)
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -r qemu $(QEMU_PROTOCOL) > $@
241

242
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
243
                  libvirtd.uml.logrotate libvirtd.logrotate
244

245 246
BUILT_SOURCES += $(LOGROTATE_CONFS)

247 248 249 250 251 252
libvirtd.logrotate: libvirtd.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

253 254 255 256 257 258 259
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
260
	$(AM_V_GEN)sed						\
261
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
262 263
	    < $< > $@-t &&					\
	    mv $@-t $@
264 265

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
266
	$(AM_V_GEN)sed						\
267
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
268 269
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
270

271
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
272
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
273 274
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
275
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
276
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
277 278 279
	$(INSTALL_DATA) libvirtd.qemu.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
	$(INSTALL_DATA) libvirtd.lxc.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
	$(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
G
Guido Günther 已提交
280

281
if LIBVIRT_INIT_SCRIPT_RED_HAT
282
install-init: libvirtd.init
D
Daniel P. Berrange 已提交
283
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
284 285
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
286
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
287
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
288
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
289

D
Daniel P. Berrange 已提交
290
uninstall-init:
J
Jim Meyering 已提交
291
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
292
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
293

294
BUILT_SOURCES += libvirtd.init
295

296
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
297
	$(AM_V_GEN)sed					\
298 299 300
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
301 302 303
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
304

305
check-local:
306 307 308
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
309

D
Daniel P. Berrange 已提交
310 311 312 313
else

install-init:
uninstall-init:
314
libvirtd.init:
315

316
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
317

318 319
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
J
John Levon 已提交
320
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
321

322 323 324
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
325
endif # WITH_LIBVIRTD
326

327 328 329 330 331 332 333
# This is needed for 'make dist' too, so can't wrap in WITH_LIBVIRTD.
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

$(srcdir)/libvirtd.8.in: libvirtd.pod.in
	$(AM_V_GEN)$(POD2MAN) $< $@

334 335 336 337 338 339 340 341 342 343
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if HAVE_SASL
install-data-sasl:
	mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/
D
Daniel P. Berrange 已提交
344 345 346
else
install-data-sasl:
uninstall-data-sasl:
347 348 349
endif


350
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
351
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
352
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in