Makefile.am 9.2 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
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(POLKIT_CFLAGS) \
88
	$(WARN_CFLAGS) \
89
	$(COVERAGE_CFLAGS) \
90
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
91
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
92

93 94 95
libvirtd_LDFLAGS = 					\
	$(WARN_CFLAGS) 					\
	$(COVERAGE_LDFLAGS)
96

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
184

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

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

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


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

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

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

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

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

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

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

250 251 252 253 254 255 256 257 258
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
259
	$(AM_V_GEN)sed						\
260
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
261 262
	    < $< > $@-t &&					\
	    mv $@-t $@
263 264

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

270
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
271
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
272 273
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
274
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
275 276 277
	$(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 已提交
278

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

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

292
BUILT_SOURCES += libvirtd.init
293

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

303
check-local:
J
Jim Meyering 已提交
304 305
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
306

D
Daniel P. Berrange 已提交
307 308 309 310
else

install-init:
uninstall-init:
311
libvirtd.init:
312

313
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
314

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

319 320 321
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
322
endif # WITH_LIBVIRTD
323

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


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