ppc port
[qemu] / tests / Makefile
1 include ../config.mak
2
3 CFLAGS=-Wall -O2 -g
4 LDFLAGS=
5
6 ifeq ($(ARCH),i386)
7 TESTS=test2 sha1-i386 test-i386
8 endif
9 TESTS+=sha1
10
11 GEMU=../gemu
12
13 all: $(TESTS)
14
15 hello: hello.c
16         $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
17         strip hello
18
19 test2: test2.c
20         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
21
22 # i386 emulation test (test various opcodes) */
23 test-i386: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h
24         $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ $< -lm
25
26 test: test-i386
27 ifeq ($(ARCH),i386)
28         ./test-i386 > test-i386.ref
29 endif
30         $(GEMU) test-i386 > test-i386.out
31         @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
32
33 # speed test
34 sha1-i386: sha1.c
35         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
36
37 sha1: sha1.c
38         $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
39
40 speed: sha1 sha1-i386
41         time ./sha1
42         time $(GEMU) ./sha1-i386
43
44 clean:
45         rm -f *~ *.o $(TESTS)