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