2013-07-06 22:41:37 +04:00
|
|
|
-include ../../../config-host.mak
|
2011-09-06 03:55:57 +04:00
|
|
|
|
2014-02-10 20:20:52 +04:00
|
|
|
CORE=dc232b
|
|
|
|
CROSS=xtensa-$(CORE)-elf-
|
2011-09-06 03:55:57 +04:00
|
|
|
|
|
|
|
ifndef XT
|
2013-07-06 22:41:37 +04:00
|
|
|
SIM = ../../../xtensa-softmmu/qemu-system-xtensa
|
2018-03-23 15:56:19 +03:00
|
|
|
SIMFLAGS = -M sim -cpu $(CORE) -nographic -semihosting -icount 6 $(EXTFLAGS) -kernel
|
2011-09-06 03:55:57 +04:00
|
|
|
SIMDEBUG = -s -S
|
|
|
|
else
|
|
|
|
SIM = xt-run
|
|
|
|
SIMFLAGS = --xtensa-core=DC_B_232L --exit_with_target_code $(EXTFLAGS)
|
|
|
|
SIMDEBUG = --gdbserve=0
|
|
|
|
endif
|
|
|
|
|
2014-09-18 08:13:09 +04:00
|
|
|
HOST_CC = gcc
|
2011-09-06 03:55:57 +04:00
|
|
|
CC = $(CROSS)gcc
|
2013-07-06 22:41:37 +04:00
|
|
|
AS = $(CROSS)gcc -x assembler-with-cpp
|
2011-09-06 03:55:57 +04:00
|
|
|
LD = $(CROSS)ld
|
|
|
|
|
2013-07-06 22:41:37 +04:00
|
|
|
XTENSA_SRC_PATH = $(SRC_PATH)/tests/tcg/xtensa
|
2016-10-11 09:56:52 +03:00
|
|
|
INCLUDE_DIRS = $(XTENSA_SRC_PATH) $(SRC_PATH)/target/xtensa/core-$(CORE)
|
2014-02-10 20:20:52 +04:00
|
|
|
XTENSA_INC = $(addprefix -I,$(INCLUDE_DIRS))
|
2013-07-06 22:41:37 +04:00
|
|
|
|
2014-09-18 08:13:09 +04:00
|
|
|
LDFLAGS = -Tlinker.ld
|
2011-09-06 03:55:57 +04:00
|
|
|
|
|
|
|
CRT = crt.o vectors.o
|
|
|
|
|
|
|
|
TESTCASES += test_b.tst
|
|
|
|
TESTCASES += test_bi.tst
|
|
|
|
#TESTCASES += test_boolean.tst
|
2012-01-13 09:22:07 +04:00
|
|
|
TESTCASES += test_break.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_bz.tst
|
2014-02-11 12:22:19 +04:00
|
|
|
TESTCASES += test_cache.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_clamps.tst
|
2012-12-17 00:32:27 +04:00
|
|
|
TESTCASES += test_extui.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_fail.tst
|
|
|
|
TESTCASES += test_interrupt.tst
|
|
|
|
TESTCASES += test_loop.tst
|
2011-10-10 06:25:41 +04:00
|
|
|
TESTCASES += test_mac16.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_max.tst
|
|
|
|
TESTCASES += test_min.tst
|
|
|
|
TESTCASES += test_mmu.tst
|
|
|
|
TESTCASES += test_mul16.tst
|
|
|
|
TESTCASES += test_mul32.tst
|
|
|
|
TESTCASES += test_nsa.tst
|
|
|
|
ifdef XT
|
|
|
|
TESTCASES += test_pipeline.tst
|
|
|
|
endif
|
|
|
|
TESTCASES += test_quo.tst
|
|
|
|
TESTCASES += test_rem.tst
|
|
|
|
TESTCASES += test_rst0.tst
|
2012-12-05 07:15:26 +04:00
|
|
|
TESTCASES += test_s32c1i.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_sar.tst
|
|
|
|
TESTCASES += test_sext.tst
|
|
|
|
TESTCASES += test_shift.tst
|
2012-12-05 07:15:25 +04:00
|
|
|
TESTCASES += test_sr.tst
|
2011-09-06 03:55:57 +04:00
|
|
|
TESTCASES += test_timer.tst
|
|
|
|
TESTCASES += test_windowed.tst
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
2014-09-18 08:13:09 +04:00
|
|
|
linker.ld: $(XTENSA_SRC_PATH)/linker.ld.S
|
|
|
|
$(HOST_CC) $(XTENSA_INC) -E -P $< -o $@
|
|
|
|
|
2013-07-06 22:41:37 +04:00
|
|
|
%.o: $(XTENSA_SRC_PATH)/%.c
|
2014-02-10 20:20:52 +04:00
|
|
|
$(CC) $(XTENSA_INC) $(CFLAGS) -c $< -o $@
|
2011-09-06 03:55:57 +04:00
|
|
|
|
2013-07-06 22:41:37 +04:00
|
|
|
%.o: $(XTENSA_SRC_PATH)/%.S
|
2014-02-10 20:20:52 +04:00
|
|
|
$(CC) $(XTENSA_INC) $(ASFLAGS) -c $< -o $@
|
2011-09-06 03:55:57 +04:00
|
|
|
|
2014-09-18 08:13:09 +04:00
|
|
|
%.tst: %.o linker.ld $(XTENSA_SRC_PATH)/macros.inc $(CRT) Makefile
|
2011-09-06 03:55:57 +04:00
|
|
|
$(LD) $(LDFLAGS) $(NOSTDFLAGS) $(CRT) $< -o $@
|
|
|
|
|
|
|
|
build: $(TESTCASES)
|
|
|
|
|
|
|
|
check: $(addprefix run-, $(TESTCASES))
|
|
|
|
|
|
|
|
run-%.tst: %.tst
|
|
|
|
$(SIM) $(SIMFLAGS) ./$<
|
|
|
|
|
|
|
|
run-test_fail.tst: test_fail.tst
|
|
|
|
! $(SIM) $(SIMFLAGS) ./$<
|
|
|
|
|
|
|
|
debug-%.tst: %.tst
|
|
|
|
$(SIM) $(SIMDEBUG) $(SIMFLAGS) ./$<
|
|
|
|
|
2012-03-16 01:24:57 +04:00
|
|
|
host-debug-%.tst: %.tst
|
|
|
|
gdb --args $(SIM) $(SIMFLAGS) ./$<
|
|
|
|
|
2011-09-06 03:55:57 +04:00
|
|
|
clean:
|
2014-09-18 08:13:09 +04:00
|
|
|
$(RM) -fr $(TESTCASES) $(CRT) linker.ld
|