xref: /openbmc/qemu/tests/tcg/cris/Makefile.target (revision 73b49878)
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)
26EXTRA_RUNS =
27VPATH = $(CRIS_SRC)
28
29AS	= $(CC) -x assembler-with-cpp
30LD      = $(CC)
31
32# we rely on GCC inline:ing the stuff we tell it to in many places here.
33CFLAGS  = -Winline -Wall -g -O2 -static -fno-stack-protector
34NOSTDFLAGS = -nostartfiles -nostdlib
35ASFLAGS += -mcpu=v10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare
36CRT_FILES = crt.o sys.o
37
38# stop make deleting crt files if build fails
39.PRECIOUS: $(CRT_FILES)
40
41%.o: %.c
42	$(CC) -c $< -o $@
43
44%.o: %.s
45	$(AS) $(ASFLAGS) -c $< -o $@
46
47%: %.s $(CRT_FILES)
48	$(CC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT_FILES)
49
50# The default CPU breaks (possibly as it's max?) so force crisv17
51QEMU_OPTS=-cpu crisv17
52
53# Additional runners to run under GNU SIM
54CRIS_RUNS_ON_SIM=$(patsubst %, %-on-sim, $(CRIS_RUNS))
55SIMG:=cris-axis-linux-gnu-run
56
57# e.g.: make -f ../../tests/tcg/Makefile run-check_orm-on-sim
58run-%-on-sim:
59	$(call run-test, $<, $(SIMG) $<)
60
61# We don't currently support the multiarch tests
62undefine MULTIARCH_TESTS
63