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

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

AVAHI_SOURCES =						\
		mdns.c mdns.h

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

42
BUILT_SOURCES =
43

44 45
if WITH_LIBVIRTD

46 47
man_MANS = libvirtd.8

48 49 50 51
sbin_PROGRAMS = libvirtd

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

53
augeasdir = $(datadir)/augeas/lenses
54
augeas_DATA = libvirtd.aug
55 56

augeastestsdir = $(datadir)/augeas/lenses/tests
57
augeastests_DATA = test_libvirtd.aug
58

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

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) $< $@

73
libvirtd_SOURCES = $(DAEMON_SOURCES)
74

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

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

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

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

104 105 106
if WITH_DRIVER_MODULES
  libvirtd_LDADD += ../src/libvirt_driver.la
else
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

G
Guido Günther 已提交
167 168
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
169
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
170
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
171
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
172

173 174
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
175
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
176
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
177

178 179 180
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
181
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
182 183 184 185 186 187 188 189
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


190
remote.c: remote_dispatch_prototypes.h \
191 192
	  remote_dispatch_table.h \
	  remote_dispatch_args.h \
C
Chris Lalancette 已提交
193 194 195 196 197
	  remote_dispatch_ret.h \
	  qemu_dispatch_prototypes.h \
	  qemu_dispatch_table.h \
	  qemu_dispatch_args.h \
	  qemu_dispatch_ret.h
198

199
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
C
Chris Lalancette 已提交
200
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
201 202

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

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

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

211
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
C
Chris Lalancette 已提交
212 213 214 215 216 217 218 219 220 221 222 223 224
	$(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) > $@
225

226 227
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
                  libvirtd.uml.logrotate
228

229 230 231 232 233 234 235 236 237
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
238
	$(AM_V_GEN)sed						\
239
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
240 241
	    < $< > $@-t &&					\
	    mv $@-t $@
242 243

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
244
	$(AM_V_GEN)sed						\
245
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
246 247
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
248

249
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
250
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
251 252
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
253
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
254 255 256
	$(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 已提交
257

258
if LIBVIRT_INIT_SCRIPT_RED_HAT
259
install-init: libvirtd.init
D
Daniel P. Berrange 已提交
260
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
261 262
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
263
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
J
Jim Meyering 已提交
264 265
	$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
266

D
Daniel P. Berrange 已提交
267
uninstall-init:
J
Jim Meyering 已提交
268
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
269
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
270

271
BUILT_SOURCES += libvirtd.init
272

273
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
274
	$(AM_V_GEN)sed					\
275 276 277
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
278 279 280
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
281

282
check-local:
J
Jim Meyering 已提交
283 284
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
285

D
Daniel P. Berrange 已提交
286 287 288 289
else

install-init:
uninstall-init:
290
libvirtd.init:
291

292
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
293

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

298 299 300
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
301
endif # WITH_LIBVIRTD
302

303 304 305 306 307 308 309 310 311 312
# 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 已提交
313 314 315
else
install-data-sasl:
uninstall-data-sasl:
316 317 318
endif


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