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