tests/tcg: enable arm softmmu tests
[qemu/ar7.git] / tests / tcg / arm / Makefile.softmmu-target
blobaadc12767e984cb68273985a89d6161b2f2a9c60
1 # -*- Mode: makefile -*-
3 # ARM SoftMMU tests - included from tests/tcg/Makefile
6 ARM_SRC=$(SRC_PATH)/tests/tcg/arm/system
8 # Set search path for all sources
9 VPATH           += $(ARM_SRC)
11 # Specific Test Rules
13 test-armv6m-undef: test-armv6m-undef.S
14         $(CC) -mcpu=cortex-m0 -mfloat-abi=soft \
15                 -Wl,--build-id=none -x assembler-with-cpp \
16                 $< -o $@ -nostdlib -N -static \
17                 -T $(ARM_SRC)/$@.ld
19 run-test-armv6m-undef: QEMU_OPTS+=-semihosting -M microbit -kernel
21 ARM_TESTS+=test-armv6m-undef
23 # These objects provide the basic boot code and helper functions for all tests
24 CRT_OBJS=boot.o
26 ARM_TEST_SRCS=$(wildcard $(ARM_SRC)/*.c)
27 ARM_TESTS+=$(patsubst $(ARM_SRC)/%.c, %, $(ARM_TEST_SRCS))
29 CRT_PATH=$(ARM_SRC)
30 LINK_SCRIPT=$(ARM_SRC)/kernel.ld
31 LDFLAGS=-Wl,-T$(LINK_SCRIPT)
32 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
33 LDFLAGS+=-static -nostdlib -N $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
35 # building head blobs
36 .PRECIOUS: $(CRT_OBJS)
38 %.o: $(ARM_SRC)/%.S
39         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
41 # Build and link the tests
42 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
43         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
45 memory: CFLAGS+=-DCHECK_UNALIGNED=0
47 # Running
48 QEMU_BASE_MACHINE=-M virt -cpu max -display none
49 QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel
51 # Simple Record/Replay Test
52 .PHONY: memory-record
53 run-memory-record: memory-record memory
54         $(call run-test, $<, \
55           $(QEMU) -monitor none -display none \
56                   -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
57                   -icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
58                   $(QEMU_OPTS) memory)
60 .PHONY: memory-replay
61 run-memory-replay: memory-replay run-memory-record
62         $(call run-test, $<, \
63           $(QEMU) -monitor none -display none \
64                   -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
65                   -icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
66                   $(QEMU_OPTS) memory)
68 EXTRA_RUNS+=run-memory-replay
70 TESTS += $(ARM_TESTS) $(MULTIARCH_TESTS)
71 EXTRA_RUNS+=$(MULTIARCH_RUNS)