~ruther/avr-device

7113a1e138c71a3303c44a49e9f1ff047e1455b8 — Rahix 4 years ago c314463
make: Allow overriding rustup toolchain

Allow overriding the rustup toolchain used for rustfmt by invoking make
like this:

    make RUSTUP_TOOLCHAIN=nightly-2020-07-12

This will (hopefully) help when working with nightly versions where
rustfmt is unavailable.

Signed-off-by: Rahix <rahix@rahix.de>
1 files changed, 3 insertions(+), 1 deletions(-)

M Makefile
M Makefile => Makefile +3 -1
@@ 2,6 2,8 @@ all: deps chips

CHIPS := atmega1280 atmega8 atmega328p atmega32u4 atmega64 attiny85

RUSTUP_TOOLCHAIN ?= nightly

PATCHES := $(foreach chip, $(CHIPS), $(wildcard patch/$(chip).yaml))
DEPS := $(foreach patch, $(PATCHES), $(patsubst patch/%.yaml, .deps/%.d, $(patch)))



@@ 41,7 43,7 @@ src/devices/%/mod.rs: src/devices/%/mod.full.rs
	@RUST_LOG=WARN form -i $< -o $(@D) >/dev/null
	@rm $<
	@mv $(@D)/lib.rs $@
	@RUSTUP_TOOLCHAIN=nightly rustfmt $@
	@RUSTUP_TOOLCHAIN=$(RUSTUP_TOOLCHAIN) rustfmt $@
	@# Remove the `extern crate` lines
	@sed -i'' -e "1,7d" $@
	@# Remove DEVICE_PERIPHERALS declaration and replace it with a reference

Do not follow this link