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