mirror of https://github.com/m-labs/artiq.git
39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
extern crate build_artiq;
|
|
extern crate cc;
|
|
|
|
use std::env;
|
|
use std::fs::File;
|
|
use std::io::Write;
|
|
use std::path::PathBuf;
|
|
use std::process::Command;
|
|
|
|
fn build_vectors() {
|
|
println!("cargo:rerun-if-changed=vectors.S");
|
|
cc::Build::new()
|
|
.file("vectors.S")
|
|
.compile("vectors");
|
|
}
|
|
|
|
fn gen_hmc7043_writes() {
|
|
println!("cargo:rerun-if-changed=hmc7043_gen_writes.py");
|
|
println!("cargo:rerun-if-changed=hmc7043_guiexport_6gbps.py");
|
|
|
|
let hmc7043_writes =
|
|
Command::new("python3")
|
|
.arg("hmc7043_gen_writes.py")
|
|
.arg("hmc7043_guiexport_6gbps.py")
|
|
.output()
|
|
.ok()
|
|
.and_then(|o| String::from_utf8(o.stdout).ok())
|
|
.unwrap();
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
let mut f = File::create(out_dir.join("hmc7043_writes.rs")).unwrap();
|
|
write!(f, "{}", hmc7043_writes).unwrap();
|
|
}
|
|
|
|
fn main() {
|
|
build_artiq::misoc_cfg();
|
|
build_vectors();
|
|
gen_hmc7043_writes();
|
|
}
|