```bash
if [ $(uname -s) == "Darwin" ]; then git clone https://github.com/immunant/c2rust cd c2rust scripts/provision_mac.sh cargo build --release cp target/release/c2rust $HOME/.cargo/bin cp target/release/c2rust-transpile $HOME/.cargo/bin cp target/release/c2rust-analyze $HOME/.cargo/bin cp target/release/c2rust-instrument $HOME/.cargo/bin brew install bear export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH cargo install crusts elif [ $(uname -s) == "Linux" ]; then cargo install c2rust apt-get install bear export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH cargo install crusts else docker pull yijun/crusts fi ```
Run crusts
in the folder where there is a Makefile
.
bash
crusts
or
bash
docker run -v $(pwd):/mnt -t yijun/crusts
As a result, Rust code will be generated from the C code:
src/*.rs -- contains the refactored Rust code from the C code;
build.rs lib.rs -- contains the builder Rust code;