-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
82 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
[target.armv5te-unknown-linux-gnueabi] | ||
linker = "/usr/bin/arm-linux-gnueabi-gcc" | ||
|
||
[target.armv5te-unknown-linux-musleabi] | ||
linker = "rust-lld" | ||
|
||
[source.crates-io] | ||
replace-with = "vendored-sources" | ||
|
||
[source.vendored-sources] | ||
directory = "vendor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
build-example-attributes: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/attributes pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/attributes" | ||
all: build strip | ||
|
||
build-example-buttons: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/buttons pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/buttons" | ||
build: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
cargo build --release --examples --target armv5te-unknown-linux-musleabi | ||
|
||
build-example-color-sensor: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/color-sensor pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/color-sensor" | ||
strip: strip-buttons strip-color-sensor strip-custom-attributes strip-infrared-sensor strip-motors | ||
|
||
build-example-infrared-sensor: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/infrared-sensor pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/infrared-sensor" | ||
|
||
build-example-motors: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/motors pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/motors" | ||
|
||
build-example-screen: | ||
docker run --rm -v $(PWD):/ev3dev-lang-rust/ -w /ev3dev-lang-rust/examples/screen pixix4/ev3dev-rust /bin/bash -c "cargo build --release --target armv5te-unknown-linux-gnueabi && /usr/bin/arm-linux-gnueabi-strip /ev3dev-lang-rust/target/armv5te-unknown-linux-gnueabi/release/screen" | ||
|
||
build-examples: build-example-attributes build-example-buttons build-example-color-sensor build-example-infrared-sensor build-example-screen | ||
|
||
clean: | ||
cargo clean | ||
strip-buttons: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/examples/buttons | ||
strip-color-sensor: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/examples/color-sensor | ||
strip-custom-attributes: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/examples/custom-attributes | ||
strip-infrared-sensor: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/examples/infrared-sensor | ||
strip-motors: | ||
docker run --rm -v $(PWD):/build -w /build pixix4/ev3dev-rust:latest \ | ||
arm-linux-gnueabi-strip /build/target/armv5te-unknown-linux-musleabi/release/examples/motors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
FROM debian:stretch | ||
FROM debian:stretch-slim | ||
|
||
RUN dpkg --add-architecture armel | ||
RUN apt update | ||
|
||
# Fix debian package alias | ||
RUN apt-get update | ||
RUN sed -i "s#deb http://security.debian.org/debian-security stretch/updates main#deb http://deb.debian.org/debian-security stretch/updates main#g" /etc/apt/sources.list | ||
|
||
# Install curl for rust installation | ||
# Install g++ as buildscript compiler | ||
# Install g++-arm-linux-gnueabi as cross compiler | ||
RUN apt --yes install curl g++ g++-arm-linux-gnueabi crossbuild-essential-armel | ||
RUN apt-get --yes install curl cmake pkg-config clang g++ g++-arm-linux-gnueabi crossbuild-essential-armel libssl-dev libssl-dev:armel libclang-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Instull rust for host platform | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
ENV PATH "$PATH:/root/.cargo/bin" | ||
|
||
# Add stdlib for target platform | ||
RUN rustup target add armv5te-unknown-linux-gnueabi | ||
|
||
# docker build . -t pixix4/ev3dev-rust --no-cache | ||
RUN rustup target add armv5te-unknown-linux-musleabi armv5te-unknown-linux-gnueabi | ||
|
||
# docker run -it --rm -v $PWD:/build/ -w /build pixix4/ev3dev-rust | ||
# cargo build --release --target armv5te-unknown-linux-gnueabi | ||
ENV PKG_CONFIG_SYSROOT_DIR /usr/arm-linux-gnueabi/ | ||
ENV CC_armv5te_unknown_linux_gnueabi arm-linux-gnueabi-gcc | ||
ENV CXX_armv5te_unknown_linux_gnueabi arm-linux-gnueabi-g++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.