]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/Makefile
e12395117a02c513c614821b3d3e4caa3af72aff
[mirror_qemu.git] / tests / tcg / Makefile
1 -include ../../config-host.mak
2 -include $(SRC_PATH)/rules.mak
3
4 $(call set-vpath, $(SRC_PATH)/tests/tcg)
5
6 QEMU=../../i386-linux-user/qemu-i386
7 QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64
8 CC_X86_64=$(CC_I386) -m64
9
10 QEMU_INCLUDES += -I../..
11 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
12 #CFLAGS+=-msse2
13 LDFLAGS=
14
15 # TODO: automatically detect ARM and MIPS compilers, and run those too
16
17 # runcom maps page 0, so it requires root privileges
18 # also, pi_10.com runs indefinitely
19
20 I386_TESTS=hello-i386 \
21 sha1-i386 \
22 test-i386 \
23 test-i386-fprem \
24 # runcom
25
26 # native i386 compilers sometimes are not biarch. assume cross-compilers are
27 ifneq ($(ARCH),i386)
28 I386_TESTS+=run-test-x86_64
29 endif
30
31 TESTS = test_path
32 ifneq ($(call find-in-path, $(CC_I386)),)
33 TESTS += $(I386_TESTS)
34 endif
35
36 all: $(patsubst %,run-%,$(TESTS))
37 test: all
38
39 # rules to run tests
40
41 .PHONY: $(patsubst %,run-%,$(TESTS))
42
43 run-%: %
44 -$(QEMU) ./$*
45
46 run-hello-i386: hello-i386
47 run-sha1-i386: sha1-i386
48
49 run-test-i386: test-i386
50 ./test-i386 > test-i386.ref
51 -$(QEMU) test-i386 > test-i386.out
52 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
53
54 run-test-i386-fprem: test-i386-fprem
55 ./test-i386-fprem > test-i386-fprem.ref
56 -$(QEMU) test-i386-fprem > test-i386-fprem.out
57 @if diff -u test-i386-fprem.ref test-i386-fprem.out ; then echo "Auto Test OK"; fi
58
59 run-test-x86_64: test-x86_64
60 ./test-x86_64 > test-x86_64.ref
61 -$(QEMU_X86_64) test-x86_64 > test-x86_64.out
62 @if diff -u test-x86_64.ref test-x86_64.out ; then echo "Auto Test OK"; fi
63
64
65 run-runcom: runcom
66 -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com
67
68 run-test_path: test_path
69 ./test_path
70
71 # rules to compile tests
72
73 hello-i386: hello-i386.c
74 $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
75 strip $@
76
77 # i386/x86_64 emulation test (test various opcodes) */
78 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
79 test-i386.h test-i386-shift.h test-i386-muldiv.h
80 $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ \
81 $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
82
83 test-i386-fprem: test-i386-fprem.c
84 $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^
85
86 test-x86_64: test-i386.c \
87 test-i386.h test-i386-shift.h test-i386-muldiv.h
88 $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $(<D)/test-i386.c -lm
89
90 # vm86 test
91 runcom: runcom.c
92 $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
93
94 # speed test
95 sha1-i386: sha1.c
96 $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
97
98 # arm test
99 hello-arm: hello-arm.o
100 arm-linux-ld -o $@ $<
101
102 hello-arm.o: hello-arm.c
103 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
104
105 test-arm-iwmmxt: test-arm-iwmmxt.s
106 cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
107
108 # MIPS test
109 hello-mips: hello-mips.c
110 mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
111
112 hello-mipsel: hello-mips.c
113 mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
114
115 # testsuite for the CRIS port.
116 test-cris:
117 $(MAKE) -C cris check
118
119 # testsuite for the LM32 port.
120 test-lm32:
121 $(MAKE) -C lm32 check
122
123 clean:
124 rm -f *~ *.o test-i386.out test-i386.ref \
125 test-x86_64.log test-x86_64.ref qruncom $(TESTS)