]> git.proxmox.com Git - qemu.git/blame - tests/Makefile
use -fno-strict-aliasing
[qemu.git] / tests / Makefile
CommitLineData
8d5f07fa 1-include ../config-host.mak
7d13299d 2
7aaabde7 3CFLAGS=-Wall -O2 -g -fno-strict-aliasing
3b42c979 4#CFLAGS+=-msse2
4d1135e4
FB
5LDFLAGS=
6
7d13299d 7ifeq ($(ARCH),i386)
9d16dd55 8TESTS=linux-test testthread sha1-i386 test-i386 runcom
7d13299d 9endif
776f2227
FB
10ifeq ($(ARCH),x86_64)
11TESTS=test-x86_64
12endif
9d16dd55
FB
13TESTS+=sha1# test_path
14#TESTS+=test_path
367e86e8 15
2afbeee7 16QEMU=../i386-linux-user/qemu-i386
4d1135e4
FB
17
18all: $(TESTS)
19
144c345d 20hello-i386: hello-i386.c
4d1135e4 21 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
144c345d 22 strip $@
4d1135e4 23
1b6b029e
FB
24testthread: testthread.c
25 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
26
7fb9a24e
FB
27test_path: test_path.c
28 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
29 ./$@ || { rm $@; exit 1; }
30
776f2227 31# i386/x86_64 emulation test (test various opcodes) */
5132455e 32test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
e5918247 33 test-i386.h test-i386-shift.h test-i386-muldiv.h
776f2227
FB
34 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
35 test-i386.c test-i386-code16.S test-i386-vm86.S -lm
36
37test-x86_64: test-i386.c \
38 test-i386.h test-i386-shift.h test-i386-muldiv.h
39 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm
4d1135e4 40
04369ff2 41ifeq ($(ARCH),i386)
d3032929 42test: test-i386
4d1135e4 43 ./test-i386 > test-i386.ref
d3032929
FB
44else
45test:
04369ff2 46endif
3ef693a0 47 $(QEMU) test-i386 > test-i386.out
4d1135e4 48 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
b5075d29
FB
49ifeq ($(ARCH),i386)
50 $(QEMU) -no-code-copy test-i386 > test-i386.out
51 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
52endif
4d1135e4 53
9d16dd55
FB
54# generic Linux and CPU test
55linux-test: linux-test.c
56 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
57
4d1135e4 58# speed test
04369ff2 59sha1-i386: sha1.c
4d1135e4
FB
60 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
61
04369ff2
FB
62sha1: sha1.c
63 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
64
65speed: sha1 sha1-i386
4d1135e4 66 time ./sha1
3ef693a0 67 time $(QEMU) ./sha1-i386
4d1135e4 68
c3c7c292
FB
69# vm86 test
70runcom: runcom.c
71 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
72
039d3da3
FB
73# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
74qruncom: qruncom.c ../i386-user/libqemu.a
2d7a3b9d 75 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
039d3da3
FB
76 -o $@ $< -L../i386-user -lqemu -lm
77
394411ac
FB
78# arm test
79hello-arm: hello-arm.o
80 arm-linux-ld -o $@ $<
81
82hello-arm.o: hello-arm.c
83 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
84
18c9b560
AZ
85test-arm-iwmmxt: test-arm-iwmmxt.s
86 cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
87
e4630047
TS
88# MIPS test
89hello-mips: hello-mips.c
90 mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
91
92hello-mipsel: hello-mips.c
93 mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
94
546cdbd7
FB
95# XXX: find a way to compile easily a test for each arch
96test2:
56902eee 97 @for arch in i386 arm armeb sparc ppc mips mipsel; do \
57be54bb 98 ../$${arch}-linux-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
546cdbd7
FB
99 done
100
e7daa605
TS
101
102# testsuite for the CRIS port.
103test-cris:
104 $(MAKE) -C cris check
105
7d13299d 106clean:
11650e36
FB
107 rm -f *~ *.o test-i386.out test-i386.ref \
108 test-x86_64.log test-x86_64.ref qruncom $(TESTS)