-include ../../run-make-fulldeps/tools.mk # How to run this # $ ./x.py clean # $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi src/test/run-make # 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)) # We need to be outside of 'src' dir in order to run cargo WORK_DIR := $(RUST_TEST_TMPDIR)/run-make/$(TARGET) CRATE := cortex-m CRATE_VER := 0.5.0 RUSTC := $(RUSTC_ORIGINAL) LD_LIBRARY_PATH := $(HOST_RPATH_DIR) all: env mkdir -p $(WORK_DIR) -cd $(WORK_DIR) && rm -rf $(CRATE) cd $(WORK_DIR) && $(CARGO) clone $(CRATE) --vers $(CRATE_VER) cd $(WORK_DIR) && cd $(CRATE) && $(CARGO) build --target $(TARGET) -v else all: endif