2018-08-07 14:02:02 -05:00
|
|
|
-include ../../run-make-fulldeps/tools.mk
|
|
|
|
|
|
|
|
# How to run this
|
2018-08-08 05:17:00 -05:00
|
|
|
# $ ./x.py clean
|
|
|
|
# $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi src/test/run-make
|
2018-08-06 08:19:00 -05:00
|
|
|
|
2018-08-08 05:17:00 -05:00
|
|
|
# Supported targets:
|
|
|
|
# - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
|
|
|
|
# - thumbv7em-none-eabi (Bare Cortex-M4, M7)
|
|
|
|
# - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
|
|
|
|
# - thumbv7m-none-eabi (Bare Cortex-M3)
|
|
|
|
|
|
|
|
# See https://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or
|
|
|
|
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi))
|
2018-08-06 08:19:00 -05:00
|
|
|
|
2018-08-08 04:41:05 -05:00
|
|
|
# We need to be outside of 'src' dir in order to run cargo
|
|
|
|
WORK_DIR := $(RUST_TEST_TMPDIR)/run-make/$(TARGET)
|
2018-08-14 08:35:11 -05:00
|
|
|
HERE := $(shell pwd)
|
2018-08-08 04:41:05 -05:00
|
|
|
|
2018-08-06 08:19:00 -05:00
|
|
|
CRATE := cortex-m
|
2018-08-14 08:35:11 -05:00
|
|
|
CRATE_URL := https://github.com/rust-embedded/cortex-m
|
|
|
|
CRATE_SHA1 := a448e9156e2cb1e556e5441fd65426952ef4b927 # 0.5.0
|
2018-08-08 04:41:05 -05:00
|
|
|
|
2018-08-07 14:02:02 -05:00
|
|
|
RUSTC := $(RUSTC_ORIGINAL)
|
|
|
|
LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
|
2018-08-06 08:19:00 -05:00
|
|
|
|
|
|
|
all:
|
2018-08-08 04:41:05 -05:00
|
|
|
env
|
|
|
|
mkdir -p $(WORK_DIR)
|
|
|
|
-cd $(WORK_DIR) && rm -rf $(CRATE)
|
2018-08-14 08:35:11 -05:00
|
|
|
cd $(WORK_DIR) && bash -x $(HERE)/../git_clone_sha1.sh $(CRATE) $(CRATE_URL) $(CRATE_SHA1)
|
2018-08-09 23:35:12 -05:00
|
|
|
cd $(WORK_DIR) && cd $(CRATE) && $(CARGO) build --target $(TARGET) -v
|
2018-08-06 08:19:00 -05:00
|
|
|
else
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
endif
|