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