2023-03-30 12:58:50 +00:00
|
|
|
include ../tools.mk
|
2018-08-07 19:02:02 +00:00
|
|
|
|
|
|
|
# How to run this
|
2018-08-08 10:17:00 +00:00
|
|
|
# $ ./x.py clean
|
2023-01-05 08:45:44 +00:00
|
|
|
# $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
|
2018-08-06 13:19:00 +00:00
|
|
|
|
2018-08-08 10:17:00 +00: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)
|
|
|
|
|
2020-01-13 23:42:19 +00:00
|
|
|
# only-thumb
|
2018-08-06 13:19:00 +00:00
|
|
|
|
2018-08-14 13:40:30 +00:00
|
|
|
# For cargo setting
|
|
|
|
RUSTC := $(RUSTC_ORIGINAL)
|
|
|
|
LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
|
2018-08-08 09:41:05 +00:00
|
|
|
# We need to be outside of 'src' dir in order to run cargo
|
2018-08-14 13:38:27 +00:00
|
|
|
WORK_DIR := $(TMPDIR)
|
2018-08-14 13:40:30 +00:00
|
|
|
|
2018-08-14 13:35:11 +00:00
|
|
|
HERE := $(shell pwd)
|
2018-08-08 09:41:05 +00:00
|
|
|
|
2018-08-06 13:19:00 +00:00
|
|
|
CRATE := cortex-m
|
2018-08-14 13:35:11 +00:00
|
|
|
CRATE_URL := https://github.com/rust-embedded/cortex-m
|
|
|
|
CRATE_SHA1 := a448e9156e2cb1e556e5441fd65426952ef4b927 # 0.5.0
|
2018-08-08 09:41:05 +00:00
|
|
|
|
2020-01-13 23:42:19 +00:00
|
|
|
# Don't make lints fatal, but they need to at least warn or they break Cargo's target info parsing.
|
|
|
|
export RUSTFLAGS := --cap-lints=warn
|
2018-09-21 22:58:11 +00:00
|
|
|
|
2018-08-06 13:19:00 +00:00
|
|
|
all:
|
2018-08-08 09:41:05 +00:00
|
|
|
env
|
|
|
|
mkdir -p $(WORK_DIR)
|
|
|
|
-cd $(WORK_DIR) && rm -rf $(CRATE)
|
2018-08-14 13:35:11 +00:00
|
|
|
cd $(WORK_DIR) && bash -x $(HERE)/../git_clone_sha1.sh $(CRATE) $(CRATE_URL) $(CRATE_SHA1)
|
2018-11-24 07:31:01 +00:00
|
|
|
# HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features.
|
|
|
|
# These come from the top-level Rust workspace, that this crate is not a
|
|
|
|
# member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
|
2020-09-10 14:17:32 +00:00
|
|
|
cd $(WORK_DIR) && cd $(CRATE) && env RUSTC_BOOTSTRAP=1 $(BOOTSTRAP_CARGO) build --target $(TARGET) -v
|