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

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

6 7
SHELL = $(PREFERABLY_POSIX_SHELL)

K
Karel Zak 已提交
8
INCLUDES = \
9 10 11
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
12
	-I$(top_srcdir)/src/util \
13 14
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
15 16

AM_CFLAGS = \
17 18
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
19
	$(SASL_CFLAGS) \
20
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
21
	$(APPARMOR_CFLAGS) \
22
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
23 24
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
25

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

31
PROBES_O =
32
if WITH_DTRACE_PROBES
33 34 35
PROBES_O += ../src/probes.o
endif

K
Karel Zak 已提交
36
LDADDS = \
37
	$(STATIC_BINARIES) \
38 39
	$(LIBXML_LIBS) \
        $(GNUTLS_LIBS) \
40
        $(SASL_LIBS) \
41
        $(SELINUX_LIBS) \
J
Jamie Strandboge 已提交
42
        $(APPARMOR_LIBS) \
43
        $(YAJL_LIBS) \
44
        $(WARN_CFLAGS) \
45
	../src/libvirt_test.la \
46
	$(PROBES_O) \
47
	../gnulib/lib/libgnu.la \
J
John Levon 已提交
48
	$(LIBSOCKET) \
49
        $(COVERAGE_LDFLAGS)
K
Karel Zak 已提交
50

51
EXTRA_DIST =		\
52
	capabilityschemadata \
E
Eric Blake 已提交
53 54 55 56
	capabilityschematest \
	commanddata \
	confdata \
	cputestdata \
57
	domainschemadata \
E
Eric Blake 已提交
58 59 60 61
	domainschematest \
	domainsnapshotschematest \
	domainsnapshotxml2xmlin \
	domainsnapshotxml2xmlout \
62
	interfaceschemadata \
E
Eric Blake 已提交
63 64 65
	networkschematest \
	networkxml2xmlin \
	networkxml2xmlout \
66
	networkxml2argvdata \
E
Eric Blake 已提交
67 68 69 70 71 72 73 74 75 76
	nodedevschemadata \
	nodedevschematest \
	nodeinfodata     \
	nwfilterschematest \
	nwfilterxml2xmlin \
	nwfilterxml2xmlout \
	oomtrace.pl \
	qemuhelpdata \
	qemuxml2argvdata \
	qemuxml2xmloutdata \
P
Philipp Hahn 已提交
77
	qemuxmlnsdata \
E
Eric Blake 已提交
78 79
	schematestutils.sh \
	sexpr2xmldata \
80
	storagepoolschematest \
81
	storagepoolxml2xmlin \
E
Eric Blake 已提交
82
	storagepoolxml2xmlout \
83
	storagevolschematest \
84
	storagevolxml2xmlin \
E
Eric Blake 已提交
85 86
	storagevolxml2xmlout \
	test-lib.sh	\
87
	vmx2xmldata \
E
Eric Blake 已提交
88 89 90
	xencapsdata \
	xmconfigdata \
	xml2sexprdata \
91 92
	xml2vmxdata \
	.valgrind.supp
K
Karel Zak 已提交
93

94
check_PROGRAMS = virshtest conftest sockettest \
95
	nodeinfotest qparamtest virbuftest \
96
	commandtest commandhelper seclabeltest \
97
	virhashtest virnetmessagetest virnetsockettest ssh \
98 99
	utiltest virnettlscontexttest shunloadtest \
	virtimetest
100 101

check_LTLIBRARIES = libshunload.la
102 103 104 105

# This is a fake SSH we use from virnetsockettest
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
106

107
if WITH_XEN
108
check_PROGRAMS += xml2sexprtest sexpr2xmltest \
109
	xmconfigtest xencapstest statstest reconnect
110
endif
111
if WITH_QEMU
112
check_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
113 114
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
	qemumonitortest
115 116
endif

117 118 119 120
if WITH_OPENVZ
check_PROGRAMS += openvzutilstest
endif

121
if WITH_ESX
122 123 124 125 126
check_PROGRAMS += esxutilstest
endif

if WITH_VMX
check_PROGRAMS += vmx2xmltest xml2vmxtest
127 128
endif

129
if WITH_CIL
130
check_PROGRAMS += object-locking
131 132
endif

133 134 135 136
if HAVE_YAJL
check_PROGRAMS += jsontest
endif

137
check_PROGRAMS += networkxml2xmltest
138

139
if WITH_NETWORK
140
check_PROGRAMS += networkxml2argvtest
141
endif
142

143
check_PROGRAMS += nwfilterxml2xmltest
144

145
check_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest
146

147
check_PROGRAMS += nodedevxml2xmltest
M
Mark McLoughlin 已提交
148

149
check_PROGRAMS += interfacexml2xmltest
150

151 152
check_PROGRAMS += cputest

153 154
test_scripts = \
	capabilityschematest \
155
	interfaceschematest \
156 157 158 159
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
160
	nodedevschematest \
161 162
	nwfilterschematest \
	domainsnapshotschematest
163

A
Atsushi SAKAI 已提交
164
if WITH_LIBVIRTD
165 166 167 168 169 170
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
171 172
	libvirtd-fail			\
	libvirtd-pool			\
173 174 175 176 177 178
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
179
	virsh-optparse			\
180
	virsh-schedinfo			\
J
Jim Meyering 已提交
181
	virsh-synopsis
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
else
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	daemon-conf			\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	undefine			\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
	virsh-synopsis
A
Atsushi SAKAI 已提交
200
endif
201

J
Jamie Strandboge 已提交
202 203
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
204 205
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
206
endif
207

208 209
EXTRA_DIST += $(test_scripts)

210 211 212
TESTS = virshtest \
        nodeinfotest \
	qparamtest \
213
	virbuftest \
214
	sockettest \
215
	commandtest \
216
	seclabeltest \
217
	virhashtest \
218
	virnetmessagetest \
219
	virnetsockettest \
220
	virnettlscontexttest \
221
	virtimetest \
222
	shunloadtest \
M
Matthias Bolte 已提交
223
	utiltest \
224 225
	$(test_scripts)

226 227 228 229
if HAVE_YAJL
TESTS += jsontest
endif

230 231 232 233
if WITH_XEN
TESTS += xml2sexprtest \
	sexpr2xmltest \
	xmconfigtest \
234 235 236
	xencapstest \
	reconnect \
	statstest
237
endif
238

239
if WITH_QEMU
240
TESTS += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest qemuargv2xmltest \
241 242
	 qemuhelptest domainsnapshotxml2xmltest nwfilterxml2xmltest \
	 qemumonitortest
243
endif
K
Karel Zak 已提交
244

245 246 247 248
if WITH_OPENVZ
TESTS += openvzutilstest
endif

249
if WITH_ESX
250 251 252 253 254
TESTS += esxutilstest
endif

if WITH_VMX
TESTS += vmx2xmltest xml2vmxtest
255 256
endif

257
if WITH_LIBVIRTD
258
check_PROGRAMS += eventtest
259 260 261
TESTS += eventtest
endif

262 263
TESTS += networkxml2xmltest

264
if WITH_NETWORK
265
TESTS += networkxml2argvtest
266
endif
267

268
TESTS += storagevolxml2xmltest storagepoolxml2xmltest
269

M
Mark McLoughlin 已提交
270 271
TESTS += nodedevxml2xmltest

272 273
TESTS += interfacexml2xmltest

274 275
TESTS += cputest

276
# NB, automake < 1.10 does not provide the real
277
# abs_top_{src/build}dir or builddir variables, so don't rely
278
# on them here. Fake them with 'pwd'
279 280 281 282 283 284
# Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an
# intermediate shell variable, but must do all the expansion in make

lv_abs_top_builddir=`cd '$(top_builddir)'; pwd`
path_add = $(lv_abs_top_builddir)/daemon$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tools$(PATH_SEPARATOR)$(lv_abs_top_builddir)/tests

285
TESTS_ENVIRONMENT =				\
286
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
287
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
288
  abs_builddir=`pwd`				\
289
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
290
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
291
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
292
  SHELL="$(SHELL)"				\
293
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
294
  LC_ALL=C					\
295 296
  $(VG)

297
valgrind:
298
	$(MAKE) check VG="valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
299

300 301 302 303 304
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)

305
if WITH_XEN
306
xml2sexprtest_SOURCES = \
307
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
308
	testutils.c testutils.h
309
xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
310 311

sexpr2xmltest_SOURCES = \
312
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
313
	testutils.c testutils.h
314
sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
315

316
xmconfigtest_SOURCES = \
317
	xmconfigtest.c testutilsxen.c testutilsxen.h \
318
	testutils.c testutils.h
319
xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
320

321 322 323 324 325
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

reconnect_SOURCES = \
326
	reconnect.c testutils.h testutils.c
327 328
reconnect_LDADD = $(LDADDS)

329 330 331 332
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)

333 334 335 336 337 338
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

339
if WITH_QEMU
340 341 342 343 344 345 346

qemu_LDADDS = ../src/libvirt_driver_qemu.la

if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network.la
endif

347
qemuxml2argvtest_SOURCES = \
348
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
349
	testutils.c testutils.h
350
qemuxml2argvtest_LDADD = $(qemu_LDADDS)  $(LDADDS)
351 352

qemuxml2xmltest_SOURCES = \
353
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
354
	testutils.c testutils.h
355
qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
356

P
Philipp Hahn 已提交
357 358 359 360 361
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
qemuxmlnstest_LDADD = $(qemu_LDADDS)  $(LDADDS)

362 363 364
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
365
qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
366 367

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
368
qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
369

370 371 372
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
qemumonitortest_LDADD = $(qemu_LDADDS) $(LDADDS)

373 374 375 376
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
377
else
378 379
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
380
	qemumonitortest.c testutilsqemu.c testutilsqemu.h
381
endif
382

383 384 385 386 387 388 389 390 391 392
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
openvzutilstest_LDADD = ../src/libvirt_driver_openvz.la $(LDADDS)
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

393 394 395 396 397
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
398 399 400
else
EXTRA_DIST += esxutilstest.c
endif
401

402
if WITH_VMX
403 404 405
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
406
vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
407 408 409 410

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
411
xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
412
else
413
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
414 415
endif

416 417 418 419 420
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

421
if WITH_NETWORK
422 423 424 425
networkxml2argvtest_SOURCES = \
	networkxml2argvtest.c \
	testutils.c testutils.h
networkxml2argvtest_LDADD = ../src/libvirt_driver_network.la $(LDADDS)
426 427 428
else
EXTRA_DIST += networkxml2argvtest.c
endif
429

430 431 432 433 434
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)

435 436 437 438 439
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

440 441 442 443 444
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
445 446 447
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
448
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
449

450 451 452 453 454
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

455 456 457 458 459
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

460 461 462 463 464
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

D
Daniel Veillard 已提交
465 466 467 468
conftest_SOURCES = \
	conftest.c
conftest_LDADD = $(LDADDS)

469 470 471 472
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

473 474
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
E
Eric Blake 已提交
475
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
476 477 478 479
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
E
Eric Blake 已提交
480
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
481 482
commandhelper_LDADD = $(LDADDS)

483 484
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
E
Eric Blake 已提交
485
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
486 487
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

488 489
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
E
Eric Blake 已提交
490
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
491 492
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

493
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
494
	virnettlscontexttest.c testutils.h testutils.c
495
virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
E
Eric Blake 已提交
496 497 498 499 500 501 502
virnettlscontexttest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
503

504 505 506 507 508
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
virtimetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virtimetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)

509

510 511 512
seclabeltest_SOURCES = \
	seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
J
Jamie Strandboge 已提交
513

514 515 516 517
qparamtest_SOURCES = \
	qparamtest.c testutils.h testutils.c
qparamtest_LDADD = $(LDADDS)

518 519 520 521
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

522 523 524
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
525

526
jsontest_SOURCES = \
527
	jsontest.c testutils.h testutils.c
528 529
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
530 531 532 533
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

534 535
if WITH_LIBVIRTD
eventtest_SOURCES = \
536
	eventtest.c testutils.h testutils.c
537 538 539
eventtest_LDADD = -lrt $(LDADDS)
endif

540 541 542 543 544 545 546 547 548
libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
libshunload_la_LDFLAGS = -module -avoid-version -rpath /evil/libtool/hack/to/force/shared/lib/creation

shunloadtest_SOURCES = \
	shunloadtest.c
shunloadtest_LDADD = -lpthread
shunloadtest_DEPENDENCIES = libshunload.la

549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
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

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