1 -include ..
/config-host.mak
3 CFLAGS
=-Wall
-O2
-g
#-msse2
7 TESTS
=linux-test testthread sha1-i386 test-i386 runcom
12 TESTS
+=sha1
# test_path
15 QEMU
=..
/i386-user
/qemu-i386
19 hello-i386
: hello-i386.c
20 $(CC
) -nostdlib
$(CFLAGS
) -static
$(LDFLAGS
) -o
$@
$<
23 testthread
: testthread.c
24 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$< -lpthread
26 test_path
: test_path.c
27 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
28 .
/$@ ||
{ rm $@
; exit
1; }
30 # i386/x86_64 emulation test (test various opcodes) */
31 test-i386
: test-i386.c test-i386-code16.S test-i386-vm86.S \
32 test-i386.h test-i386-shift.h test-i386-muldiv.h
33 $(CC
) $(CFLAGS
) $(LDFLAGS
) -static
-o
$@ \
34 test-i386.c test-i386-code16.S test-i386-vm86.S
-lm
36 test-x86_64
: test-i386.c \
37 test-i386.h test-i386-shift.h test-i386-muldiv.h
38 $(CC
) $(CFLAGS
) $(LDFLAGS
) -static
-o
$@ test-i386.c
-lm
42 .
/test-i386
> test-i386.ref
46 $(QEMU
) test-i386
> test-i386.out
47 @if diff
-u test-i386.ref test-i386.out
; then echo
"Auto Test OK"; fi
49 $(QEMU
) -no-code-copy test-i386
> test-i386.out
50 @if diff
-u test-i386.ref test-i386.out
; then echo
"Auto Test OK (no code copy)"; fi
53 # generic Linux and CPU test
54 linux-test
: linux-test.c
55 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$< -lm
59 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
62 $(HOST_CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
66 time
$(QEMU
) .
/sha1-i386
70 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
72 # NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
73 qruncom
: qruncom.c ..
/i386-user
/libqemu.a
74 $(CC
) $(CFLAGS
) -fomit-frame-pointer
$(LDFLAGS
) -I..
/target-i386
-I..
-I..
/i386-user
-I..
/fpu \
75 -o
$@
$< -L..
/i386-user
-lqemu
-lm
78 hello-arm
: hello-arm.o
81 hello-arm.o
: hello-arm.c
82 arm-linux-gcc
-Wall
-g
-O2
-c
-o
$@
$<
84 # XXX: find a way to compile easily a test for each arch
86 @for arch in i386 arm armeb sparc ppc mips mipsel
; do \
87 ..
/$${arch}-user
/qemu-
$${arch} $${arch}/ls
-l linux-test.c
; \
91 rm -f
*~
*.o test-i386.out test-i386.ref \
92 test-x86_64.log test-x86_64.ref qruncom
$(TESTS
)