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