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