1# 2# Xtensa system tests 3# 4 5CORE=dc232b 6ifneq ($(shell $(QEMU) -cpu help | grep -w $(CORE)),) 7 8XTENSA_SRC = $(SRC_PATH)/tests/tcg/xtensa 9XTENSA_ALL = $(filter-out $(XTENSA_SRC)/linker.ld.S,$(wildcard $(XTENSA_SRC)/*.S)) 10XTENSA_TESTS = $(patsubst $(XTENSA_SRC)/%.S, %, $(XTENSA_ALL)) 11# Filter out common blobs and broken tests 12XTENSA_BROKEN_TESTS = crt vectors 13XTENSA_USABLE_TESTS = $(filter-out $(XTENSA_BROKEN_TESTS), $(XTENSA_TESTS)) 14 15# add to the list of tests 16TESTS += $(XTENSA_USABLE_TESTS) 17VPATH += $(XTENSA_SRC) 18 19QEMU_OPTS+=-M sim -cpu $(CORE) -nographic -semihosting -icount 6 $(EXTFLAGS) -kernel 20 21INCLUDE_DIRS = $(SRC_PATH)/target/xtensa/core-$(CORE) 22XTENSA_INC = $(addprefix -I,$(INCLUDE_DIRS)) 23 24vectors_ASFLAGS = -mtext-section-literals 25ASFLAGS = -Wa,--no-absolute-literals 26LDFLAGS = -Tlinker.ld -nostartfiles -nostdlib 27 28CRT = crt.o vectors.o 29CLEANFILES += linker.ld 30 31linker.ld: linker.ld.S 32 $(CC) $(XTENSA_INC) -E -P $< -o $@ 33 34$(XTENSA_USABLE_TESTS): linker.ld macros.inc $(CRT) Makefile.softmmu-target 35 36# special rule for common blobs 37%.o: %.S 38 $(CC) $(XTENSA_INC) $($*_ASFLAGS) $(ASFLAGS) $(EXTRA_CFLAGS) -c $< -o $@ 39 40%: %.S 41 $(CC) $(XTENSA_INC) $(ASFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT) 42 43endif 44 45# We don't currently support the multiarch system tests 46undefine MULTIARCH_TESTS 47