Makefile.am 16.7 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
	virkeycodetest \
103
	virlockspacetest \
104
	virstringtest \
D
Daniel P. Berrange 已提交
105
        virportallocatortest \
V
Viktor Mihajlovski 已提交
106
	sysinfotest \
107
	virstoragetest \
108
	$(NULL)
109

110
if WITH_GNUTLS
111 112 113
test_programs += virnettlscontexttest
endif

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

123 124 125 126
if WITH_DRIVER_MODULES
test_programs += virdrivermoduletest
endif

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

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

141
if WITH_LXC
142
test_programs += lxcxml2xmltest
143 144
endif

145
if WITH_OPENVZ
146
test_programs += openvzutilstest
147 148
endif

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

if WITH_VMX
154
test_programs += vmx2xmltest xml2vmxtest
155 156
endif

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

161
if WITH_YAJL
162
test_programs += jsontest
163 164
endif

165
test_programs += networkxml2xmltest
166

167
if WITH_NETWORK
168
test_programs += networkxml2conftest
169
endif
170

171 172 173 174
if WITH_STORAGE_SHEEPDOG
test_programs += storagebackendsheepdogtest
endif

175
test_programs += nwfilterxml2xmltest
176

177
if WITH_STORAGE
178
test_programs += storagevolxml2argvtest
179
endif
180

181
test_programs += storagevolxml2xmltest storagepoolxml2xmltest
182

183
test_programs += nodedevxml2xmltest
M
Mark McLoughlin 已提交
184

185
test_programs += interfacexml2xmltest
186

187
test_programs += cputest
188

189 190
test_scripts = \
	capabilityschematest \
191
	interfaceschematest \
192 193 194 195
	networkschematest \
	storagepoolschematest \
	storagevolschematest \
	domainschematest \
196
	nodedevschematest \
197 198
	nwfilterschematest \
	domainsnapshotschematest
199

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

219 220 221
test_programs += 			\
	eventtest			\
	libvirtdconftest
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
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			\
237 238 239
	virsh-synopsis			\
	virsh-undefine			\
	$(NULL)
A
Atsushi SAKAI 已提交
240
endif
241

J
Jamie Strandboge 已提交
242 243
if WITH_SECDRIVER_APPARMOR
test_scripts += virt-aa-helper-test
244 245
else
EXTRA_DIST += virt-aa-helper-test
J
Jamie Strandboge 已提交
246
endif
247

248 249
EXTRA_DIST += $(test_scripts)

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

257 258
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
259
noinst_LTLIBRARIES = $(test_libraries)
260 261
else
check_PROGRAMS = $(test_programs) $(test_helpers)
262
check_LTLIBRARIES = $(test_libraries)
263
endif
264

265 266
TESTS = $(test_programs) \
	$(test_scripts)
267

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

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

290

291
valgrind:
292
	$(MAKE) check VG="libtool --mode=execute valgrind --quiet --leak-check=full --suppressions=$(srcdir)/.valgrind.supp"
293

294 295 296
sockettest_SOURCES = \
	sockettest.c \
	testutils.c testutils.h
297
sockettest_LDADD = $(LDADDS)
298

299
if WITH_XEN
E
Eric Blake 已提交
300
xen_LDADDS = ../src/libvirt_driver_xen_impl.la
301 302
xen_LDADDS += $(LDADDS)

303
xml2sexprtest_SOURCES = \
304
	xml2sexprtest.c testutilsxen.c testutilsxen.h \
305
	testutils.c testutils.h
306
xml2sexprtest_LDADD = $(xen_LDADDS)
307 308

sexpr2xmltest_SOURCES = \
309
	sexpr2xmltest.c testutilsxen.c testutilsxen.h \
310
	testutils.c testutils.h
311
sexpr2xmltest_LDADD = $(xen_LDADDS)
312

313
xmconfigtest_SOURCES = \
314
	xmconfigtest.c testutilsxen.c testutilsxen.h \
315
	testutils.c testutils.h
316
xmconfigtest_LDADD = $(xen_LDADDS)
317

318 319
xencapstest_SOURCES = \
	xencapstest.c testutils.h testutils.c
320
xencapstest_LDADD = $(xen_LDADDS)
321 322

reconnect_SOURCES = \
323
	reconnect.c testutils.h testutils.c
324 325
reconnect_LDADD = $(LDADDS)

326 327
statstest_SOURCES = \
	statstest.c testutils.h testutils.c
328
statstest_LDADD = $(xen_LDADDS)
329

330 331 332 333 334 335
else
EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
	xencapstest.c reconnect.c \
	testutilsxen.c testutilsxen.h
endif

336 337 338 339 340
QEMUMONITORTESTUTILS_SOURCES = \
	qemumonitortestutils.c \
	qemumonitortestutils.h \
	$(NULL)

341
if WITH_QEMU
342

343 344
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)

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

354
qemuxml2argvtest_SOURCES = \
355
	qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
356
	testutils.c testutils.h
357
qemuxml2argvtest_LDADD = $(qemu_LDADDS)
358 359

qemuxml2xmltest_SOURCES = \
360
	qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
361
	testutils.c testutils.h
362
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
363

P
Philipp Hahn 已提交
364 365 366
qemuxmlnstest_SOURCES = \
	qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
367
qemuxmlnstest_LDADD = $(qemu_LDADDS)
P
Philipp Hahn 已提交
368

369 370 371
qemuargv2xmltest_SOURCES = \
	qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
	testutils.c testutils.h
372
qemuargv2xmltest_LDADD = $(qemu_LDADDS)
373 374

qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
375
qemuhelptest_LDADD = $(qemu_LDADDS)
376

377
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
378
qemumonitortest_LDADD = $(qemu_LDADDS)
379

380 381 382 383 384 385 386
qemumonitorjsontest_SOURCES = \
	qemumonitorjsontest.c \
	testutils.c testutils.h \
	testutilsqemu.c testutilsqemu.h \
	$(NULL)
qemumonitorjsontest_LDADD = $(qemu_LDADDS) libqemumonitortestutils.la

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

399 400
if WITH_LXC

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

lxcxml2xmltest_SOURCES = \
	lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
	testutils.c testutils.h
410
lxcxml2xmltest_LDADD = $(lxc_LDADDS)
411 412 413 414
else
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
endif

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

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

434
if WITH_VMX
435 436 437
vmx2xmltest_SOURCES = \
	vmx2xmltest.c \
	testutils.c testutils.h
438
vmx2xmltest_LDADD = $(LDADDS)
439 440 441 442

xml2vmxtest_SOURCES = \
	xml2vmxtest.c \
	testutils.c testutils.h
443
xml2vmxtest_LDADD = $(LDADDS)
444
else
445
EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
446 447
endif

448 449 450 451 452
networkxml2xmltest_SOURCES = \
	networkxml2xmltest.c \
	testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

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

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

472 473 474 475
nwfilterxml2xmltest_SOURCES = \
	nwfilterxml2xmltest.c \
	testutils.c testutils.h
nwfilterxml2xmltest_LDADD = $(LDADDS)
476

477
if WITH_STORAGE
478 479 480 481 482
storagevolxml2argvtest_SOURCES = \
    storagevolxml2argvtest.c \
    testutils.c testutils.h
storagevolxml2argvtest_LDADD = \
	../src/libvirt_driver_storage_impl.la $(LDADDS)
483 484 485
else
EXTRA_DIST += storagevolxml2argvtest.c
endif
486

487 488 489 490 491
storagevolxml2xmltest_SOURCES = \
	storagevolxml2xmltest.c \
	testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

492 493 494 495 496
storagepoolxml2xmltest_SOURCES = \
	storagepoolxml2xmltest.c \
	testutils.c testutils.h
storagepoolxml2xmltest_LDADD = $(LDADDS)

M
Mark McLoughlin 已提交
497 498 499
nodedevxml2xmltest_SOURCES = \
	nodedevxml2xmltest.c \
	testutils.c testutils.h
500
nodedevxml2xmltest_LDADD = $(LDADDS)
M
Mark McLoughlin 已提交
501

502 503 504 505 506
interfacexml2xmltest_SOURCES = \
	interfacexml2xmltest.c \
	testutils.c testutils.h
interfacexml2xmltest_LDADD = $(LDADDS)

507 508 509 510 511
cputest_SOURCES = \
	cputest.c \
	testutils.c testutils.h
cputest_LDADD = $(LDADDS)

512 513 514 515 516
virshtest_SOURCES = \
	virshtest.c \
	testutils.c testutils.h
virshtest_LDADD = $(LDADDS)

G
Gene Czarcinski 已提交
517 518 519
test_conf_SOURCES = \
	test_conf.c
test_conf_LDADD = $(LDADDS)
D
Daniel Veillard 已提交
520

521 522 523 524
nodeinfotest_SOURCES = \
	nodeinfotest.c testutils.h testutils.c
nodeinfotest_LDADD = $(LDADDS)

525 526 527 528 529 530 531
commandtest_SOURCES = \
	commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)

commandhelper_SOURCES = \
	commandhelper.c
commandhelper_LDADD = $(LDADDS)
532
commandhelper_LDFLAGS = -static
533

534 535 536 537 538 539 540 541 542
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
	libvirtdconftest.c testutils.h testutils.c \
	../daemon/libvirtd-config.c
libvirtdconftest_LDADD = $(LDADDS)
else
EXTRA_DIST += libvirtdconftest.c
endif

543 544
virnetmessagetest_SOURCES = \
	virnetmessagetest.c testutils.h testutils.c
545
virnetmessagetest_CFLAGS = $(XDR_CFLAGS) $(AM_CFLAGS)
546
virnetmessagetest_LDADD = $(LDADDS)
547

548 549
virnetsockettest_SOURCES = \
	virnetsockettest.c testutils.h testutils.c
550
virnetsockettest_LDADD = $(LDADDS)
551

552
if WITH_GNUTLS
553
virnettlscontexttest_SOURCES = \
E
Eric Blake 已提交
554
	virnettlscontexttest.c testutils.h testutils.c
555
virnettlscontexttest_LDADD = $(LDADDS)
E
Eric Blake 已提交
556 557 558 559 560 561
if HAVE_LIBTASN1
virnettlscontexttest_SOURCES += pkix_asn1_tab.c
virnettlscontexttest_LDADD += -ltasn1
else
EXTRA_DIST += pkix_asn1_tab.c
endif
562 563 564 565
else
EXTRA_DIST += \
	virnettlscontexttest.c testutils.h testutils.c pkix_asn1_tab.c
endif
566

567 568
virtimetest_SOURCES = \
	virtimetest.c testutils.h testutils.c
569
virtimetest_LDADD = $(LDADDS)
570

571 572 573 574
virstringtest_SOURCES = \
	virstringtest.c testutils.h testutils.c
virstringtest_LDADD = $(LDADDS)

575 576 577 578
virstoragetest_SOURCES = \
	virstoragetest.c testutils.h testutils.c
virstoragetest_LDADD = $(LDADDS)

579 580 581 582
viridentitytest_SOURCES = \
	viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)

583 584 585 586
virkeycodetest_SOURCES = \
	virkeycodetest.c testutils.h testutils.c
virkeycodetest_LDADD = $(LDADDS)

587 588 589 590
virlockspacetest_SOURCES = \
	virlockspacetest.c testutils.h testutils.c
virlockspacetest_LDADD = $(LDADDS)

D
Daniel P. Berrange 已提交
591 592 593 594 595 596 597 598 599 600 601
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


602 603
viruritest_SOURCES = \
	viruritest.c testutils.h testutils.c
604
viruritest_LDADD = $(LDADDS)
605

606 607
virkeyfiletest_SOURCES = \
	virkeyfiletest.c testutils.h testutils.c
608
virkeyfiletest_LDADD = $(LDADDS)
609

610 611
virauthconfigtest_SOURCES = \
	virauthconfigtest.c testutils.h testutils.c
612
virauthconfigtest_LDADD = $(LDADDS)
613

614 615
seclabeltest_SOURCES = \
	seclabeltest.c
616
seclabeltest_LDADD = $(LDADDS)
J
Jamie Strandboge 已提交
617

618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
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)
633 634 635 636 637 638 639 640 641 642 643
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
644
endif
645
EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c securityselinuxhelper.c
646

647 648 649 650
virbuftest_SOURCES = \
	virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)

651 652 653
virhashtest_SOURCES = \
	virhashtest.c virhashdata.h testutils.h testutils.c
virhashtest_LDADD = $(LDADDS)
654

655
viratomictest_SOURCES = \
L
Laine Stump 已提交
656
	viratomictest.c testutils.h testutils.c
657 658
viratomictest_LDADD = $(LDADDS)

H
Hu Tao 已提交
659 660 661 662
virbitmaptest_SOURCES = \
	virbitmaptest.c testutils.h testutils.c
virbitmaptest_LDADD = $(LDADDS)

E
Eric Blake 已提交
663 664 665 666
virendiantest_SOURCES = \
	virendiantest.c testutils.h testutils.c
virendiantest_LDADD = $(LDADDS)

667
jsontest_SOURCES = \
668
	jsontest.c testutils.h testutils.c
669 670
jsontest_LDADD = $(LDADDS)

M
Matthias Bolte 已提交
671 672 673 674
utiltest_SOURCES = \
	utiltest.c testutils.h testutils.c
utiltest_LDADD = $(LDADDS)

675 676 677 678 679 680
if WITH_DRIVER_MODULES
virdrivermoduletest_SOURCES = \
	virdrivermoduletest.c testutils.h testutils.c
virdrivermoduletest_LDADD = $(LDADDS)
endif

681 682
if WITH_LIBVIRTD
eventtest_SOURCES = \
683
	eventtest.c testutils.h testutils.c
684 685 686
eventtest_LDADD = -lrt $(LDADDS)
endif

687 688 689 690 691 692
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
693
shunloadtest_LDADD = $(LIB_PTHREAD)
694 695
shunloadtest_DEPENDENCIES = libshunload.la

V
Viktor Mihajlovski 已提交
696 697 698 699
sysinfotest_SOURCES = \
	sysinfotest.c testutils.h testutils.c
sysinfotest_LDADD = $(LDADDS)

700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720
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

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