]>
Commit | Line | Data |
---|---|---|
8d5f07fa | 1 | -include ../config-host.mak |
7d13299d | 2 | |
085339a1 | 3 | CFLAGS=-Wall -O2 -g #-msse2 |
4d1135e4 FB |
4 | LDFLAGS= |
5 | ||
7d13299d | 6 | ifeq ($(ARCH),i386) |
9d16dd55 | 7 | TESTS=linux-test testthread sha1-i386 test-i386 runcom |
7d13299d | 8 | endif |
776f2227 FB |
9 | ifeq ($(ARCH),x86_64) |
10 | TESTS=test-x86_64 | |
11 | endif | |
9d16dd55 FB |
12 | TESTS+=sha1# test_path |
13 | #TESTS+=test_path | |
367e86e8 | 14 | |
03d5f74a | 15 | QEMU=../i386-user/qemu-i386 |
4d1135e4 FB |
16 | |
17 | all: $(TESTS) | |
18 | ||
144c345d | 19 | hello-i386: hello-i386.c |
4d1135e4 | 20 | $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< |
144c345d | 21 | strip $@ |
4d1135e4 | 22 | |
1b6b029e FB |
23 | testthread: testthread.c |
24 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread | |
25 | ||
7fb9a24e FB |
26 | test_path: test_path.c |
27 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< | |
28 | ./$@ || { rm $@; exit 1; } | |
29 | ||
776f2227 | 30 | # i386/x86_64 emulation test (test various opcodes) */ |
5132455e | 31 | test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ |
e5918247 | 32 | test-i386.h test-i386-shift.h test-i386-muldiv.h |
776f2227 FB |
33 | $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \ |
34 | test-i386.c test-i386-code16.S test-i386-vm86.S -lm | |
35 | ||
36 | test-x86_64: test-i386.c \ | |
37 | test-i386.h test-i386-shift.h test-i386-muldiv.h | |
38 | $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm | |
4d1135e4 | 39 | |
04369ff2 | 40 | ifeq ($(ARCH),i386) |
d3032929 | 41 | test: test-i386 |
4d1135e4 | 42 | ./test-i386 > test-i386.ref |
d3032929 FB |
43 | else |
44 | test: | |
04369ff2 | 45 | endif |
3ef693a0 | 46 | $(QEMU) test-i386 > test-i386.out |
4d1135e4 | 47 | @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi |
b5075d29 FB |
48 | ifeq ($(ARCH),i386) |
49 | $(QEMU) -no-code-copy test-i386 > test-i386.out | |
50 | @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi | |
51 | endif | |
4d1135e4 | 52 | |
9d16dd55 FB |
53 | # generic Linux and CPU test |
54 | linux-test: linux-test.c | |
55 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm | |
56 | ||
4d1135e4 | 57 | # speed test |
04369ff2 | 58 | sha1-i386: sha1.c |
4d1135e4 FB |
59 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
60 | ||
04369ff2 FB |
61 | sha1: sha1.c |
62 | $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< | |
63 | ||
64 | speed: sha1 sha1-i386 | |
4d1135e4 | 65 | time ./sha1 |
3ef693a0 | 66 | time $(QEMU) ./sha1-i386 |
4d1135e4 | 67 | |
c3c7c292 FB |
68 | # vm86 test |
69 | runcom: runcom.c | |
70 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< | |
71 | ||
039d3da3 FB |
72 | # NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu |
73 | qruncom: qruncom.c ../i386-user/libqemu.a | |
74 | $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user \ | |
75 | -o $@ $< -L../i386-user -lqemu -lm | |
76 | ||
394411ac FB |
77 | # arm test |
78 | hello-arm: hello-arm.o | |
79 | arm-linux-ld -o $@ $< | |
80 | ||
81 | hello-arm.o: hello-arm.c | |
82 | arm-linux-gcc -Wall -g -O2 -c -o $@ $< | |
83 | ||
546cdbd7 FB |
84 | # XXX: find a way to compile easily a test for each arch |
85 | test2: | |
56902eee | 86 | @for arch in i386 arm armeb sparc ppc mips mipsel; do \ |
546cdbd7 FB |
87 | ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \ |
88 | done | |
89 | ||
7d13299d | 90 | clean: |
11650e36 FB |
91 | rm -f *~ *.o test-i386.out test-i386.ref \ |
92 | test-x86_64.log test-x86_64.ref qruncom $(TESTS) |