Statistics
| Branch: | Revision:

root / tests / Makefile @ 48118b02

History | View | Annotate | Download (2.8 kB)

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