From b11ae9830db37524d0e44f335cbb920c6f39c8b3 Mon Sep 17 00:00:00 2001 From: Rahix Date: Sun, 26 May 2019 10:36:33 +0100 Subject: [PATCH] Add build-script to auto-generate chip-defs Signed-off-by: Rahix --- Cargo.toml | 1 + build.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 build.rs diff --git a/Cargo.toml b/Cargo.toml index 5ad63cc..506f5fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "avr-device" version = "0.1.0" authors = ["Rahix "] edition = "2018" +build = "build.rs" [features] atmega1280 = [] diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..23d9c25 --- /dev/null +++ b/build.rs @@ -0,0 +1,22 @@ +use std::process; + +fn main() { + // Just run `make` to generate the chip definitions + if !process::Command::new("make").status().unwrap().success() { + eprintln!(" +avr-device: Running `make` resulted in a failure. + + Please make sure, you have all dependencies + installed. They are: + - atdf2svd + - svd2rust + - form + - rustfmt (for the toolchain you are using!) + - PyYAML + + For more info, look at README file: + https://github.com/Rahix/avr-device/blob/master/README.md +"); + panic!("make failed"); + } +} -- 2.48.1