Statistics
| Branch: | Revision:

root / tests / Makefile @ 2792c4f2

History | View | Annotate | Download (1.2 kB)

1 7d13299d bellard
include ../config.mak
2 7d13299d bellard
3 4d1135e4 bellard
CFLAGS=-Wall -O2 -g
4 4d1135e4 bellard
LDFLAGS=
5 4d1135e4 bellard
6 7d13299d bellard
ifeq ($(ARCH),i386)
7 c3c7c292 bellard
TESTS=testclone testsig testthread sha1-i386 test-i386 runcom
8 7d13299d bellard
endif
9 7fb9a24e bellard
TESTS+=sha1 test_path
10 367e86e8 bellard
11 3ef693a0 bellard
QEMU=../qemu
12 4d1135e4 bellard
13 4d1135e4 bellard
all: $(TESTS)
14 4d1135e4 bellard
15 4d1135e4 bellard
hello: hello.c
16 4d1135e4 bellard
	$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
17 04369ff2 bellard
	strip hello
18 4d1135e4 bellard
19 1b6b029e bellard
testclone: testclone.c
20 4d1135e4 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
21 4d1135e4 bellard
22 1b6b029e bellard
testsig: testsig.c
23 1b6b029e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
24 1b6b029e bellard
25 1b6b029e bellard
testthread: testthread.c
26 1b6b029e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
27 1b6b029e bellard
28 7fb9a24e bellard
test_path: test_path.c
29 7fb9a24e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
30 7fb9a24e bellard
	./$@ || { rm $@; exit 1; }
31 7fb9a24e bellard
32 04369ff2 bellard
# i386 emulation test (test various opcodes) */
33 e5918247 bellard
test-i386: test-i386.c test-i386-code16.S \
34 e5918247 bellard
           test-i386.h test-i386-shift.h test-i386-muldiv.h
35 3c51961e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ test-i386.c test-i386-code16.S -lm
36 4d1135e4 bellard
37 4d1135e4 bellard
test: test-i386
38 04369ff2 bellard
ifeq ($(ARCH),i386)
39 4d1135e4 bellard
	./test-i386 > test-i386.ref
40 04369ff2 bellard
endif
41 3ef693a0 bellard
	$(QEMU) test-i386 > test-i386.out
42 4d1135e4 bellard
	@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
43 4d1135e4 bellard
44 4d1135e4 bellard
# speed test
45 04369ff2 bellard
sha1-i386: sha1.c
46 4d1135e4 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
47 4d1135e4 bellard
48 04369ff2 bellard
sha1: sha1.c
49 04369ff2 bellard
	$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
50 04369ff2 bellard
51 04369ff2 bellard
speed: sha1 sha1-i386
52 4d1135e4 bellard
	time ./sha1
53 3ef693a0 bellard
	time $(QEMU) ./sha1-i386
54 4d1135e4 bellard
55 c3c7c292 bellard
# vm86 test
56 c3c7c292 bellard
runcom: runcom.c
57 c3c7c292 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
58 c3c7c292 bellard
59 7d13299d bellard
clean:
60 7d13299d bellard
	rm -f *~ *.o $(TESTS)