update
[qemu/qemu_0_9_1_stable.git] / tests / Makefile
blob4cfe7912ec93962d0dee5c7fadf8985e0ceacb9b
1 include ../config-host.mak
3 CFLAGS=-Wall -O2 -g
4 LDFLAGS=
6 ifeq ($(ARCH),i386)
7 TESTS=linux-test testthread sha1-i386 test-i386 runcom
8 endif
9 TESTS+=sha1# test_path
10 #TESTS+=test_path
12 QEMU=../i386-user/qemu-i386
14 all: $(TESTS)
16 hello-i386: hello-i386.c
17 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
18 strip $@
20 testthread: testthread.c
21 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
23 test_path: test_path.c
24 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
25 ./$@ || { rm $@; exit 1; }
27 # i386 emulation test (test various opcodes) */
28 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
29 test-i386.h test-i386-shift.h test-i386-muldiv.h
30 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c \
31 test-i386-code16.S test-i386-vm86.S -lm
33 ifeq ($(ARCH),i386)
34 test: test-i386
35 ./test-i386 > test-i386.ref
36 else
37 test:
38 endif
39 $(QEMU) test-i386 > test-i386.out
40 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
42 # generic Linux and CPU test
43 linux-test: linux-test.c
44 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
46 # speed test
47 sha1-i386: sha1.c
48 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
50 sha1: sha1.c
51 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
53 speed: sha1 sha1-i386
54 time ./sha1
55 time $(QEMU) ./sha1-i386
57 # vm86 test
58 runcom: runcom.c
59 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
61 # arm test
62 hello-arm: hello-arm.o
63 arm-linux-ld -o $@ $<
65 hello-arm.o: hello-arm.c
66 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
68 clean:
69 rm -f *~ *.o $(TESTS)