root / tests / Makefile @ 1f673135
History | View | Annotate | Download (1.6 kB)
1 | 626df76a | bellard | include ../config-host.mak |
---|---|---|---|
2 | 7d13299d | bellard | |
3 | 4d1135e4 | bellard | CFLAGS=-Wall -O2 -g |
4 | 4d1135e4 | bellard | LDFLAGS= |
5 | 4d1135e4 | bellard | |
6 | 7d13299d | bellard | ifeq ($(ARCH),i386) |
7 | 9d16dd55 | bellard | TESTS=linux-test testthread sha1-i386 test-i386 runcom |
8 | 7d13299d | bellard | endif |
9 | 9d16dd55 | bellard | TESTS+=sha1# test_path |
10 | 9d16dd55 | bellard | #TESTS+=test_path |
11 | 367e86e8 | bellard | |
12 | 03d5f74a | bellard | QEMU=../i386-user/qemu-i386 |
13 | 4d1135e4 | bellard | |
14 | 4d1135e4 | bellard | all: $(TESTS) |
15 | 4d1135e4 | bellard | |
16 | 144c345d | bellard | hello-i386: hello-i386.c |
17 | 4d1135e4 | bellard | $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< |
18 | 144c345d | bellard | strip $@ |
19 | 4d1135e4 | bellard | |
20 | 1b6b029e | bellard | testthread: testthread.c |
21 | 1b6b029e | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread |
22 | 1b6b029e | bellard | |
23 | 7fb9a24e | bellard | test_path: test_path.c |
24 | 7fb9a24e | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
25 | 7fb9a24e | bellard | ./$@ || { rm $@; exit 1; } |
26 | 7fb9a24e | bellard | |
27 | 04369ff2 | bellard | # i386 emulation test (test various opcodes) */ |
28 | 5132455e | bellard | test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ |
29 | e5918247 | bellard | test-i386.h test-i386-shift.h test-i386-muldiv.h |
30 | 9d16dd55 | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c \ |
31 | 5132455e | bellard | test-i386-code16.S test-i386-vm86.S -lm |
32 | 4d1135e4 | bellard | |
33 | 04369ff2 | bellard | ifeq ($(ARCH),i386) |
34 | d3032929 | bellard | test: test-i386 |
35 | 4d1135e4 | bellard | ./test-i386 > test-i386.ref |
36 | d3032929 | bellard | else |
37 | d3032929 | bellard | test: |
38 | 04369ff2 | bellard | endif |
39 | 3ef693a0 | bellard | $(QEMU) test-i386 > test-i386.out |
40 | 4d1135e4 | bellard | @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi |
41 | 4d1135e4 | bellard | |
42 | 9d16dd55 | bellard | # generic Linux and CPU test |
43 | 9d16dd55 | bellard | linux-test: linux-test.c |
44 | 9d16dd55 | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm |
45 | 9d16dd55 | bellard | |
46 | 4d1135e4 | bellard | # speed test |
47 | 04369ff2 | bellard | sha1-i386: sha1.c |
48 | 4d1135e4 | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
49 | 4d1135e4 | bellard | |
50 | 04369ff2 | bellard | sha1: sha1.c |
51 | 04369ff2 | bellard | $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
52 | 04369ff2 | bellard | |
53 | 04369ff2 | bellard | speed: sha1 sha1-i386 |
54 | 4d1135e4 | bellard | time ./sha1 |
55 | 3ef693a0 | bellard | time $(QEMU) ./sha1-i386 |
56 | 4d1135e4 | bellard | |
57 | c3c7c292 | bellard | # vm86 test |
58 | c3c7c292 | bellard | runcom: runcom.c |
59 | c3c7c292 | bellard | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
60 | c3c7c292 | bellard | |
61 | 394411ac | bellard | # arm test |
62 | 394411ac | bellard | hello-arm: hello-arm.o |
63 | 394411ac | bellard | arm-linux-ld -o $@ $< |
64 | 394411ac | bellard | |
65 | 394411ac | bellard | hello-arm.o: hello-arm.c |
66 | 394411ac | bellard | arm-linux-gcc -Wall -g -O2 -c -o $@ $< |
67 | 394411ac | bellard | |
68 | 546cdbd7 | bellard | # XXX: find a way to compile easily a test for each arch |
69 | 546cdbd7 | bellard | test2: |
70 | 546cdbd7 | bellard | @for arch in i386 arm sparc ppc; do \ |
71 | 546cdbd7 | bellard | ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \ |
72 | 546cdbd7 | bellard | done |
73 | 546cdbd7 | bellard | |
74 | 7d13299d | bellard | clean: |
75 | 68e73e39 | bellard | rm -f *~ *.o test-i386.out test-i386.ref $(TESTS) |