Merge pull request #1 from gwilymk/add-dockerfile

Add dockerfile
This commit is contained in:
Corwin 2021-03-06 23:16:46 +00:00 committed by GitHub
commit 3978e64cff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 3 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
*

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM devkitpro/devkitarm:20190212
RUN apt-get update && \
apt-get install -y build-essential && \
apt-get clean
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
RUN . "$HOME/.cargo/env" && \
cargo install cargo-xbuild && \
rustup component add rust-src
RUN echo 'export PATH=$PATH:$DEVKITARM/bin' >> $HOME/.bashrc
CMD /bin/bash

View file

@ -21,12 +21,12 @@ out/release/%.gba: cargo-release-%
d-%: out/debug/%.gba d-%: out/debug/%.gba
@OUTNAME=$(patsubst d-%,%,$@) @OUTNAME=$(patsubst d-%,%,$@)
@mgba-qt $< @mgba-qt $<
@rm out/debug/$${OUTNAME}.sav @rm -f out/debug/$${OUTNAME}.sav
r-%: out/release/%.gba r-%: out/release/%.gba
@OUTNAME=$(patsubst r-%,%,$@) @OUTNAME=$(patsubst r-%,%,$@)
@mgba-qt $< @mgba-qt $<
@rm out/release/$${OUTNAME}.sav @rm -f out/release/$${OUTNAME}.sav
cargo-release-%: $(RUSTFILES) out/crt0.o cargo-release-%: $(RUSTFILES) out/crt0.o
@OUTNAME=$(patsubst cargo-release-%,%, $@) @OUTNAME=$(patsubst cargo-release-%,%, $@)
@ -37,7 +37,7 @@ cargo-debug-%: $(RUSTFILES) out/crt0.o
@rustup run nightly cargo xbuild --target=gba.json --example=$${OUTNAME} @rustup run nightly cargo xbuild --target=gba.json --example=$${OUTNAME}
out/crt0.o: crt0.s interrupt_simple.s out/crt0.o: crt0.s interrupt_simple.s
@mkdir $(dir $@) @mkdir -p $(dir $@)
@$(CC) $(ARCH) -o out/crt0.o crt0.s @$(CC) $(ARCH) -o out/crt0.o crt0.s
clippy: clippy:

4
start-dev.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
docker build . -t rustgba-dev
docker run --rm --volume $PWD:/build -it --workdir "/build" rustgba-dev