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