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

3 4
CLEANFILES =

5
DAEMON_GENERATED =					\
6 7
		$(srcdir)/remote_dispatch.h		\
		$(srcdir)/qemu_dispatch.h
8 9 10 11 12

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
		remote.c remote.h			\
		stream.c stream.h			\
C
Chris Lalancette 已提交
13
		../src/remote/remote_protocol.c		\
14 15
		../src/remote/qemu_protocol.c		\
		$(DAEMON_GENERATED)
16

17
DISTCLEANFILES =
18
EXTRA_DIST =						\
19 20
	remote_dispatch.h				\
	qemu_dispatch.h					\
21 22
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
23
	libvirtd.upstart				\
24 25
	libvirtd.policy-0				\
	libvirtd.policy-1				\
26 27
	libvirtd.sasl					\
	libvirtd.sysconf				\
28
	libvirtd.aug                                    \
29
	libvirtd.logrotate.in                           \
30 31 32
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
33
	test_libvirtd.aug                               \
34
	THREADS.txt					\
35
	libvirtd.pod.in					\
36
	libvirtd.8.in					\
37
	libvirtd.stp					\
38
	$(DAEMON_SOURCES)
39

40
BUILT_SOURCES =
41

42 43 44
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

45
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
46
		$(REMOTE_PROTOCOL)
47
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b remote \
48 49
	  $(REMOTE_PROTOCOL) > $@

50
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
51
		$(QEMU_PROTOCOL)
52
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu \
53 54
	  $(QEMU_PROTOCOL) > $@

55 56
if WITH_LIBVIRTD

57
man8_MANS = libvirtd.8
58

59 60 61 62
sbin_PROGRAMS = libvirtd

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

64
augeasdir = $(datadir)/augeas/lenses
65
augeas_DATA = libvirtd.aug
66 67

augeastestsdir = $(datadir)/augeas/lenses/tests
68
augeastests_DATA = test_libvirtd.aug
69

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

78
libvirtd_SOURCES = $(DAEMON_SOURCES)
79

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

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

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

106 107 108 109
libvirtd_LDADD += \
	../src/libvirt-net-rpc-server.la \
	../src/libvirt-net-rpc.la \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
110

111
if ! WITH_DRIVER_MODULES
112
if WITH_QEMU
113
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
114
endif
115

116
if WITH_LXC
117
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
118
endif
119

J
Jim Fehlig 已提交
120 121 122 123
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

124
if WITH_UML
125
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
126
endif
127

128
if WITH_STORAGE_DIR
129
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
130
endif
131

132
if WITH_NETWORK
133
    libvirtd_LDADD += ../src/libvirt_driver_network.la
134
endif
135

136 137 138 139
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

140
if WITH_NODE_DEVICES
141
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
142
endif
143 144 145 146

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
147 148 149 150

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
151
endif
152 153

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

155
if HAVE_POLKIT
156
if HAVE_POLKIT0
157
policydir = $(datadir)/PolicyKit/policy
158 159 160 161 162
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
163 164
endif

165 166
if WITH_DTRACE
libvirtd_LDADD += probes.o
167
nodist_libvirtd_SOURCES = probes.h
168 169 170

BUILT_SOURCES += probes.h

171
tapsetdir = $(datadir)/systemtap/tapset
172 173 174 175 176 177 178 179 180 181
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
182

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

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

194 195 196
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
197
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
198 199 200 201 202 203 204
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
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)
G
Guido Günther 已提交
238
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
239 240
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
241
	mkdir -p $(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
if LIBVIRT_INIT_SCRIPT_RED_HAT
248
install-init: libvirtd.init
D
Daniel P. Berrange 已提交
249
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
250 251
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
252
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
253
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
254
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
255

D
Daniel P. Berrange 已提交
256
uninstall-init:
J
Jim Meyering 已提交
257
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
258
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
259

260
BUILT_SOURCES += libvirtd.init
261

262
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
263
	$(AM_V_GEN)sed					\
264 265 266
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
267 268 269
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
270

271
check-local:
272 273 274
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
275

D
Daniel P. Berrange 已提交
276 277 278 279
else

install-init:
uninstall-init:
280
libvirtd.init:
281

282
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
283

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

288 289 290
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
291
endif # WITH_LIBVIRTD
292

293
# This is needed for 'make dist' too, so can't wrap in WITH_LIBVIRTD.
294 295
EXTRA_DIST += probes.d libvirtd.stp

296 297 298 299 300 301
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

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

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


318
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
319
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
320
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)