mirror of https://github.com/m-labs/artiq.git
cargo: use cargo xbuild
This commit is contained in:
parent
9f6b3f6014
commit
dcbd9f905c
|
@ -3,11 +3,15 @@ include $(MISOC_DIRECTORY)/software/common.mak
|
|||
|
||||
RUSTFLAGS += -Cpanic=abort
|
||||
|
||||
export XBUILD_SYSROOT_PATH=$(BUILDINC_DIRECTORY)/../sysroot
|
||||
|
||||
all:: bootloader.bin
|
||||
|
||||
.PHONY: $(RUSTOUT)/libbootloader.a
|
||||
$(RUSTOUT)/libbootloader.a:
|
||||
$(cargo) --manifest-path $(BOOTLOADER_DIRECTORY)/Cargo.toml
|
||||
$(cargo) --target-dir ./cargo \
|
||||
--manifest-path $(BOOTLOADER_DIRECTORY)/Cargo.toml \
|
||||
--target $(BOOTLOADER_DIRECTORY)/../riscv32ima-unknown-none-elf.json
|
||||
|
||||
bootloader.elf: $(RUSTOUT)/libbootloader.a
|
||||
$(link) -T $(BOOTLOADER_DIRECTORY)/bootloader.ld
|
||||
|
|
|
@ -14,11 +14,15 @@ LDFLAGS += --eh-frame-hdr \
|
|||
|
||||
RUSTFLAGS += -Cpanic=unwind
|
||||
|
||||
export XBUILD_SYSROOT_PATH=$(BUILDINC_DIRECTORY)/../sysroot
|
||||
|
||||
all:: ksupport.elf
|
||||
|
||||
.PHONY: $(RUSTOUT)/libksupport.a
|
||||
$(RUSTOUT)/libksupport.a:
|
||||
$(cargo) --manifest-path $(KSUPPORT_DIRECTORY)/Cargo.toml
|
||||
$(cargo) --target-dir ./cargo \
|
||||
--manifest-path $(KSUPPORT_DIRECTORY)/Cargo.toml \
|
||||
--target $(KSUPPORT_DIRECTORY)/../riscv32ima-unknown-none-elf.json
|
||||
|
||||
ksupport.elf: $(RUSTOUT)/libksupport.a glue.o
|
||||
$(link) -T $(KSUPPORT_DIRECTORY)/ksupport.ld \
|
||||
|
|
|
@ -10,11 +10,15 @@ LDFLAGS += \
|
|||
|
||||
RUSTFLAGS += -Cpanic=unwind
|
||||
|
||||
export XBUILD_SYSROOT_PATH=$(BUILDINC_DIRECTORY)/../sysroot
|
||||
|
||||
all:: runtime.bin runtime.fbi
|
||||
|
||||
.PHONY: $(RUSTOUT)/libruntime.a
|
||||
$(RUSTOUT)/libruntime.a:
|
||||
$(cargo) --manifest-path $(RUNTIME_DIRECTORY)/Cargo.toml
|
||||
$(cargo) --target-dir ./cargo \
|
||||
--manifest-path $(RUNTIME_DIRECTORY)/Cargo.toml \
|
||||
--target $(RUNTIME_DIRECTORY)/../riscv32ima-unknown-none-elf.json
|
||||
|
||||
runtime.elf: $(RUSTOUT)/libruntime.a ksupport_data.o
|
||||
$(link) -T $(RUNTIME_DIRECTORY)/runtime.ld \
|
||||
|
|
|
@ -9,7 +9,9 @@ all:: satman.bin satman.fbi
|
|||
|
||||
.PHONY: $(RUSTOUT)/libsatman.a
|
||||
$(RUSTOUT)/libsatman.a:
|
||||
$(cargo) --manifest-path $(SATMAN_DIRECTORY)/Cargo.toml
|
||||
$(cargo) --target-dir ./cargo \
|
||||
--manifest-path $(SATMAN_DIRECTORY)/Cargo.toml \
|
||||
--target $(SATMAN_DIRECTORY)/../riscv32ima-unknown-none-elf.json
|
||||
|
||||
satman.elf: $(RUSTOUT)/libsatman.a
|
||||
$(link) -T $(SATMAN_DIRECTORY)/satman.ld
|
||||
|
|
15
flake.nix
15
flake.nix
|
@ -180,6 +180,20 @@
|
|||
propagatedBuildInputs = with pkgs.python3Packages; [ jinja2 numpy migen pyserial asyncserial ];
|
||||
};
|
||||
|
||||
cargo-xbuild = rustPlatform.buildRustPackage rec {
|
||||
pname = "cargo-xbuild";
|
||||
version = "0.6.5";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "rust-osdev";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "18djvygq9v8rmfchvi2hfj0i6fhn36m716vqndqnj56fiqviwxvf";
|
||||
};
|
||||
|
||||
cargoSha256 = "13sj9j9kl6js75h9xq0yidxy63vixxm9q3f8jil6ymarml5wkhx8";
|
||||
};
|
||||
|
||||
vivadoEnv = pkgs.buildFHSUserEnv {
|
||||
name = "vivado-env";
|
||||
targetPkgs = vivadoDeps;
|
||||
|
@ -211,6 +225,7 @@
|
|||
pkgs.lld_11
|
||||
vivado
|
||||
rustPlatform.cargoSetupHook
|
||||
cargo-xbuild
|
||||
];
|
||||
buildPhase =
|
||||
''
|
||||
|
|
Loading…
Reference in New Issue