Makefile.am 9.3 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.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
POD2MAN = pod2man -c "Virtualization Support" \
64
			-r "$(PACKAGE)-$(VERSION)" -s 8
65

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

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

77
libvirtd_SOURCES = $(DAEMON_SOURCES)
78

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

E
Eric Blake 已提交
94 95
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
96
	$(COVERAGE_LDFLAGS)
97

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
185

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

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

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


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

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

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

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

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

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

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

251 252 253 254 255 256 257 258 259
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
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 277 278
	$(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 已提交
279

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

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

293
BUILT_SOURCES += libvirtd.init
294

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

304
check-local:
305 306 307
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
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) $(man8_MANS)
343
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
344
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in