Makefile.am 7.7 KB
Newer Older
K
Karel Zak 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4
SHELL = $(PREFERABLY_POSIX_SHELL)

5
SUBDIRS = confdata sexpr2xmldata \
6
  xml2sexprdata xmconfigdata xencapsdata
7

K
Karel Zak 已提交
8
INCLUDES = \
9
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
K
Karel Zak 已提交
10
	-I$(top_builddir)/include \
11 12
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src \
13
	-I$(top_srcdir)/src/util \
14
	-I$(top_srcdir)/src/conf \
15 16
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
17
	$(SASL_CFLAGS) \
18
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
19
	$(APPARMOR_CFLAGS) \
20
        -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
21
         $(COVERAGE_CFLAGS) \
22
         $(WARN_CFLAGS)
23

24 25 26 27 28
if WITH_DRIVER_MODULES
INCLUDES += \
	-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
endif

K
Karel Zak 已提交
29 30
LDADDS = \
	@STATIC_BINARIES@ \
31 32
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
33
        $(SASL_LIBS) \
34
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
35
        $(APPARMOR_LIBS) \
36
        $(WARN_CFLAGS) \
37
	../src/libvirt_test.la \
38
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
39
	$(LIBSOCKET) \
40
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
41

42 43 44 45 46
qemuhelpdata = \
	kvm-74 \
	kvm-86 \
	qemu-0.10.5 \
	qemu-0.9.1 \
47 48
	qemu-kvm-0.10.5 \
	qemu-kvm-0.11.0-rc2
49

50
EXTRA_DIST =		\
51
        oomtrace.pl     \
52
	test-lib.sh	\
53
	qemuxml2argvdata \
54
	nodeinfodata     \
55 56 57
	capabilityschematest \
	capabilityschemadata \
	networkschematest \
58
	networkschemadata \
J
Jim Meyering 已提交
59
	domainschematest \
60
	domainschemadata \
61
	interfaceschemadata \
62 63 64 65 66
	storagepoolschematest \
	storagepoolschemadata \
	storagevolschematest \
	storagevolschemadata \
	nodedevschematest \
67 68
	nodedevschemadata \
	$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
K
Karel Zak 已提交
69

J
Jim Meyering 已提交
70
noinst_PROGRAMS = virshtest conftest \
71
        nodeinfotest statstest qparamtest
72

73 74 75 76
if WITH_XEN
noinst_PROGRAMS += xml2sexprtest sexpr2xmltest \
	reconnect xmconfigtest xencapstest
endif
77
if WITH_QEMU
78
noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
79 80
endif

81 82 83 84
if WITH_ESX
noinst_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest
endif

85 86 87 88
if WITH_SECDRIVER_SELINUX
noinst_PROGRAMS += seclabeltest
endif

J
Jamie Strandboge 已提交
89 90 91 92
if WITH_SECDRIVER_APPARMOR
noinst_PROGRAMS += secaatest
endif

93 94 95 96
if WITH_CIL
noinst_PROGRAMS += object-locking
endif

M
Mark McLoughlin 已提交
97 98
noinst_PROGRAMS += nodedevxml2xmltest

99 100
noinst_PROGRAMS += interfacexml2xmltest

101 102
test_scripts = \
	capabilityschematest \
103
	interfaceschematest \
104 105 106 107 108 109
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
	nodedevschematest

A
Atsushi SAKAI 已提交
110
if WITH_LIBVIRTD
111 112 113 114 115 116
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
117 118
	libvirtd-fail			\
	libvirtd-pool			\
119 120 121 122 123 124
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
J
Jim Meyering 已提交
125
	virsh-synopsis
A
Atsushi SAKAI 已提交
126
endif
127

J
Jamie Strandboge 已提交
128 129 130
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
endif
131 132
EXTRA_DIST += $(test_scripts)

133 134 135 136 137 138 139 140 141 142 143
TESTS = virshtest \
        nodeinfotest \
	statstest \
	qparamtest \
	$(test_scripts)

if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
	xencapstest
144
if ENABLE_XEN_TESTS
145 146
TESTS += reconnect
endif
147
endif
148

149
if WITH_QEMU
150
TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest
151
endif
K
Karel Zak 已提交
152

153 154 155 156
if WITH_ESX
TESTS += esxutilstest vmx2xmltest xml2vmxtest
endif

157 158 159 160
if WITH_SECDRIVER_SELINUX
TESTS += seclabeltest
endif

J
Jamie Strandboge 已提交
161 162 163 164
if WITH_SECDRIVER_APPARMOR
TESTS += secaatest
endif

165 166 167 168 169
if WITH_LIBVIRTD
noinst_PROGRAMS += eventtest
TESTS += eventtest
endif

M
Mark McLoughlin 已提交
170 171
TESTS += nodedevxml2xmltest

172 173
TESTS += interfacexml2xmltest

C
Chris Lalancette 已提交
174
path_add = $$abs_top_builddir/src$(PATH_SEPARATOR)$$abs_top_builddir/daemon$(PATH_SEPARATOR)$$abs_top_builddir/tools
J
Jim Meyering 已提交
175

176 177 178
# NB, automake < 1.10 does not provide the real
# abs_top_{src/build}dir variables, so don't rely
# on them here. Fake them with 'pwd'
179
TESTS_ENVIRONMENT =				\
J
Jim Meyering 已提交
180 181
  abs_top_builddir=`cd '$(top_builddir)'; pwd`	\
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
182 183
  abs_builddir=`cd '$(builddir)'; pwd`		\
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
184
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
185
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
186
  SHELL="$(SHELL)"				\
187
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
188
  LIBVIRT_DEBUG="error"				\
189
  LC_ALL=C					\
190 191
  $(VG)

192
valgrind:
193
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
194

195
if WITH_XEN
196
xml2sexprtest_SOURCES = \
197
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
198
	testutils.c testutils.h
199
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
200 201

sexpr2xmltest_SOURCES = \
202
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
203
	testutils.c testutils.h
204
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
205

206
xmconfigtest_SOURCES = \
207
	xmconfigtest.c testutilsxen.c testutilsxen.h \
208
	testutils.c testutils.h
209
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
210

211 212 213 214 215 216 217 218 219 220 221 222 223 224
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
	reconnect.c
reconnect_LDADD = $(LDADDS)

else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

225
if WITH_QEMU
226
qemuxml2argvtest_SOURCES = \
227
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
228
	testutils.c testutils.h
229
qemuxml2argvtest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
230 231

qemuxml2xmltest_SOURCES = \
232
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
233
	testutils.c testutils.h
234
qemuxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
235 236 237 238 239

qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuargv2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
240 241 242

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
qemuhelptest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS)
243
else
244
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h
245
endif
246

247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)

vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
vmx2xmltest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
xml2vmxtest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
else
EXTRA_DIST += esxutilstest.c vmx2xmltest.c xml2vmxtest.c
endif

M
Mark McLoughlin 已提交
266 267 268
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
269
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
270

271 272 273 274 275
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

276 277 278 279 280
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
281 282 283 284
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

285 286 287 288
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

289 290 291 292
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = $(LDADDS)

293 294 295 296 297 298 299 300
if WITH_SECDRIVER_SELINUX
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += seclabeltest.c
endif

J
Jamie Strandboge 已提交
301 302 303 304 305 306 307 308
if WITH_SECDRIVER_APPARMOR
secaatest_SOURCES = \
	secaatest.c
secaatest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
else
EXTRA_DIST += secaatest.c
endif

309 310 311 312
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

313 314
if WITH_LIBVIRTD
eventtest_SOURCES = \
315
	eventtest.c testutils.h testutils.c ../daemon/event.c
316 317 318
eventtest_LDADD = -lrt $(LDADDS)
endif

319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
if WITH_CIL
CILOPTFLAGS =
CILOPTINCS =
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg

object_locking_SOURCES = object-locking.ml

%.cmx: %.ml
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<

object-locking: object-locking.cmx object-locking-files.txt
	ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) $(CILOPTLIBS) $< -o $@

object-locking-files.txt:
	find $(top_builddir)/src/ -name '*.i' > $@

else
EXTRA_DIST += object-locking.ml
endif

340
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx object-locking-files.txt