Fix typo in comment, by Andreas Faerber.
[qemu/dscho.git] / tests / Makefile
blobec3a93ce6298aab1b276eadb2792a29ef3ac8bb0
1 -include ../config-host.mak
3 CFLAGS=-Wall -O2 -g
4 #CFLAGS+=-msse2
5 LDFLAGS=
7 ifeq ($(ARCH),i386)
8 TESTS=linux-test testthread sha1-i386 test-i386 runcom
9 endif
10 ifeq ($(ARCH),x86_64)
11 TESTS=test-x86_64
12 endif
13 TESTS+=sha1# test_path
14 #TESTS+=test_path
16 QEMU=../i386-linux-user/qemu-i386
18 all: $(TESTS)
20 hello-i386: hello-i386.c
21 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
22 strip $@
24 testthread: testthread.c
25 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
27 test_path: test_path.c
28 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
29 ./$@ || { rm $@; exit 1; }
31 # i386/x86_64 emulation test (test various opcodes) */
32 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
33 test-i386.h test-i386-shift.h test-i386-muldiv.h
34 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
35 test-i386.c test-i386-code16.S test-i386-vm86.S -lm
37 test-x86_64: test-i386.c \
38 test-i386.h test-i386-shift.h test-i386-muldiv.h
39 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm
41 ifeq ($(ARCH),i386)
42 test: test-i386
43 ./test-i386 > test-i386.ref
44 else
45 test:
46 endif
47 $(QEMU) test-i386 > test-i386.out
48 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
49 ifeq ($(ARCH),i386)
50 $(QEMU) -no-code-copy test-i386 > test-i386.out
51 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
52 endif
54 # generic Linux and CPU test
55 linux-test: linux-test.c
56 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
58 # speed test
59 sha1-i386: sha1.c
60 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
62 sha1: sha1.c
63 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
65 speed: sha1 sha1-i386
66 time ./sha1
67 time $(QEMU) ./sha1-i386
69 # vm86 test
70 runcom: runcom.c
71 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
73 # NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
74 qruncom: qruncom.c ../i386-user/libqemu.a
75 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
76 -o $@ $< -L../i386-user -lqemu -lm
78 # arm test
79 hello-arm: hello-arm.o
80 arm-linux-ld -o $@ $<
82 hello-arm.o: hello-arm.c
83 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
85 test-arm-iwmmxt: test-arm-iwmmxt.s
86 cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
88 # MIPS test
89 hello-mips: hello-mips.c
90 mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
92 hello-mipsel: hello-mips.c
93 mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
95 # XXX: find a way to compile easily a test for each arch
96 test2:
97 @for arch in i386 arm armeb sparc ppc mips mipsel; do \
98 ../$${arch}-linux-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
99 done
101 clean:
102 rm -f *~ *.o test-i386.out test-i386.ref \
103 test-x86_64.log test-x86_64.ref qruncom $(TESTS)