new x86 CPU core
[qemu] / tests / Makefile
1 CC=gcc
2 CFLAGS=-Wall -O2 -g
3 LDFLAGS=
4
5 TESTS=hello test1 test2 sha1 test-i386
6 TESTS+=op-i386.o #op-i386.o op-ppc.o op-arm.o op-mips.o op-sparc.o
7
8 GEMU=../gemu
9
10 all: $(TESTS)
11
12 hello: hello.c
13         $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
14
15 test1: test1.c
16         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
17
18 test2: test2.c
19         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
20
21 # i386 emulation test (dump various opcodes) */
22 test-i386: test-i386.c test-i386.h test-i386-shift.h
23         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
24
25 test: test-i386
26         ./test-i386 > test-i386.ref
27         $(GEMU) test-i386 > test-i386.out
28         @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
29
30 # dyngen tests
31 op-i386.o: op.c
32         gcc $(CFLAGS) -c -o $@ $<
33
34 op-ppc.o: op.c
35         powerpc-linux-gcc $(CFLAGS) -c -o $@ $<
36
37 op-arm.o: op.c
38         arm-linux-gcc $(CFLAGS) -c -o $@ $<
39
40 op-mips.o: op.c
41         mips-linux-gcc $(CFLAGS) -mno-abicalls -c -o $@ $<
42
43 op-sparc.o: op.c
44         sparc-linux-gcc $(CFLAGS) -mflat -c -o $@ $<
45
46 # speed test
47 sha1: sha1.c
48         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
49
50 speed: sha1
51         time ./sha1
52         time $(GEMU) sha1
53
54 # interpreter test
55 interp: interp.c interploop.c
56         $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -o $@ $^