]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/i386/Makefile.softmmu-target
tests/tcg/i386: add system mode Hello World test
[mirror_qemu.git] / tests / tcg / i386 / Makefile.softmmu-target
1 #
2 # x86 system tests
3 #
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.
7 #
8
9 I386_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/i386/system
10 X64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/x86_64/system
11 # Set search path for all sources
12 VPATH+=$(I386_SYSTEM_SRC)
13
14 # These objects provide the basic boot code and helper functions for all tests
15 CRT_OBJS=boot.o
16
17 X86_TEST_SRCS=$(wildcard $(I386_SYSTEM_SRC)/*.c)
18 X86_TESTS = $(patsubst $(I386_SYSTEM_SRC)/%.c, %, $(X86_TEST_SRCS))
19
20 ifeq ($(TARGET_X86_64), y)
21 CRT_PATH=$(X64_SYSTEM_SRC)
22 LINK_SCRIPT=$(X64_SYSTEM_SRC)/kernel.ld
23 LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_x86_64
24 else
25 CRT_PATH=$(I386_SYSTEM_SRC)
26 CFLAGS+=-m32
27 LINK_SCRIPT=$(I386_SYSTEM_SRC)/kernel.ld
28 LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_i386
29 # FIXME: move to common once x86_64 is bootstrapped
30 TESTS+=$(X86_TESTS)
31 endif
32 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
33 LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
34
35 # building head blobs
36 .PRECIOUS: $(CRT_OBJS)
37
38 %.o: $(CRT_PATH)/%.S
39 $(CC) $(CFLAGS) -c $< -o $@
40
41 # Build and link the tests
42 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
43 $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
44
45 # Running
46 QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel