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

3
## Copyright (C) 2005-2012 Red Hat, Inc.
4 5
## See COPYING.LIB for the License of this software

6
INCLUDES = \
7 8 9
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
10 11 12 13 14 15
	-I$(top_srcdir)/src/util \
	-I$(top_srcdir)/src/conf \
	-I$(top_srcdir)/src/rpc \
	-I$(top_srcdir)/src/remote \
	$(GETTEXT_CPPFLAGS)

16 17
CLEANFILES =

18
DAEMON_GENERATED =					\
19 20
		$(srcdir)/remote_dispatch.h		\
		$(srcdir)/qemu_dispatch.h
21 22 23

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
24
		libvirtd-config.c libvirtd-config.h	\
25 26
		remote.c remote.h			\
		stream.c stream.h			\
C
Chris Lalancette 已提交
27
		../src/remote/remote_protocol.c		\
28 29
		../src/remote/qemu_protocol.c		\
		$(DAEMON_GENERATED)
30

31
DISTCLEANFILES =
32
EXTRA_DIST =						\
33 34
	remote_dispatch.h				\
	qemu_dispatch.h					\
35 36
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
37
	libvirtd.upstart				\
38 39
	libvirtd.policy-0				\
	libvirtd.policy-1				\
40 41
	libvirtd.sasl					\
	libvirtd.sysconf				\
E
Eric Blake 已提交
42
	libvirtd.sysctl					\
43
	libvirtd.aug                                    \
44
	libvirtd.logrotate.in                           \
45 46 47
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
48
	test_libvirtd.aug.in                             \
49
	THREADS.txt					\
50
	libvirtd.pod.in					\
51
	libvirtd.8.in					\
52
	$(DAEMON_SOURCES)
53

54
BUILT_SOURCES =
55

56 57 58
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

59
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
60
		$(REMOTE_PROTOCOL)
61
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b remote REMOTE \
62 63
	  $(REMOTE_PROTOCOL) > $@

64
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
65
		$(QEMU_PROTOCOL)
66
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu QEMU \
67 68
	  $(QEMU_PROTOCOL) > $@

69 70
if WITH_LIBVIRTD

71
man8_MANS = libvirtd.8
72

73 74 75 76
sbin_PROGRAMS = libvirtd

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

78
augeasdir = $(datadir)/augeas/lenses
79
augeas_DATA = libvirtd.aug
80 81

augeastestsdir = $(datadir)/augeas/lenses/tests
82
augeastests_DATA = test_libvirtd.aug
83

84 85
CLEANFILES += test_libvirtd.aug

86
libvirtd.8: $(srcdir)/libvirtd.8.in
87
	sed \
88 89
	    -e 's!SYSCONFDIR!$(sysconfdir)!g' \
	    -e 's!LOCALSTATEDIR!$(localstatedir)!g' \
90 91 92
	    < $< > $@-t
	mv $@-t $@

93
libvirtd_SOURCES = $(DAEMON_SOURCES)
94

D
Daniel P. Berrange 已提交
95
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
96
libvirtd_CFLAGS = \
97
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
D
Doug Goldstein 已提交
98
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
99
	$(WARN_CFLAGS) \
100
	$(COVERAGE_CFLAGS) \
101
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
102

E
Eric Blake 已提交
103 104
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
105
	$(COVERAGE_LDFLAGS)
106

107
libvirtd_LDADD =					\
108 109 110
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
111
	$(DBUS_LIBS)					\
D
Doug Goldstein 已提交
112 113
	$(POLKIT_LIBS)					\
	$(LIBNL_LIBS)
114

115
if WITH_DTRACE_PROBES
116
libvirtd_LDADD += ../src/libvirt_probes.lo
117 118
endif

119 120
libvirtd_LDADD += \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
121

122
if ! WITH_DRIVER_MODULES
123
if WITH_QEMU
124
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
125
if WITH_DTRACE_PROBES
126
    libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
127
endif
128
endif
129

130
if WITH_LXC
131
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
132
endif
133

J
Jim Fehlig 已提交
134 135 136 137
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

138
if WITH_UML
139
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
140
endif
141

142
if WITH_STORAGE
143
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
144
endif
145

146
if WITH_NETWORK
147
    libvirtd_LDADD += ../src/libvirt_driver_network.la
148
endif
149

150 151 152 153
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

154
if WITH_NODE_DEVICES
155
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
156
endif
157 158 159 160

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
161 162 163 164

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
165
endif
166 167

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

169
if HAVE_POLKIT
170
if HAVE_POLKIT0
171
policydir = $(datadir)/PolicyKit/policy
172 173 174 175 176
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
177 178
endif

179 180 181
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
182 183 184
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
185

186 187
uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \
		uninstall-data-sasl uninstall-data-polkit \
188
		uninstall-logrotate uninstall-sysctl
189
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
190
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
191
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
192

193
if HAVE_POLKIT
194
install-data-polkit::
195
	$(MKDIR_P) $(DESTDIR)$(policydir)
196
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
197
uninstall-data-polkit::
198
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
199
	rmdir $(DESTDIR)$(policydir) || :
200 201 202 203 204
else
install-data-polkit::
uninstall-data-polkit::
endif

205 206
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
207

208
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
209
		  libvirtd.uml.logrotate libvirtd.logrotate
210

211 212
BUILT_SOURCES += $(LOGROTATE_CONFS)

213 214 215 216 217 218
libvirtd.logrotate: libvirtd.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

219 220 221 222 223 224 225
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
226
	$(AM_V_GEN)sed						\
227
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
228 229
	    < $< > $@-t &&					\
	    mv $@-t $@
230 231

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
232
	$(AM_V_GEN)sed						\
233
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
234 235
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
236

237
install-logrotate: $(LOGROTATE_CONFS)
238 239 240 241
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
242
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
243 244 245
	$(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 已提交
246

247 248 249 250 251 252 253 254 255 256
uninstall-logrotate:
	rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/lxc || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || :
	rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :

257
install-sysconfig:
258
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
259
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
260
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
261 262
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
263
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
264

265
if WITH_SYSCTL
266
install-sysctl:
267
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
E
Eric Blake 已提交
268 269
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
270

271 272
uninstall-sysctl:
	rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
273
	rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
274 275 276 277
else
install-sysctl:
uninstall-sysctl:
endif
278 279

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
280

281
BUILT_SOURCES += libvirtd.init
282

283
install-init-redhat: install-sysconfig libvirtd.init
284
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
285 286 287 288 289
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd

uninstall-init-redhat: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
290
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
291 292 293 294 295 296 297 298 299
else
install-init-redhat:
uninstall-init-redhat:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
300
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
301 302 303 304 305
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
306
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
307 308 309 310 311 312 313 314 315 316 317 318 319
else
install-init-upstart:
uninstall-init-upstart:
endif # LIBVIRT_INIT_SCRIPT_UPSTART


EXTRA_DIST += libvirtd.service.in
if LIBVIRT_INIT_SCRIPT_SYSTEMD

SYSTEMD_UNIT_DIR = /lib/systemd/system
BUILT_SOURCES += libvirtd.service

install-init-systemd: install-sysconfig libvirtd.service
320
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
321
	$(INSTALL_DATA) libvirtd.service \
322 323 324 325
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
326
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
327 328 329 330 331
else
install-init-systemd:
uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

332
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
333
	$(AM_V_GEN)sed					\
334 335 336
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
337 338 339
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
340

341 342
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed					\
343 344 345
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
346 347 348 349 350
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@


351 352
check-local: check-augeas

353 354 355 356
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl

test_libvirtd.aug: test_libvirtd.aug.in $(srcdir)/libvirtd.conf
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libvirtd.conf $< $@
357 358

check-augeas: test_libvirtd.aug
359
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
360
	  '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
361
	fi
362

363

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

368 369 370
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
371
endif # WITH_LIBVIRTD
372

373 374 375 376
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

$(srcdir)/libvirtd.8.in: libvirtd.pod.in
377
	$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@
378

379 380 381 382
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if HAVE_SASL
install-data-sasl:
383
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
384 385 386 387
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
388
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
D
Daniel P. Berrange 已提交
389 390 391
else
install-data-sasl:
uninstall-data-sasl:
392 393 394
endif


395
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
396
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
397
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)