Statistics
| Branch: | Revision:

root / tests / Makefile @ 7fb9a24e

History | View | Annotate | Download (1.2 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 \
34
           test-i386.h test-i386-shift.h test-i386-muldiv.h
35
	$(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c test-i386-code16.S -lm
36

    
37
test: test-i386
38
ifeq ($(ARCH),i386)
39
	./test-i386 > test-i386.ref
40
endif
41
	$(QEMU) test-i386 > test-i386.out
42
	@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
43

    
44
# speed test
45
sha1-i386: sha1.c
46
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
47

    
48
sha1: sha1.c
49
	$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
50

    
51
speed: sha1 sha1-i386
52
	time ./sha1
53
	time $(QEMU) ./sha1-i386
54

    
55
# vm86 test
56
runcom: runcom.c
57
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
58

    
59
clean:
60
	rm -f *~ *.o $(TESTS)