Makefile.am 7.4 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			\
13
		../src/remote/remote_protocol.c
14 15 16 17

AVAHI_SOURCES =						\
		mdns.c mdns.h

18
DISTCLEANFILES =
19
EXTRA_DIST =						\
20
	remote_generate_stubs.pl			\
21 22
	libvirtd.conf					\
	libvirtd.init.in				\
23 24
	libvirtd.policy-0				\
	libvirtd.policy-1				\
25 26
	libvirtd.sasl					\
	libvirtd.sysconf				\
27
	libvirtd.aug                                    \
28 29 30
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
31
	test_libvirtd.aug                               \
32 33
	$(AVAHI_SOURCES)				\
	$(DAEMON_SOURCES)
34

35
BUILT_SOURCES =
36

37 38 39 40 41 42
if WITH_LIBVIRTD

sbin_PROGRAMS = libvirtd

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

44
augeasdir = $(datadir)/augeas/lenses
45
augeas_DATA = libvirtd.aug
46 47

augeastestsdir = $(datadir)/augeas/lenses/tests
48
augeastests_DATA = test_libvirtd.aug
49

50
libvirtd_SOURCES = $(DAEMON_SOURCES)
51

D
Daniel P. Berrange 已提交
52
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
53
libvirtd_CFLAGS = \
54 55
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
56
	-I$(top_srcdir)/src \
57
	-I$(top_srcdir)/src/util \
58
	-I$(top_srcdir)/src/conf \
59
	-I$(top_srcdir)/src/remote \
60 61 62 63 64
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(POLKIT_CFLAGS) \
	$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
	$(COVERAGE_CFLAGS) \
	-DSYSCONF_DIR="\"$(sysconfdir)\"" \
65
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
66
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
67 68
	-DGETTEXT_PACKAGE=\"$(PACKAGE)\"

69 70 71
libvirtd_LDFLAGS = 					\
	$(WARN_CFLAGS) 					\
	$(COVERAGE_LDFLAGS)
72

73
libvirtd_LDADD =					\
74 75 76
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
77
	$(POLKIT_LIBS)
78

C
Chris Lalancette 已提交
79 80
libvirtd_LDADD += ../src/libvirt_util.la

81 82 83
if WITH_DRIVER_MODULES
  libvirtd_LDADD += ../src/libvirt_driver.la
else
84
if WITH_QEMU
85
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
86
endif
87

88
if WITH_LXC
89
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
90
endif
91

92
if WITH_UML
93
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
94
endif
95

D
Daniel Veillard 已提交
96 97 98 99
if WITH_ONE
    libvirtd_LDADD += ../src/libvirt_driver_one.la
endif

100
if WITH_STORAGE_DIR
101
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
102
endif
103

104
if WITH_NETWORK
105
    libvirtd_LDADD += ../src/libvirt_driver_network.la
106
endif
107

108 109 110 111
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

112
if WITH_NODE_DEVICES
113
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
114
endif
115 116 117 118

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
119
endif
120 121

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

123
if HAVE_POLKIT
124
if HAVE_POLKIT0
125
policydir = $(datadir)/PolicyKit/policy
126 127 128 129 130
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
131 132
endif

133
if HAVE_AVAHI
134
libvirtd_SOURCES += $(AVAHI_SOURCES)
135 136 137 138
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS)
endif

139

G
Guido Günther 已提交
140 141
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
142
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
143
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
144
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
145

146 147
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
148
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
149
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
150

151 152 153
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
154
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
155 156 157 158 159 160 161 162
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


163
remote.c: remote_dispatch_prototypes.h \
164 165 166
	  remote_dispatch_table.h \
	  remote_dispatch_args.h \
	  remote_dispatch_ret.h
167

168 169 170 171
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x

remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
172

173 174
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
175

176 177
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
178

179 180
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
181

182 183
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
                  libvirtd.uml.logrotate
184

185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
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
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
G
Guido Günther 已提交
202 203 204
	    < $< > $@-t
	mv $@-t $@

205
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
206
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
207 208
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
209
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
210 211 212
	$(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 已提交
213

214
if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
215 216
install-init: libvirtd.init
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
217 218
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
219
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
J
Jim Meyering 已提交
220 221
	$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
222

D
Daniel P. Berrange 已提交
223
uninstall-init:
J
Jim Meyering 已提交
224 225
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
226

227 228
BUILT_SOURCES += libvirtd.init

D
Daniel P. Berrange 已提交
229
libvirtd.init: libvirtd.init.in
230
	sed						\
231 232 233
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
J
Jim Meyering 已提交
234 235 236
	    < $< > $@-t
	chmod a+x $@-t
	mv $@-t $@
D
Daniel P. Berrange 已提交
237

238
check-local:
J
Jim Meyering 已提交
239 240
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
241

D
Daniel P. Berrange 已提交
242 243 244 245
else

install-init:
uninstall-init:
246
libvirtd.init:
247

248
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
249

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

254 255 256
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
257
endif # WITH_LIBVIRTD
258

259 260 261 262 263 264 265 266 267 268
# 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 已提交
269 270 271
else
install-data-sasl:
uninstall-data-sasl:
272 273 274
endif


275
CLEANFILES = $(BUILT_SOURCES)
276
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda