1# i386 cross compile notes 2 3I386_SRC=$(SRC_PATH)/tests/tcg/i386 4 5# Set search path for all sources 6VPATH += $(I386_SRC) 7 8I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c)) 9I386_TESTS=$(I386_SRCS:.c=) 10I386_ONLY_TESTS=$(filter-out test-i386-ssse3, $(I386_TESTS)) 11# Update TESTS 12TESTS+=$(I386_ONLY_TESTS) 13 14ifneq ($(TARGET_NAME),x86_64) 15CFLAGS+=-m32 16endif 17 18# 19# hello-i386 is a barebones app 20# 21hello-i386: CFLAGS+=-ffreestanding 22hello-i386: LDFLAGS+=-nostdlib 23 24# 25# test-386 includes a couple of additional objects that need to be linked together 26# 27 28test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h 29 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ \ 30 $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm 31 32# Specialist test runners 33run-runcom: runcom pi_10.com 34 $(call quiet-command, $(QEMU) ./runcom $(I386_SRC)/pi_10.com > runcom.out, "TEST", "$< on $(TARGET_NAME)") 35 36ifeq ($(SPEED), slow) 37 38test-i386-fprem.ref: test-i386-fprem 39 $(call quiet-command, ./$< > $@,"GENREF","generating $@") 40 41run-test-i386-fprem: TIMEOUT=60 42run-test-i386-fprem: test-i386-fprem 43 $(call quiet-command, \ 44 $(QEMU) $< > $<.out && \ 45 diff -u $(I386_SRC)/$<.ref $<.out, \ 46 "TEST", "$< (default) on $(TARGET_NAME)") 47else 48run-test-i386-fprem: test-i386-fprem 49 $(call quiet-command, /bin/true, "SLOW TEST", "$< SKIPPED on $(TARGET_NAME)") 50endif 51 52# On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack) 53EXTRA_RUNS+=run-test-mmap-4096 54