Makefile revision 178d85b8274f9ac82fb553c80760bbbb4044401c
22N/A-include ../config-host.mak
22N/AVPATH=$(SRC_PATH)/tests
22N/A
22N/ACFLAGS=-Wall -O2 -g -fno-strict-aliasing
22N/A#CFLAGS+=-msse2
22N/ALDFLAGS=
22N/A
22N/Aifeq ($(ARCH),i386)
22N/ATESTS=linux-test testthread sha1-i386 test-i386
22N/Aendif
22N/Aifeq ($(ARCH),x86_64)
22N/ATESTS=test-x86_64
22N/Aendif
22N/ATESTS+=sha1# test_path
22N/A#TESTS+=test_path
22N/A#TESTS+=runcom
22N/A
22N/AQEMU=../i386-linux-user/qemu-i386
22N/A
22N/Aall: $(TESTS)
22N/A
22N/Ahello-i386: hello-i386.c
22N/A $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
22N/A strip $@
24N/A
22N/Atestthread: testthread.c
22N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
22N/A
22N/Atest_path: test_path.c
22N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
22N/A ./$@ || { rm $@; exit 1; }
22N/A
22N/A# i386/x86_64 emulation test (test various opcodes) */
34N/Atest-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
22N/A test-i386.h test-i386-shift.h test-i386-muldiv.h
22N/A $(CC) -m32 $(CFLAGS) $(LDFLAGS) -static -o $@ \
22N/A $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
23N/A
23N/Atest-x86_64: test-i386.c \
23N/A test-i386.h test-i386-shift.h test-i386-muldiv.h
22N/A $(CC) -m64 $(CFLAGS) $(LDFLAGS) -static -o $@ $(<D)/test-i386.c -lm
22N/A
22N/Aifeq ($(ARCH),i386)
22N/Atest: test-i386
22N/A ./test-i386 > test-i386.ref
22N/Aelse
22N/Atest:
24N/Aendif
24N/A $(QEMU) test-i386 > test-i386.out
24N/A @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
22N/A
22N/A.PHONY: test-mmap
22N/Atest-mmap: test-mmap.c
22N/A $(CC) $(CFLAGS) -Wall -static -O2 $(LDFLAGS) -o $@ $<
22N/A -./test-mmap
22N/A -$(QEMU) ./test-mmap
24N/A -$(QEMU) -p 8192 ./test-mmap 8192
24N/A -$(QEMU) -p 16384 ./test-mmap 16384
22N/A -$(QEMU) -p 32768 ./test-mmap 32768
22N/A
22N/A# generic Linux and CPU test
22N/Alinux-test: linux-test.c
22N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
22N/A
22N/A# speed test
22N/Asha1-i386: sha1.c
22N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
22N/A
22N/Asha1: sha1.c
24N/A $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
24N/A
32N/Aspeed: sha1 sha1-i386
24N/A time ./sha1
26N/A time $(QEMU) ./sha1-i386
26N/A
26N/A# vm86 test
26N/Aruncom: runcom.c
24N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
36N/A
24N/A# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
22N/Aqruncom: qruncom.c ../i386-user/libqemu.a
22N/A $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
22N/A -o $@ $< -L../i386-user -lqemu -lm
22N/A
22N/A# arm test
23N/Ahello-arm: hello-arm.o
23N/A arm-linux-ld -o $@ $<
22N/A
22N/Ahello-arm.o: hello-arm.c
22N/A arm-linux-gcc -Wall -g -O2 -c -o $@ $<
22N/A
22N/Atest-arm-iwmmxt: test-arm-iwmmxt.s
22N/A cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
22N/A
26N/A# MIPS test
26N/Ahello-mips: hello-mips.c
26N/A mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
26N/A
26N/Ahello-mipsel: hello-mips.c
26N/A mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
26N/A
26N/A# testsuite for the CRIS port.
26N/Atest-cris:
26N/A $(MAKE) -C cris check
26N/A
26N/Aclean:
26N/A rm -f *~ *.o test-i386.out test-i386.ref \
26N/A test-x86_64.log test-x86_64.ref qruncom $(TESTS)
26N/A