Skip to content

Commit 502023a

Browse files
committed
[ci] thumbv7m-none-eabi: build lm3s6965evb and runon QEMU
1 parent 2747775 commit 502023a

File tree

1 file changed

+40
-0
lines changed
  • src/test/run-make/thumb-none-qemu

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-include ../../run-make-fulldeps/tools.mk
2+
3+
# How to run this
4+
# $ ./x.py clean
5+
# $ ./x.py test --target thumbv7m-none-eabi src/test/run-make
6+
7+
ifeq ($(TARGET),thumbv7m-none-eabi))
8+
9+
# For cargo setting
10+
RUSTC := $(RUSTC_ORIGINAL)
11+
LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
12+
# We need to be outside of 'src' dir in order to run cargo
13+
WORK_DIR := $(TMPDIR)
14+
15+
HERE := $(shell pwd)
16+
17+
CRATE := lm3s6965evb
18+
CRATE_URL := https://github.com/japaric/lm3s6965evb
19+
CRATE_SHA1 := 9eeea58826438e84d89e9691a1bb0f85b03d377c
20+
QEMU_CPU := cortex-m3
21+
QEMU_MACHINE := lm3s6965evb
22+
23+
all:
24+
env
25+
mkdir -p $(WORK_DIR)
26+
-cd $(WORK_DIR) && rm -rf $(CRATE)
27+
cd $(WORK_DIR) && bash -x $(HERE)/../git_clone_sha1.sh $(CRATE) $(CRATE_URL) $(CRATE_SHA1)
28+
cd $(WORK_DIR)/$(CRATE) && $(CARGO) build --target $(TARGET) -v
29+
cd $(WORK_DIR)/$(CRATE) && qemu-system-arm \
30+
-cpu $(QEMU_CPU) \
31+
-machine $(QEMU_MACHINE) \
32+
-semihosting-config enable=on,target=native \
33+
-nographic \
34+
-kernel target/$(TARGET)/debug/$(CRATE) > out.txt
35+
cd $(WORK_DIR)/$(CRATE) && grep "x = 42" out.txt
36+
else
37+
38+
all:
39+
40+
endif

0 commit comments

Comments
 (0)