]>
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) |
1b6b029e | 7 | TESTS=testclone testsig testthread sha1-i386 test-i386 |
7d13299d | 8 | endif |
04369ff2 | 9 | TESTS+=sha1 |
367e86e8 | 10 | |
4d1135e4 FB |
11 | GEMU=../gemu |
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 | ||
04369ff2 | 28 | # i386 emulation test (test various opcodes) */ |
e5918247 FB |
29 | test-i386: test-i386.c test-i386-code16.S \ |
30 | test-i386.h test-i386-shift.h test-i386-muldiv.h | |
31 | $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c test-i386-code16.S -lm | |
4d1135e4 FB |
32 | |
33 | test: test-i386 | |
04369ff2 | 34 | ifeq ($(ARCH),i386) |
4d1135e4 | 35 | ./test-i386 > test-i386.ref |
04369ff2 | 36 | endif |
4d1135e4 FB |
37 | $(GEMU) test-i386 > test-i386.out |
38 | @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi | |
39 | ||
40 | # speed test | |
04369ff2 | 41 | sha1-i386: sha1.c |
4d1135e4 FB |
42 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
43 | ||
04369ff2 FB |
44 | sha1: sha1.c |
45 | $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< | |
46 | ||
47 | speed: sha1 sha1-i386 | |
4d1135e4 | 48 | time ./sha1 |
04369ff2 | 49 | time $(GEMU) ./sha1-i386 |
4d1135e4 | 50 | |
7d13299d FB |
51 | clean: |
52 | rm -f *~ *.o $(TESTS) |