1 -include ..
/config-host.mak
3 $(call set-vpath
, $(SRC_PATH
)/tests
)
5 CFLAGS
=-Wall
-O2
-g
-fno-strict-aliasing
10 TESTS
=linux-test testthread sha1-i386 test-i386
15 TESTS
+=sha1
# test_path
19 QEMU
=..
/i386-linux-user
/qemu-i386
23 hello-i386
: hello-i386.c
24 $(CC
) -nostdlib
$(CFLAGS
) -static
$(LDFLAGS
) -o
$@
$<
27 testthread
: testthread.c
28 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$< -lpthread
30 test_path
: test_path.c
31 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
32 .
/$@ ||
{ rm $@
; exit
1; }
34 # i386/x86_64 emulation test (test various opcodes) */
35 test-i386
: test-i386.c test-i386-code16.S test-i386-vm86.S \
36 test-i386.h test-i386-shift.h test-i386-muldiv.h
37 $(CC
) -m32
$(CFLAGS
) $(LDFLAGS
) -static
-o
$@ \
38 $(<D
)/test-i386.c
$(<D
)/test-i386-code16.S
$(<D
)/test-i386-vm86.S
-lm
40 test-x86_64
: test-i386.c \
41 test-i386.h test-i386-shift.h test-i386-muldiv.h
42 $(CC
) -m64
$(CFLAGS
) $(LDFLAGS
) -static
-o
$@
$(<D
)/test-i386.c
-lm
46 .
/test-i386
> test-i386.ref
50 $(QEMU
) test-i386
> test-i386.out
51 @if diff
-u test-i386.ref test-i386.out
; then echo
"Auto Test OK"; fi
54 test-mmap
: test-mmap.c
55 $(CC
) $(CFLAGS
) -Wall
-static
-O2
$(LDFLAGS
) -o
$@
$<
58 -$(QEMU
) -p
8192 .
/test-mmap
8192
59 -$(QEMU
) -p
16384 .
/test-mmap
16384
60 -$(QEMU
) -p
32768 .
/test-mmap
32768
62 # generic Linux and CPU test
63 linux-test
: linux-test.c
64 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$< -lm
68 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
71 $(HOST_CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
75 time
$(QEMU
) .
/sha1-i386
79 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$<
81 # NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
82 qruncom
: qruncom.c ..
/ioport-user.c ..
/i386-user
/libqemu.a
83 $(CC
) $(CFLAGS
) -fomit-frame-pointer
$(LDFLAGS
) -I..
/target-i386
-I..
-I..
/i386-user
-I..
/fpu \
84 -o
$@
$(filter %.c
, $^
) -L..
/i386-user
-lqemu
-lm
87 hello-arm
: hello-arm.o
90 hello-arm.o
: hello-arm.c
91 arm-linux-gcc
-Wall
-g
-O2
-c
-o
$@
$<
93 test-arm-iwmmxt
: test-arm-iwmmxt.s
94 cpp < $< | arm-linux-gnu-gcc
-Wall
-static
-march
=iwmmxt
-mabi
=aapcs
-x assembler
- -o
$@
97 hello-mips
: hello-mips.c
98 mips-linux-gnu-gcc
-nostdlib
-static
-mno-abicalls
-fno-PIC
-mabi
=32 -Wall
-Wextra
-g
-O2
-o
$@
$<
100 hello-mipsel
: hello-mips.c
101 mipsel-linux-gnu-gcc
-nostdlib
-static
-mno-abicalls
-fno-PIC
-mabi
=32 -Wall
-Wextra
-g
-O2
-o
$@
$<
103 # testsuite for the CRIS port.
105 $(MAKE
) -C cris
check
108 rm -f
*~
*.o test-i386.out test-i386.ref \
109 test-x86_64.log test-x86_64.ref qruncom
$(TESTS
)