Makefile revision dc596afcb55b186049993a53a06fd9eba8eb025c
0N/A-include ../config-host.mak
2362N/A
1008N/ACFLAGS=-Wall -O2 -g
1008N/A#CFLAGS+=-msse2
1008N/ALDFLAGS=
1008N/A
2362N/Aifeq ($(ARCH),i386)
1008N/ATESTS=linux-test testthread sha1-i386 test-i386 runcom
2362N/Aendif
1008N/Aifeq ($(ARCH),x86_64)
1008N/ATESTS=test-x86_64
1008N/Aendif
1008N/ATESTS+=sha1# test_path
1008N/A#TESTS+=test_path
1008N/A
1008N/AQEMU=../i386-user/qemu-i386
1008N/A
1008N/Aall: $(TESTS)
1008N/A
1008N/Ahello-i386: hello-i386.c
2362N/A $(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
2362N/A strip $@
2362N/A
1008N/Atestthread: testthread.c
1008N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
1008N/A
1008N/Atest_path: test_path.c
0N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
0N/A ./$@ || { rm $@; exit 1; }
1821N/A
1821N/A# i386/x86_64 emulation test (test various opcodes) */
1821N/Atest-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
1821N/A test-i386.h test-i386-shift.h test-i386-muldiv.h
1821N/A $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ \
1821N/A test-i386.c test-i386-code16.S test-i386-vm86.S -lm
1821N/A
1821N/Atest-x86_64: test-i386.c \
1821N/A test-i386.h test-i386-shift.h test-i386-muldiv.h
1821N/A $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c -lm
2391N/A
1821N/Aifeq ($(ARCH),i386)
1821N/Atest: test-i386
2391N/A ./test-i386 > test-i386.ref
1821N/Aelse
1821N/Atest:
1821N/Aendif
2391N/A $(QEMU) test-i386 > test-i386.out
1821N/A @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi
1821N/Aifeq ($(ARCH),i386)
1821N/A $(QEMU) -no-code-copy test-i386 > test-i386.out
1821N/A @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
1821N/Aendif
1821N/A
1821N/A# generic Linux and CPU test
1821N/Alinux-test: linux-test.c
1821N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
1821N/A
1821N/A# speed test
1821N/Asha1-i386: sha1.c
1008N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
1008N/A
1821N/Asha1: sha1.c
1008N/A $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
1008N/A
1008N/Aspeed: sha1 sha1-i386
1008N/A time ./sha1
1008N/A time $(QEMU) ./sha1-i386
1821N/A
1821N/A# vm86 test
1821N/Aruncom: runcom.c
1821N/A $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
1821N/A
1821N/A# NOTE: -fomit-frame-pointer is currently needed : this is a bug in libqemu
1821N/Aqruncom: qruncom.c ../i386-user/libqemu.a
1821N/A $(CC) $(CFLAGS) -fomit-frame-pointer $(LDFLAGS) -I../target-i386 -I.. -I../i386-user -I../fpu \
2228N/A -o $@ $< -L../i386-user -lqemu -lm
2228N/A
2228N/A# arm test
2228N/Ahello-arm: hello-arm.o
1821N/A arm-linux-ld -o $@ $<
0N/A
2402N/Ahello-arm.o: hello-arm.c
2402N/A arm-linux-gcc -Wall -g -O2 -c -o $@ $<
2402N/A
2402N/A# MIPS test
2402N/Ahello-mips: hello-mips.c
2402N/A mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
2402N/A
2402N/Ahello-mipsel: hello-mips.c
2402N/A mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
2402N/A
2402N/A# XXX: find a way to compile easily a test for each arch
2402N/Atest2:
2402N/A @for arch in i386 arm armeb sparc ppc mips mipsel; do \
2402N/A ../$${arch}-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \
2402N/A done
2402N/A
2402N/Aclean:
2402N/A rm -f *~ *.o test-i386.out test-i386.ref \
2402N/A test-x86_64.log test-x86_64.ref qruncom $(TESTS)
0N/A