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