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

E
Eric Blake 已提交
3
## Copyright (C) 2005-2013 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
	-I$(top_builddir) -I$(top_srcdir) \
10 11 12
	-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 \
13
	-I$(top_srcdir)/src/util \
14 15
	-I$(top_srcdir)/src/conf \
	$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
16 17

AM_CFLAGS = \
18
	-Dabs_builddir="\"`pwd`\"" \
19 20
	$(LIBXML_CFLAGS) \
	$(GNUTLS_CFLAGS) \
21
	$(SASL_CFLAGS) \
22
	$(SELINUX_CFLAGS) \
J
Jamie Strandboge 已提交
23
	$(APPARMOR_CFLAGS) \
24
	$(YAJL_CFLAGS) \
E
Eric Blake 已提交
25 26
	$(COVERAGE_CFLAGS) \
	$(WARN_CFLAGS)
27

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

33
PROBES_O =
34
if WITH_DTRACE_PROBES
35
PROBES_O += ../src/libvirt_probes.lo
36 37
endif

K
Karel Zak 已提交
38
LDADDS = \
39
        $(WARN_CFLAGS) \
40
	$(PROBES_O) \
41 42
	../src/libvirt.la \
	../gnulib/lib/libgnu.la
K
Karel Zak 已提交
43

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

G
Gene Czarcinski 已提交
91
test_helpers = commandhelper ssh test_conf
92
test_programs = virshtest sockettest \
E
Eric Blake 已提交
93
	nodeinfotest virbuftest \
94 95
	commandtest seclabeltest \
	virhashtest virnetmessagetest virnetsockettest \
96
	viratomictest \
97
	utiltest shunloadtest \
98
	virtimetest viruritest virkeyfiletest \
H
Hu Tao 已提交
99
	virauthconfigtest \
E
Eric Blake 已提交
100
	virbitmaptest virendiantest \
101
	viridentitytest \
102
	virlockspacetest \
103
	virstringtest \
D
Daniel P. Berrange 已提交
104
        virportallocatortest \
V
Viktor Mihajlovski 已提交
105
	sysinfotest \
106
	virstoragetest \
107
	$(NULL)
108

109
if WITH_GNUTLS
110 111 112
test_programs += virnettlscontexttest
endif

113 114
if WITH_SECDRIVER_SELINUX
test_programs += securityselinuxtest
115
if WITH_QEMU
116 117 118
if WITH_ATTR
test_programs += securityselinuxlabeltest
endif
119
endif
120
endif
121

122 123 124 125
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

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

130
if WITH_XEN
131
test_programs += xml2sexprtest sexpr2xmltest \
132
	xmconfigtest xencapstest statstest reconnect
133
endif
134
if WITH_QEMU
135
test_programs += qemuxml2argvtest qemuxml2xmltest qemuxmlnstest \
136
	qemuargv2xmltest qemuhelptest domainsnapshotxml2xmltest \
137
	qemumonitortest qemumonitorjsontest
138 139
endif

140
if WITH_LXC
141
test_programs += lxcxml2xmltest
142 143
endif

144
if WITH_OPENVZ
145
test_programs += openvzutilstest
146 147
endif

148
if WITH_ESX
149
test_programs += esxutilstest
150 151 152
endif

if WITH_VMX
153
test_programs += vmx2xmltest xml2vmxtest
154 155
endif

156
if WITH_CIL
157
test_programs += object-locking
158 159
endif

160
if WITH_YAJL
161
test_programs += jsontest
162 163
endif

164
test_programs += networkxml2xmltest
165

166
if WITH_NETWORK
167
test_programs += networkxml2conftest
168
endif
169

170 171 172 173
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

174
test_programs += nwfilterxml2xmltest
175

176 177
test_programs += storagevolxml2argvtest

178
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
179

180
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
181

182
test_programs += interfacexml2xmltest
183

184
test_programs += cputest
185

186 187
test_scripts = \
	capabilityschematest \
188
	interfaceschematest \
189 190 191 192
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
193
	nodedevschematest \
194 195
	nwfilterschematest \
	domainsnapshotschematest
196

A
Atsushi SAKAI 已提交
197
if WITH_LIBVIRTD
198 199 200 201 202
test_scripts +=				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
J
Jim Meyering 已提交
203 204
	libvirtd-fail			\
	libvirtd-pool			\
205 206 207 208 209
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
210
	virsh-optparse			\
211
	virsh-schedinfo			\
212 213 214
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
215

216 217 218
test_programs += 			\
	eventtest			\
	libvirtdconftest
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
else
EXTRA_DIST += 				\
	test_conf.sh			\
	cpuset				\
	define-dev-segfault		\
	int-overflow			\
	libvirtd-fail			\
	libvirtd-pool			\
	read-bufsiz			\
	read-non-seekable		\
	start				\
	vcpupin				\
	virsh-all			\
	virsh-optparse			\
	virsh-schedinfo			\
234 235 236
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
237
endif
238

J
Jamie Strandboge 已提交
239 240
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
241 242
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
243
endif
244

245 246
EXTRA_DIST += $(test_scripts)

D
Daniel P. Berrange 已提交
247 248 249
test_libraries = libshunload.la \
		libvirportallocatormock.la \
		$(NULL)
250 251 252 253
if WITH_QEMU
test_libraries += libqemumonitortestutils.la
endif

254 255
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
256
noinst_LTLIBRARIES = $(test_libraries)
257 258
else
check_PROGRAMS = $(test_programs) $(test_helpers)
259
check_LTLIBRARIES = $(test_libraries)
260
endif
261

262 263
TESTS = $(test_programs) \
	$(test_scripts)
264

265
# NB, automake < 1.10 does not provide the real
266
# abs_top_{src/build}dir or builddir variables, so don't rely
267
# on them here. Fake them with 'pwd'
268 269 270 271 272 273
# 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

274
TESTS_ENVIRONMENT =				\
275
  abs_top_builddir=$(lv_abs_top_builddir)	\
J
Jim Meyering 已提交
276
  abs_top_srcdir=`cd '$(top_srcdir)'; pwd`	\
277
  abs_builddir=`pwd`				\
278
  abs_srcdir=`cd '$(srcdir)'; pwd`		\
279
  CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h"	\
J
Jim Meyering 已提交
280
  PATH="$(path_add)$(PATH_SEPARATOR)$$PATH"	\
281
  SHELL="$(SHELL)"				\
282
  LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \
283
  LIBVIRT_AUTOSTART=0				\
284
  LC_ALL=C					\
285 286
  $(VG)

287

288
valgrind:
289
	$(MAKE) check VG="libtool --mode=execute valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
290

291 292 293
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
294
sockettest_LDADD = $(LDADDS)
295

296
if WITH_XEN
E
Eric Blake 已提交
297
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
298 299
xen_LDADDS += $(LDADDS)

300
xml2sexprtest_SOURCES = \
301
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
302
	testutils.c testutils.h
303
xml2sexprtest_LDADD = $(xen_LDADDS)
304 305

sexpr2xmltest_SOURCES = \
306
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
307
	testutils.c testutils.h
308
sexpr2xmltest_LDADD = $(xen_LDADDS)
309

310
xmconfigtest_SOURCES = \
311
	xmconfigtest.c testutilsxen.c testutilsxen.h \
312
	testutils.c testutils.h
313
xmconfigtest_LDADD = $(xen_LDADDS)
314

315 316
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
317
xencapstest_LDADD = $(xen_LDADDS)
318 319

reconnect_SOURCES = \
320
	reconnect.c testutils.h testutils.c
321 322
reconnect_LDADD = $(LDADDS)

323 324
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
325
statstest_LDADD = $(xen_LDADDS)
326

327 328 329 330 331 332
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

333 334 335 336 337
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

338
if WITH_QEMU
339

340 341
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

342
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
343
if WITH_NETWORK
E
Eric Blake 已提交
344
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
345
endif
346
if WITH_DTRACE_PROBES
347
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
348
endif
349
qemu_LDADDS += $(LDADDS)
350

351
qemuxml2argvtest_SOURCES = \
352
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
353
	testutils.c testutils.h
354
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
355 356

qemuxml2xmltest_SOURCES = \
357
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
358
	testutils.c testutils.h
359
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
360

P
Philipp Hahn 已提交
361 362 363
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
364
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
365

366 367 368
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
369
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
370 371

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
372
qemuhelptest_LDADD = $(qemu_LDADDS)
373

374
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
375
qemumonitortest_LDADD = $(qemu_LDADDS)
376

377 378 379 380 381 382 383
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

384 385 386
domainsnapshotxml2xmltest_SOURCES = \
	domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
387
domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
388
else
389 390
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
	qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
391
	qemumonitortest.c testutilsqemu.c testutilsqemu.h \
392
	qemumonitorjsontest.c \
393
	$(QEMUMONITORTESTUTILS_SOURCES)
394
endif
395

396 397
if WITH_LXC

E
Eric Blake 已提交
398
lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
399
if WITH_NETWORK
E
Eric Blake 已提交
400
lxc_LDADDS += ../src/libvirt_driver_network_impl.la
401 402
endif
lxc_LDADDS += $(LDADDS)
403 404 405 406

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
407
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
408 409 410 411
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

412 413 414 415
if WITH_OPENVZ
openvzutilstest_SOURCES = \
	openvzutilstest.c \
	testutils.c testutils.h
416
openvzutilstest_LDADD = $(LDADDS)
417 418 419 420 421
else
EXTRA_DIST += openvzutilstest.c
endif
EXTRA_DIST += openvzutilstest.conf

422 423 424 425
if WITH_ESX
esxutilstest_SOURCES = \
	esxutilstest.c \
	testutils.c testutils.h
426
esxutilstest_LDADD = $(LDADDS)
427 428 429
else
EXTRA_DIST += esxutilstest.c
endif
430

431
if WITH_VMX
432 433 434
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
435
vmx2xmltest_LDADD = $(LDADDS)
436 437 438 439

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
440
xml2vmxtest_LDADD = $(LDADDS)
441
else
442
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
443 444
endif

445 446 447 448 449
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

450
if WITH_NETWORK
451 452
networkxml2conftest_SOURCES = \
	networkxml2conftest.c \
453
	testutils.c testutils.h
454
networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS)
455
else
456
EXTRA_DIST += networkxml2conftest.c
457
endif
458

459 460 461 462
if WITH_STORAGE_SHEEPDOG
storagebackendsheepdogtest_SOURCES = \
	storagebackendsheepdogtest.c \
	testutils.c testutils.h
463 464
storagebackendsheepdogtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
465 466 467 468
else
EXTRA_DIST += storagebackendsheepdogtest.c
endif

469 470 471 472
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
473 474 475 476 477 478

storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
479

480 481 482 483 484
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

485 486 487 488 489
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
490 491 492
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
493
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
494

495 496 497 498 499
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

500 501 502 503 504
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

505 506 507 508 509
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
510 511 512
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
513

514 515 516 517
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

518 519 520 521 522 523 524
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
525
commandhelper_LDFLAGS = -static
526

527 528 529 530 531 532 533 534 535
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

536 537
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
538
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
539
virnetmessagetest_LDADD = $(LDADDS)
540

541 542
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
543
virnetsockettest_LDADD = $(LDADDS)
544

545
if WITH_GNUTLS
546
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
547
	virnettlscontexttest.c testutils.h testutils.c
548
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
549 550 551 552 553 554
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
555 556 557 558
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
559

560 561
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
562
virtimetest_LDADD = $(LDADDS)
563

564 565 566 567
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

568 569 570 571
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

572 573 574 575
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

576 577 578 579
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
580 581 582 583 584 585 586 587 588 589 590
virportallocatortest_SOURCES = \
	virportallocatortest.c testutils.h testutils.c
virportallocatortest_LDADD = $(LDADDS)

libvirportallocatormock_la_SOURCES = \
	virportallocatortest.c
libvirportallocatormock_la_CFLAGS = $(AM_CFLAGS) -DMOCK_HELPER=1
libvirportallocatormock_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation


591 592
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
593
viruritest_LDADD = $(LDADDS)
594

595 596
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
597
virkeyfiletest_LDADD = $(LDADDS)
598

599 600
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
601
virauthconfigtest_LDADD = $(LDADDS)
602

603 604
seclabeltest_SOURCES = \
	seclabeltest.c
605
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
606

607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
if WITH_SECDRIVER_SELINUX
if WITH_TESTS
noinst_LTLIBRARIES += libsecurityselinuxhelper.la
else
check_LTLIBRARIES += libsecurityselinuxhelper.la
endif

libsecurityselinuxhelper_la_SOURCES = \
	securityselinuxhelper.c
libsecurityselinuxhelper_la_LDFLAGS = -module -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation

securityselinuxtest_SOURCES = \
	securityselinuxtest.c testutils.h testutils.c
securityselinuxtest_LDADD = $(LDADDS)
622 623 624 625 626 627 628 629 630 631 632
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la

if WITH_QEMU
if WITH_ATTR
securityselinuxlabeltest_SOURCES = \
	securityselinuxlabeltest.c testutils.h testutils.c \
        testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la ../src/libvirt.la
endif
endif
633
endif
634
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
635

636 637 638 639
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

640 641 642
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
643

644
viratomictest_SOURCES = \
L
Laine Stump 已提交
645
	viratomictest.c testutils.h testutils.c
646 647
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
648 649 650 651
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
652 653 654 655
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

656
jsontest_SOURCES = \
657
	jsontest.c testutils.h testutils.c
658 659
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
660 661 662 663
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

664 665 666 667 668 669
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

670 671
if WITH_LIBVIRTD
eventtest_SOURCES = \
672
	eventtest.c testutils.h testutils.c
673 674 675
eventtest_LDADD = -lrt $(LDADDS)
endif

676 677 678 679 680 681
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
682
shunloadtest_LDADD = $(LIB_PTHREAD)
683 684
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
685 686 687 688
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709
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

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