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

3 4 5
## Copyright (C) 2005-2011 Red Hat, Inc.
## See COPYING.LIB for the License of this software

6 7 8
INCLUDES = \
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
9
	-I$(top_srcdir)/src -I../src \
10 11 12 13 14 15
	-I$(top_srcdir)/src/util \
	-I$(top_srcdir)/src/conf \
	-I$(top_srcdir)/src/rpc \
	-I$(top_srcdir)/src/remote \
	$(GETTEXT_CPPFLAGS)

16 17
CLEANFILES =

18
DAEMON_GENERATED =					\
19 20
		$(srcdir)/remote_dispatch.h		\
		$(srcdir)/qemu_dispatch.h
21 22 23 24 25

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
		remote.c remote.h			\
		stream.c stream.h			\
C
Chris Lalancette 已提交
26
		../src/remote/remote_protocol.c		\
27 28
		../src/remote/qemu_protocol.c		\
		$(DAEMON_GENERATED)
29

30
DISTCLEANFILES =
31
EXTRA_DIST =						\
32 33
	remote_dispatch.h				\
	qemu_dispatch.h					\
34 35
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
36
	libvirtd.upstart				\
37 38
	libvirtd.policy-0				\
	libvirtd.policy-1				\
39 40
	libvirtd.sasl					\
	libvirtd.sysconf				\
E
Eric Blake 已提交
41
	libvirtd.sysctl					\
42
	libvirtd.aug                                    \
43
	libvirtd.logrotate.in                           \
44 45 46
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
47
	test_libvirtd.aug                               \
48
	THREADS.txt					\
49
	libvirtd.pod.in					\
50
	libvirtd.8.in					\
51
	$(DAEMON_SOURCES)
52

53
BUILT_SOURCES =
54

55 56 57
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

58
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
59
		$(REMOTE_PROTOCOL)
60
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b remote \
61 62
	  $(REMOTE_PROTOCOL) > $@

63
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
64
		$(QEMU_PROTOCOL)
65
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu \
66 67
	  $(QEMU_PROTOCOL) > $@

68 69
if WITH_LIBVIRTD

70
man8_MANS = libvirtd.8
71

72 73 74 75
sbin_PROGRAMS = libvirtd

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

77
augeasdir = $(datadir)/augeas/lenses
78
augeas_DATA = libvirtd.aug
79 80

augeastestsdir = $(datadir)/augeas/lenses/tests
81
augeastests_DATA = test_libvirtd.aug
82

83
libvirtd.8: $(srcdir)/libvirtd.8.in
84 85 86 87 88 89 90
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

91
libvirtd_SOURCES = $(DAEMON_SOURCES)
92

D
Daniel P. Berrange 已提交
93
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
94
libvirtd_CFLAGS = \
95
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
96
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) \
97
	$(WARN_CFLAGS) \
98
	$(COVERAGE_CFLAGS) \
99
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
100
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
101

E
Eric Blake 已提交
102 103
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
104
	$(COVERAGE_LDFLAGS)
105

106
libvirtd_LDADD =					\
107 108 109
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
110
	$(POLKIT_LIBS)
111

112 113 114 115
if WITH_DTRACE
libvirtd_LDADD += ../src/probes.o
endif

116 117
libvirtd_LDADD += \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
118

119
if ! WITH_DRIVER_MODULES
120
if WITH_QEMU
121
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
122
endif
123

124
if WITH_LXC
125
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
126
endif
127

J
Jim Fehlig 已提交
128 129 130 131
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

132
if WITH_UML
133
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
134
endif
135

136
if WITH_STORAGE_DIR
137
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
138
endif
139

140
if WITH_NETWORK
141
    libvirtd_LDADD += ../src/libvirt_driver_network.la
142
endif
143

144 145 146 147
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

148
if WITH_NODE_DEVICES
149
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
150
endif
151 152 153 154

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
155 156 157 158

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
159
endif
160 161

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

163
if HAVE_POLKIT
164
if HAVE_POLKIT0
165
policydir = $(datadir)/PolicyKit/policy
166 167 168 169 170
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
171 172
endif

G
Guido Günther 已提交
173
install-data-local: install-init install-data-sasl install-data-polkit \
174
		    install-logrotate
175
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
176
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
177
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
178

179 180
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
181
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
182
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
183

184 185 186
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
187
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
188 189 190 191 192 193 194
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif

195 196
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
197

198
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
199
		  libvirtd.uml.logrotate libvirtd.logrotate
200

201 202
BUILT_SOURCES += $(LOGROTATE_CONFS)

203 204 205 206 207 208
libvirtd.logrotate: libvirtd.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

209 210 211 212 213 214 215
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
216
	$(AM_V_GEN)sed						\
217
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
218 219
	    < $< > $@-t &&					\
	    mv $@-t $@
220 221

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
222
	$(AM_V_GEN)sed						\
223
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
224 225
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
226

227
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
228
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
229 230
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
231
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
232
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
233 234 235
	$(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 已提交
236

237
if LIBVIRT_INIT_SCRIPT_RED_HAT
238
install-init: libvirtd.init
E
Eric Blake 已提交
239 240 241
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d \
	  $(DESTDIR)$(sysconfdir)/sysconfig \
	  $(DESTDIR)$(sysconfdir)/sysctl.d
J
Jim Meyering 已提交
242 243
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
244
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
245
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
E
Eric Blake 已提交
246 247
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
248

D
Daniel P. Berrange 已提交
249
uninstall-init:
J
Jim Meyering 已提交
250
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
E
Eric Blake 已提交
251 252
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \
		$(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
D
Daniel P. Berrange 已提交
253

254
BUILT_SOURCES += libvirtd.init
255

256
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
257
	$(AM_V_GEN)sed					\
258 259 260
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
261 262 263
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
264

265
check-local:
266 267 268
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
269

D
Daniel P. Berrange 已提交
270 271 272 273
else

install-init:
uninstall-init:
274
libvirtd.init:
275

276
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
277

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

282 283 284
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
285
endif # WITH_LIBVIRTD
286

287 288 289 290 291 292
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

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

293 294 295 296 297 298 299 300 301 302
# 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 已提交
303 304 305
else
install-data-sasl:
uninstall-data-sasl:
306 307 308
endif


309
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
310
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
311
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)