xref: /qemu/tests/tcg/i386/Makefile.target (revision e7b3af81)
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: TIMEOUT=30
34run-runcom: runcom pi_10.com
35	$(call run-test,$<,$(QEMU) ./runcom $(I386_SRC)/pi_10.com,"$< on $(TARGET_NAME)")
36
37ifeq ($(SPEED), slow)
38
39test-i386-fprem.ref: test-i386-fprem
40	$(call quiet-command, ./$< > $@,"GENREF","generating $@")
41
42run-test-i386-fprem: TIMEOUT=60
43run-test-i386-fprem: test-i386-fprem
44	$(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)")
45	$(call diff-out,test-i386-fprem, $(I386_SRC)/$<.ref)
46else
47run-test-i386-fprem: test-i386-fprem
48	$(call skip-test, $<, "SLOW")
49endif
50
51# On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack)
52EXTRA_RUNS+=run-test-mmap-4096
53