mipsel configure support (Thiemo Seufer).
[qemu/mini2440.git] / tests / Makefile
blob59a0b6d9940857018a712b09841035803580e86e
1 -include ../config-host.mak
3 CFLAGS=-Wall -O2 -g #-msse2
4 LDFLAGS=
6 ifeq ($(ARCH),i386)
7 TESTS=linux-test testthread sha1-i386 test-i386 runcom
8 endif
9 ifeq ($(ARCH),x86_64)
10 TESTS=test-x86_64
11 endif
12 TESTS+=sha1# test_path
13 #TESTS+=test_path
15 QEMU=../i386-user/qemu-i386
17 all: $(TESTS)
19 hello-i386: hello-i386.c
20 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
21 strip $@
23 testthread: testthread.c
24 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
26 test_path: test_path.c
27 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
28 ./$@ || { rm $@; exit 1; }
30 # i386/x86_64 emulation test (test various opcodes) */
31 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
32 test-i386.h test-i386-shift.h test-i386-muldiv.h
33 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
34 test-i386.c test-i386-code16.S test-i386-vm86.S -lm
36 test-x86_64: test-i386.c \
37 test-i386.h test-i386-shift.h test-i386-muldiv.h
38 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm
40 ifeq ($(ARCH),i386)
41 test: test-i386
42 ./test-i386 > test-i386.ref
43 else
44 test:
45 endif
46 $(QEMU) test-i386 > test-i386.out
47 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
48 ifeq ($(ARCH),i386)
49 $(QEMU) -no-code-copy test-i386 > test-i386.out
50 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
51 endif
53 # generic Linux and CPU test
54 linux-test: linux-test.c
55 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
57 # speed test
58 sha1-i386: sha1.c
59 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
61 sha1: sha1.c
62 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
64 speed: sha1 sha1-i386
65 time ./sha1
66 time $(QEMU) ./sha1-i386
68 # vm86 test
69 runcom: runcom.c
70 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
72 # NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
73 qruncom: qruncom.c ../i386-user/libqemu.a
74 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
75 -o $@ $< -L../i386-user -lqemu -lm
77 # arm test
78 hello-arm: hello-arm.o
79 arm-linux-ld -o $@ $<
81 hello-arm.o: hello-arm.c
82 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
84 # XXX: find a way to compile easily a test for each arch
85 test2:
86 @for arch in i386 arm armeb sparc ppc mips mipsel; do \
87 ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
88 done
90 clean:
91 rm -f *~ *.o test-i386.out test-i386.ref \
92 test-x86_64.log test-x86_64.ref qruncom $(TESTS)