VirtualBox

source: vbox/trunk/src/recompiler/tests/Makefile@ 109

最後變更 在這個檔案從109是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.1 KB
 
1#-include ../config-host.mak
2CC=gcc
3CFLAGS=-Wall -O2 -g
4LDFLAGS=
5
6ifeq ($(ARCH),i386)
7TESTS=linux-test testthread sha1-i386 test-i386 runcom
8endif
9TESTS+=sha1# test_path
10#TESTS+=test_path
11
12QEMU=../i386-user/qemu-i386
13
14all: $(TESTS)
15
16hello-i386: hello-i386.c
17 $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
18 strip $@
19
20testthread: testthread.c
21 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
22
23test_path: test_path.c
24 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
25 ./$@ || { rm $@; exit 1; }
26
27# i386 emulation test (test various opcodes) */
28test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
29 test-i386.h test-i386-shift.h test-i386-muldiv.h
30 $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c \
31 test-i386-code16.S test-i386-vm86.S -lm
32
33ifeq ($(ARCH),i386)
34test: test-i386
35 ./test-i386 > test-i386.ref
36else
37test:
38endif
39 $(QEMU) test-i386 > test-i386.out
40 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
41ifeq ($(ARCH),i386)
42 $(QEMU) -no-code-copy test-i386 > test-i386.out
43 @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
44endif
45
46# generic Linux and CPU test
47linux-test: linux-test.c
48 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
49
50# speed test
51sha1-i386: sha1.c
52 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
53
54sha1: sha1.c
55 $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
56
57speed: sha1 sha1-i386
58 time ./sha1
59 time $(QEMU) ./sha1-i386
60
61# vm86 test
62runcom: runcom.c
63 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
64
65# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
66qruncom: qruncom.c ../i386-user/libqemu.a
67 $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user \
68 -o $@ $< -L../i386-user -lqemu -lm
69
70# arm test
71hello-arm: hello-arm.o
72 arm-linux-ld -o $@ $<
73
74hello-arm.o: hello-arm.c
75 arm-linux-gcc -Wall -g -O2 -c -o $@ $<
76
77# XXX: find a way to compile easily a test for each arch
78test2:
79 @for arch in i386 arm sparc ppc; do \
80 ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
81 done
82
83clean:
84 rm -f *~ *.o test-i386.out test-i386.ref qruncom $(TESTS)
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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