tests/tcg: clean-up VPATH/TESTS for i386
[qemu/ar7.git] / tests / tcg / i386 / Makefile.softmmu-target
blobe1d880f9b5ce4aa8ff7e7ac3e57040ac32511af2
2 # x86 system tests
4 # This currently builds only for i386. The common C code is built
5 # with standard compiler flags however so we can support both by
6 # adding additional boot files for x86_64.
9 I386_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/i386/system
10 X64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/x86_64/system
12 # These objects provide the basic boot code and helper functions for all tests
13 CRT_OBJS=boot.o
15 ifeq ($(TARGET_X86_64), y)
16 CRT_PATH=$(X64_SYSTEM_SRC)
17 LINK_SCRIPT=$(X64_SYSTEM_SRC)/kernel.ld
18 LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_x86_64
19 else
20 CRT_PATH=$(I386_SYSTEM_SRC)
21 CFLAGS+=-m32
22 LINK_SCRIPT=$(I386_SYSTEM_SRC)/kernel.ld
23 LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_i386
24 endif
25 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
26 LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
28 TESTS+=$(MULTIARCH_TESTS)
30 # building head blobs
31 .PRECIOUS: $(CRT_OBJS)
33 %.o: $(CRT_PATH)/%.S
34         $(CC) $(CFLAGS) -c $< -o $@
36 # Build and link the tests
37 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
38         $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
40 memory: CFLAGS+=-DCHECK_UNALIGNED=1
42 # Running
43 QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel