Statistics
| Branch: | Revision:

root / tests / Makefile @ 3ef693a0

History | View | Annotate | Download (1.1 kB)

1 7d13299d bellard
include ../config.mak
2 7d13299d bellard
3 4d1135e4 bellard
CFLAGS=-Wall -O2 -g
4 4d1135e4 bellard
LDFLAGS=
5 4d1135e4 bellard
6 7d13299d bellard
ifeq ($(ARCH),i386)
7 1b6b029e bellard
TESTS=testclone testsig testthread sha1-i386 test-i386
8 7d13299d bellard
endif
9 04369ff2 bellard
TESTS+=sha1
10 367e86e8 bellard
11 3ef693a0 bellard
QEMU=../qemu
12 4d1135e4 bellard
13 4d1135e4 bellard
all: $(TESTS)
14 4d1135e4 bellard
15 4d1135e4 bellard
hello: hello.c
16 4d1135e4 bellard
	$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
17 04369ff2 bellard
	strip hello
18 4d1135e4 bellard
19 1b6b029e bellard
testclone: testclone.c
20 4d1135e4 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
21 4d1135e4 bellard
22 1b6b029e bellard
testsig: testsig.c
23 1b6b029e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
24 1b6b029e bellard
25 1b6b029e bellard
testthread: testthread.c
26 1b6b029e bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
27 1b6b029e bellard
28 04369ff2 bellard
# i386 emulation test (test various opcodes) */
29 e5918247 bellard
test-i386: test-i386.c test-i386-code16.S \
30 e5918247 bellard
           test-i386.h test-i386-shift.h test-i386-muldiv.h
31 e5918247 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c test-i386-code16.S -lm
32 4d1135e4 bellard
33 4d1135e4 bellard
test: test-i386
34 04369ff2 bellard
ifeq ($(ARCH),i386)
35 4d1135e4 bellard
	./test-i386 > test-i386.ref
36 04369ff2 bellard
endif
37 3ef693a0 bellard
	$(QEMU) test-i386 > test-i386.out
38 4d1135e4 bellard
	@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
39 4d1135e4 bellard
40 4d1135e4 bellard
# speed test
41 04369ff2 bellard
sha1-i386: sha1.c
42 4d1135e4 bellard
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
43 4d1135e4 bellard
44 04369ff2 bellard
sha1: sha1.c
45 04369ff2 bellard
	$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
46 04369ff2 bellard
47 04369ff2 bellard
speed: sha1 sha1-i386
48 4d1135e4 bellard
	time ./sha1
49 3ef693a0 bellard
	time $(QEMU) ./sha1-i386
50 4d1135e4 bellard
51 7d13299d bellard
clean:
52 7d13299d bellard
	rm -f *~ *.o $(TESTS)