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