added support for satellite variants in nix-build

This commit is contained in:
mwojcik 2021-08-31 11:55:34 +02:00
parent db9b744825
commit f80f2ac99d
2 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ let
name = "firmware"; name = "firmware";
src = ./src; src = ./src;
cargoSha256 = "1rsg2cdkwjhjmdhr7ddwlpgw5rl2sq43h4y38p3dj6qr54bhxpck"; cargoSha256 = "sha256-H67cMdQZDnKpr91lEbmGuw4269ekvlEe6XjltLPR9rk=";
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.gnumake pkgs.gnumake
@ -33,7 +33,7 @@ let
export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library" export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library"
export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include" export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include"
export CARGO_HOME=$(mktemp -d cargo-home.XXX) export CARGO_HOME=$(mktemp -d cargo-home.XXX)
make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${if variant == "satellite" then "satman" else "runtime"}
''; '';
installPhase = '' installPhase = ''

View File

@ -1,6 +1,6 @@
TARGET := zc706 TARGET := zc706
GWARGS := -V simple GWARGS := -V simple
SATMAN_GWARGS := -m ../build/mem.rs -V satellite SATMAN_GWARGS := -V satellite
all: runtime all: runtime
@ -11,7 +11,7 @@ runtime: ../build/runtime.bin
../build/pl.rs ../build/rustc-cfg: gateware/* ../build/pl.rs ../build/rustc-cfg: gateware/*
mkdir -p ../build mkdir -p ../build
python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg $(GWARGS) python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs $(GWARGS)
../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg
cd runtime && \ cd runtime && \
@ -25,7 +25,7 @@ runtime: ../build/runtime.bin
satman_cfg: satman_cfg:
mkdir -p ../build mkdir -p ../build
python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg $(SATMAN_GWARGS) python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs $(SATMAN_GWARGS)
satmanout: satman_cfg satmanout: satman_cfg
cd satman && \ cd satman && \