root / tests / Makefile @ 394411ac
History | View | Annotate | Download (1.4 kB)
1 |
include ../config.mak |
---|---|
2 |
|
3 |
CFLAGS=-Wall -O2 -g |
4 |
LDFLAGS= |
5 |
|
6 |
ifeq ($(ARCH),i386) |
7 |
TESTS=testclone testsig testthread sha1-i386 test-i386 runcom |
8 |
endif |
9 |
TESTS+=sha1 test_path |
10 |
|
11 |
QEMU=../qemu |
12 |
|
13 |
all: $(TESTS) |
14 |
|
15 |
hello: hello.c |
16 |
$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< |
17 |
strip hello |
18 |
|
19 |
testclone: testclone.c |
20 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
21 |
|
22 |
testsig: testsig.c |
23 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
24 |
|
25 |
testthread: testthread.c |
26 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread |
27 |
|
28 |
test_path: test_path.c |
29 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
30 |
./$@ || { rm $@; exit 1; } |
31 |
|
32 |
# i386 emulation test (test various opcodes) */ |
33 |
test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ |
34 |
test-i386.h test-i386-shift.h test-i386-muldiv.h |
35 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ test-i386.c \ |
36 |
test-i386-code16.S test-i386-vm86.S -lm |
37 |
|
38 |
ifeq ($(ARCH),i386) |
39 |
test: test-i386 |
40 |
./test-i386 > test-i386.ref |
41 |
else |
42 |
test: |
43 |
endif |
44 |
$(QEMU) test-i386 > test-i386.out |
45 |
@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi |
46 |
|
47 |
# speed test |
48 |
sha1-i386: sha1.c |
49 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
50 |
|
51 |
sha1: sha1.c |
52 |
$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
53 |
|
54 |
speed: sha1 sha1-i386 |
55 |
time ./sha1 |
56 |
time $(QEMU) ./sha1-i386 |
57 |
|
58 |
# vm86 test |
59 |
runcom: runcom.c |
60 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
61 |
|
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 |
|
69 |
clean: |
70 |
rm -f *~ *.o $(TESTS) |