]> git.proxmox.com Git - qemu.git/blame - tests/Makefile
added movdq2q and movq2dq
[qemu.git] / tests / Makefile
CommitLineData
8d5f07fa 1-include ../config-host.mak
7d13299d 2
085339a1 3CFLAGS=-Wall -O2 -g #-msse2
4d1135e4
FB
4LDFLAGS=
5
7d13299d 6ifeq ($(ARCH),i386)
9d16dd55 7TESTS=linux-test testthread sha1-i386 test-i386 runcom
7d13299d 8endif
776f2227
FB
9ifeq ($(ARCH),x86_64)
10TESTS=test-x86_64
11endif
9d16dd55
FB
12TESTS+=sha1# test_path
13#TESTS+=test_path
367e86e8 14
03d5f74a 15QEMU=../i386-user/qemu-i386
4d1135e4
FB
16
17all: $(TESTS)
18
144c345d 19hello-i386: hello-i386.c
4d1135e4 20 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
144c345d 21 strip $@
4d1135e4 22
1b6b029e
FB
23testthread: testthread.c
24 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
25
7fb9a24e
FB
26test_path: test_path.c
27 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
28 ./$@ || { rm $@; exit 1; }
29
776f2227 30# i386/x86_64 emulation test (test various opcodes) */
5132455e 31test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
e5918247 32 test-i386.h test-i386-shift.h test-i386-muldiv.h
776f2227
FB
33 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
34 test-i386.c test-i386-code16.S test-i386-vm86.S -lm
35
36test-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
4d1135e4 39
04369ff2 40ifeq ($(ARCH),i386)
d3032929 41test: test-i386
4d1135e4 42 ./test-i386 > test-i386.ref
d3032929
FB
43else
44test:
04369ff2 45endif
3ef693a0 46 $(QEMU) test-i386 > test-i386.out
4d1135e4 47 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
b5075d29
FB
48ifeq ($(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
51endif
4d1135e4 52
9d16dd55
FB
53# generic Linux and CPU test
54linux-test: linux-test.c
55 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
56
4d1135e4 57# speed test
04369ff2 58sha1-i386: sha1.c
4d1135e4
FB
59 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
60
04369ff2
FB
61sha1: sha1.c
62 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
63
64speed: sha1 sha1-i386
4d1135e4 65 time ./sha1
3ef693a0 66 time $(QEMU) ./sha1-i386
4d1135e4 67
c3c7c292
FB
68# vm86 test
69runcom: runcom.c
70 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
71
039d3da3
FB
72# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
73qruncom: qruncom.c ../i386-user/libqemu.a
2d7a3b9d 74 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
039d3da3
FB
75 -o $@ $< -L../i386-user -lqemu -lm
76
394411ac
FB
77# arm test
78hello-arm: hello-arm.o
79 arm-linux-ld -o $@ $<
80
81hello-arm.o: hello-arm.c
82 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
83
546cdbd7
FB
84# XXX: find a way to compile easily a test for each arch
85test2:
56902eee 86 @for arch in i386 arm armeb sparc ppc mips mipsel; do \
546cdbd7
FB
87 ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
88 done
89
7d13299d 90clean:
11650e36
FB
91 rm -f *~ *.o test-i386.out test-i386.ref \
92 test-x86_64.log test-x86_64.ref qruncom $(TESTS)