1# -*- Mode: makefile -*- 2# 3# Cris tests 4# 5# Currently we can only build the "bare" tests with the docker 6# supplied cross-compiler. 7# 8 9CRIS_SRC = $(SRC_PATH)/tests/tcg/cris/bare 10CRIS_ALL = $(wildcard $(CRIS_SRC)/*.s) 11CRIS_TESTS = $(patsubst $(CRIS_SRC)/%.s, %, $(CRIS_ALL)) 12# Filter out common blobs and broken tests 13CRIS_BROKEN_TESTS = crt check_jsr 14# upstream GCC doesn't support v32 15CRIS_BROKEN_TESTS += check_mcp check_mulv32 check_addiv32 check_movpmv32 16CRIS_BROKEN_TESTS += check_movprv32 check_clearfv32 check_movemrv32 check_bas 17CRIS_BROKEN_TESTS += check_lapc check_movei 18# no sure why 19CRIS_BROKEN_TESTS += check_scc check_xarith 20 21CRIS_USABLE_TESTS = $(filter-out $(CRIS_BROKEN_TESTS), $(CRIS_TESTS)) 22CRIS_RUNS = $(patsubst %, run-%, $(CRIS_USABLE_TESTS)) 23 24# override the list of tests, as we can't build the multiarch tests 25TESTS = $(CRIS_USABLE_TESTS) 26VPATH = $(CRIS_SRC) 27 28AS = $(CC) -x assembler-with-cpp 29LD = $(CC) 30 31# we rely on GCC inline:ing the stuff we tell it to in many places here. 32CFLAGS = -Winline -Wall -g -O2 -static 33NOSTDFLAGS = -nostartfiles -nostdlib 34ASFLAGS += -mcpu=v10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare 35CRT_FILES = crt.o sys.o 36 37# stop make deleting crt files if build fails 38.PRECIOUS: $(CRT_FILES) 39 40%.o: %.c 41 $(CC) -c $< -o $@ 42 43%.o: %.s 44 $(AS) $(ASFLAGS) -c $< -o $@ 45 46%: %.s $(CRT_FILES) 47 $(CC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT_FILES) 48 49# The default CPU breaks (possibly as it's max?) so force crisv17 50QEMU_OPTS=-cpu crisv17 51 52# Additional runners to run under GNU SIM 53CRIS_RUNS_ON_SIM=$(patsubst %, %-on-sim, $(CRIS_RUNS)) 54SIMG:=cris-axis-linux-gnu-run 55 56# e.g.: make -f ../../tests/tcg/Makefile run-check_orm-on-sim 57run-%-on-sim: 58 $(call run-test, $<, $(SIMG) $<, "$< on $(TARGET_NAME) with SIM") 59