root / tests / Makefile @ 379ca80d
History | View | Annotate | Download (791 Bytes)
1 |
CC=gcc |
---|---|
2 |
CFLAGS=-Wall -O2 -g |
3 |
LDFLAGS= |
4 |
|
5 |
TESTS=hello test1 test2 sha1 test-i386 |
6 |
GEMU=../gemu |
7 |
|
8 |
all: $(TESTS) |
9 |
|
10 |
hello: hello.c |
11 |
$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< |
12 |
|
13 |
test1: test1.c |
14 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
15 |
|
16 |
test2: test2.c |
17 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
18 |
|
19 |
# i386 emulation test (dump various opcodes) */ |
20 |
test-i386: test-i386.c test-i386.h test-i386-shift.h |
21 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
22 |
|
23 |
test: test-i386 |
24 |
./test-i386 > test-i386.ref |
25 |
$(GEMU) test-i386 > test-i386.out |
26 |
@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi |
27 |
|
28 |
# speed test |
29 |
sha1: sha1.c |
30 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
31 |
|
32 |
speed: sha1 |
33 |
time ./sha1 |
34 |
time $(GEMU) sha1 |
35 |
|
36 |
# interpreter test |
37 |
interp: interp.c interploop.c |
38 |
$(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -o $@ $^ |