Makefile.am 6.5 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
	libvirtd.logrotate.in                           \
29
	test_libvirtd.aug                               \
30 31
	$(AVAHI_SOURCES)				\
	$(DAEMON_SOURCES)
32

33
BUILT_SOURCES =
34

35 36 37 38 39 40
if WITH_LIBVIRTD

sbin_PROGRAMS = libvirtd

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

42
augeasdir = $(datadir)/augeas/lenses
43
augeas_DATA = libvirtd.aug
44 45

augeastestsdir = $(datadir)/augeas/lenses/tests
46
augeastests_DATA = test_libvirtd.aug
47

48
libvirtd_SOURCES = $(DAEMON_SOURCES)
49

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

67 68 69
libvirtd_LDFLAGS = 					\
	$(WARN_CFLAGS) 					\
	$(COVERAGE_LDFLAGS)
70

71
libvirtd_LDADD =					\
72 73 74
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
75
	$(POLKIT_LIBS)
76

C
Chris Lalancette 已提交
77 78
libvirtd_LDADD += ../src/libvirt_util.la

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

86
if WITH_LXC
87
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
88
endif
89

90
if WITH_UML
91
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
92
endif
93

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

98
if WITH_STORAGE_DIR
99
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
100
endif
101

102
if WITH_NETWORK
103
    libvirtd_LDADD += ../src/libvirt_driver_network.la
104
endif
105

106 107 108 109
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

110
if WITH_NODE_DEVICES
111
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
112
endif
113
endif
114 115

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

117
if HAVE_POLKIT
118
if HAVE_POLKIT0
119
policydir = $(datadir)/PolicyKit/policy
120 121 122 123 124
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
125 126
endif

127
if HAVE_AVAHI
128
libvirtd_SOURCES += $(AVAHI_SOURCES)
129 130 131 132
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS)
endif

133

G
Guido Günther 已提交
134 135
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
136
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
137
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
138
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
139

140 141
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
142
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
143
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
144

145 146 147
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
148
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
149 150 151 152 153 154 155 156
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


157
remote.c: remote_dispatch_prototypes.h \
158 159 160
	  remote_dispatch_table.h \
	  remote_dispatch_args.h \
	  remote_dispatch_ret.h
161

162 163 164 165
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) > $@
166

167 168
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
169

170 171
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
	perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
172

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

176 177
BUILT_SOURCES += libvirtd.logrotate

G
Guido Günther 已提交
178 179 180 181 182 183 184 185
libvirtd.logrotate: libvirtd.logrotate.in
	sed						\
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    < $< > $@-t
	mv $@-t $@

install-logrotate: libvirtd.logrotate
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
186 187
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
188 189 190
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
	$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd

191
if LIBVIRT_INIT_SCRIPTS_RED_HAT
D
Daniel P. Berrange 已提交
192 193
install-init: libvirtd.init
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
194 195
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
196
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
J
Jim Meyering 已提交
197 198
	$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
199

D
Daniel P. Berrange 已提交
200
uninstall-init:
J
Jim Meyering 已提交
201 202
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
203

204 205
BUILT_SOURCES += libvirtd.init

D
Daniel P. Berrange 已提交
206
libvirtd.init: libvirtd.init.in
207
	sed						\
208 209 210
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
J
Jim Meyering 已提交
211 212 213
	    < $< > $@-t
	chmod a+x $@-t
	mv $@-t $@
D
Daniel P. Berrange 已提交
214

215
check-local:
J
Jim Meyering 已提交
216 217
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
218

D
Daniel P. Berrange 已提交
219 220 221 222
else

install-init:
uninstall-init:
223
libvirtd.init:
224 225

endif # DBUS_INIT_SCRIPTS_RED_HAT
226

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

231 232 233
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
234
endif # WITH_LIBVIRTD
235

236 237 238 239 240 241 242 243 244 245 246 247 248
# 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/
endif


249
CLEANFILES = $(BUILT_SOURCES)
250
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda