VirtualBox

source: vbox/trunk/src/recompiler_new/tests/Makefile@ 16894

Last change on this file since 16894 was 2426, checked in by vboxsync, 18 years ago

Removed the old recompiler code. (wonder why subversion didn't pick up these changes right way)

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1-include ../config-host.mak
2
3CFLAGS=-Wall -O2 -g
4#CFLAGS+=-msse2
5LDFLAGS=
6
7ifeq ($(ARCH),i386)
8TESTS=linux-test testthread sha1-i386 test-i386 runcom
9endif
10ifeq ($(ARCH),x86_64)
11TESTS=test-x86_64
12endif
13TESTS+=sha1# test_path
14#TESTS+=test_path
15
16QEMU=../i386-user/qemu-i386
17
18all: $(TESTS)
19
20hello-i386: hello-i386.c
21 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
22 strip $@
23
24testthread: testthread.c
25 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
26
27test_path: test_path.c
28 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
29 ./$@ || { rm $@; exit 1; }
30
31# i386/x86_64 emulation test (test various opcodes) */
32test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
33 test-i386.h test-i386-shift.h test-i386-muldiv.h
34 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
35 test-i386.c test-i386-code16.S test-i386-vm86.S -lm
36
37test-x86_64: test-i386.c \
38 test-i386.h test-i386-shift.h test-i386-muldiv.h
39 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm
40
41ifeq ($(ARCH),i386)
42test: test-i386
43 ./test-i386 > test-i386.ref
44else
45test:
46endif
47 $(QEMU) test-i386 > test-i386.out
48 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
49ifeq ($(ARCH),i386)
50 $(QEMU) -no-code-copy test-i386 > test-i386.out
51 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
52endif
53
54# generic Linux and CPU test
55linux-test: linux-test.c
56 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
57
58# speed test
59sha1-i386: sha1.c
60 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
61
62sha1: sha1.c
63 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
64
65speed: sha1 sha1-i386
66 time ./sha1
67 time $(QEMU) ./sha1-i386
68
69# vm86 test
70runcom: runcom.c
71 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
72
73# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
74qruncom: qruncom.c ../i386-user/libqemu.a
75 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
76 -o $@ $< -L../i386-user -lqemu -lm
77
78# arm test
79hello-arm: hello-arm.o
80 arm-linux-ld -o $@ $<
81
82hello-arm.o: hello-arm.c
83 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
84
85# MIPS test
86hello-mips: hello-mips.c
87 mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
88
89hello-mipsel: hello-mips.c
90 mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
91
92# XXX: find a way to compile easily a test for each arch
93test2:
94 @for arch in i386 arm armeb sparc ppc mips mipsel; do \
95 ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
96 done
97
98clean:
99 rm -f *~ *.o test-i386.out test-i386.ref \
100 test-x86_64.log test-x86_64.ref qruncom $(TESTS)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette