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