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

3 4
CLEANFILES =

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

AVAHI_SOURCES =						\
		mdns.c mdns.h

25
DISTCLEANFILES =
26
EXTRA_DIST =						\
27
	remote_generate_stubs.pl			\
28 29
	libvirtd.conf					\
	libvirtd.init.in				\
30 31
	libvirtd.policy-0				\
	libvirtd.policy-1				\
32 33
	libvirtd.sasl					\
	libvirtd.sysconf				\
34
	libvirtd.aug                                    \
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.stp					\
42 43
	$(AVAHI_SOURCES)				\
	$(DAEMON_SOURCES)
44

45
BUILT_SOURCES =
46

47 48
if WITH_LIBVIRTD

49 50
man_MANS = libvirtd.8

51 52 53 54
sbin_PROGRAMS = libvirtd

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

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

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

62
POD2MAN = pod2man -c "Virtualization Support" \
63
			-r "$(PACKAGE)-$(VERSION)" -s 8
64 65 66 67 68 69 70 71 72 73 74 75

libvirtd.pod: libvirtd.pod.in
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

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

76
libvirtd_SOURCES = $(DAEMON_SOURCES)
77

D
Daniel P. Berrange 已提交
78
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
79
libvirtd_CFLAGS = \
80 81
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
82
	-I$(top_srcdir)/src \
83
	-I$(top_srcdir)/src/util \
84
	-I$(top_srcdir)/src/conf \
85
	-I$(top_srcdir)/src/remote \
86 87 88 89 90
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(POLKIT_CFLAGS) \
	$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
	$(COVERAGE_CFLAGS) \
	-DSYSCONF_DIR="\"$(sysconfdir)\"" \
91
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
92
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
93 94
	-DGETTEXT_PACKAGE=\"$(PACKAGE)\"

95 96 97
libvirtd_LDFLAGS = 					\
	$(WARN_CFLAGS) 					\
	$(COVERAGE_LDFLAGS)
98

99
libvirtd_LDADD =					\
100 101 102
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
103
	$(POLKIT_LIBS)
104

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

107
if ! WITH_DRIVER_MODULES
108
if WITH_QEMU
109
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
110
endif
111

112
if WITH_LXC
113
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
114
endif
115

116
if WITH_UML
117
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
118
endif
119

D
Daniel Veillard 已提交
120 121 122 123
if WITH_ONE
    libvirtd_LDADD += ../src/libvirt_driver_one.la
endif

124
if WITH_STORAGE_DIR
125
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
126
endif
127

128
if WITH_NETWORK
129
    libvirtd_LDADD += ../src/libvirt_driver_network.la
130
endif
131

132 133 134 135
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

136
if WITH_NODE_DEVICES
137
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
138
endif
139 140 141 142

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
143 144 145 146

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
147
endif
148 149

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

151
if HAVE_POLKIT
152
if HAVE_POLKIT0
153
policydir = $(datadir)/PolicyKit/policy
154 155 156 157 158
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
159 160
endif

161
if HAVE_AVAHI
162
libvirtd_SOURCES += $(AVAHI_SOURCES)
163 164 165 166
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS)
endif

167 168 169 170
EXTRA_DIST += probes.d libvirtd.stp

if WITH_DTRACE
libvirtd_LDADD += probes.o
171
libvirtd_nodist_SOURCES = probes.h
172 173 174 175 176 177 178 179 180 181 182 183 184 185

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
186

G
Guido Günther 已提交
187 188
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
189
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
190
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
191
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
192

193 194
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
195
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
196
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
197

198 199 200
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
201
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
202 203 204 205 206 207 208 209
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


210 211 212 213 214 215 216 217 218 219 220
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
221

222
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
C
Chris Lalancette 已提交
223
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
224 225

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

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

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

234
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
235 236 237 238 239 240 241 242 243 244 245 246 247
	$(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) > $@
248

249 250
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
                  libvirtd.uml.logrotate
251

252 253 254 255 256 257 258 259 260
BUILT_SOURCES += $(LOGROTATE_CONFS)

libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

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

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

272
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
273
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
274 275
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
276
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
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:
J
Jim Meyering 已提交
306 307
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
308

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

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

315
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
316

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

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

326 327 328 329 330 331 332 333 334 335
# 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 已提交
336 337 338
else
install-data-sasl:
uninstall-data-sasl:
339 340 341
endif


342
CLEANFILES += $(BUILT_SOURCES) $(man_MANS) libvirtd.pod
343
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda