Makefile.am 6.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
		remote_dispatch_prototypes.h		\
9 10 11
		remote_dispatch_table.h			\
		remote_dispatch_args.h			\
		remote_dispatch_ret.h			\
12
		../src/remote/remote_protocol.c
13 14 15 16

AVAHI_SOURCES =						\
		mdns.c mdns.h

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

32
BUILT_SOURCES =
33

34 35 36 37 38 39
if WITH_LIBVIRTD

sbin_PROGRAMS = libvirtd

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

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

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

47
libvirtd_SOURCES = $(DAEMON_SOURCES)
48

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

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

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

76 77 78 79
if WITH_DRIVER_MODULES
  libvirtd_LDADD += ../src/libvirt_driver.la
  libvirtd_LDADD += ../src/libvirt_util.la
else
80
if WITH_QEMU
81
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
82
endif
83

84
if WITH_LXC
85
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
86
endif
87

88
if WITH_UML
89
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
90
endif
91

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

96
if WITH_STORAGE_DIR
97
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
98
endif
99

100
if WITH_NETWORK
101
    libvirtd_LDADD += ../src/libvirt_driver_network.la
102
endif
103

104 105 106 107
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

108
if WITH_NODE_DEVICES
109
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
110
endif
111
endif
112 113

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

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

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

131

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

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

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


155
remote.c: remote_dispatch_prototypes.h \
156 157 158
	  remote_dispatch_table.h \
	  remote_dispatch_args.h \
	  remote_dispatch_ret.h
159

160 161 162 163
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) > $@
164

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

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

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

174 175
BUILT_SOURCES += libvirtd.logrotate

G
Guido Günther 已提交
176 177 178 179 180 181 182 183 184 185 186
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/
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
	$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd

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

D
Daniel P. Berrange 已提交
196
uninstall-init:
J
Jim Meyering 已提交
197 198
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
199

200 201
BUILT_SOURCES += libvirtd.init

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

211
check-local:
J
Jim Meyering 已提交
212 213
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
214

D
Daniel P. Berrange 已提交
215 216 217 218
else

install-init:
uninstall-init:
219
libvirtd.init:
220 221

endif # DBUS_INIT_SCRIPTS_RED_HAT
222

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

227 228 229
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
230
endif # WITH_LIBVIRTD
231

232 233 234 235 236 237 238 239 240 241 242 243 244
# 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


245
CLEANFILES = $(BUILT_SOURCES)
246
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda