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
15 CRT_PATH=$(X64_SYSTEM_SRC)
16 LINK_SCRIPT=$(X64_SYSTEM_SRC)/kernel.ld
17 LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_x86_64
18 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
19 LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
21 TESTS+=$(MULTIARCH_TESTS)
24 .PRECIOUS: $(CRT_OBJS)
27 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
29 # Build and link the tests
30 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
31 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
33 memory: CFLAGS+=-DCHECK_UNALIGNED=1
36 QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel