Git Product home page Git Product logo

gba-compiler-docker's Introduction

Docker GBA Complier

Windows people have had a particularly rough time getting up and running with GBA development. Since installing cygwin + devkitPro, updating system paths, and updating the Makefile to match has proven difficult time and time again, this Dockerfile + Makefile represents an attempt to unify things cross-platform in a less brittle way.

Requirements

Docker for Desktop:

Ths following docker build command is no longer required, since the image is now available on Docker Hub as aaaronic/gba-compiler:1.0.

Once docker is installed, you could choose to do a one-time build of the Dockerfile on your machine (from the folder containing the Dockerfile):

    docker build . -t gba-compiler

A few minutes later, you should have a docker image named gba-compiler that you should not need to rebuild (hopefully ever again). It might spend a long time on the "Generating pacman keyring master key..." step).

Running a build (aka, compiling your GBA project)

  1. The provided Makefile needs to be in your GBA project's directory (next to all your .h and .c files).

    • You should (hopefully) not need to change much about the Makefile aside from the PRODUCT_NAME line. It defaults to "Project", which leads to your resulting .gba file being named Project.gba. Feel free to change it to anything without spaces or special characters (ex: "BouncingBox"). You can always rename the resulting file after the compilation instead.
  2. Run the docker image we built above with the following special sauce:

    docker run --rm -it -v ${PWD}:/gba aaaronic/gba-compiler:1.0

or, alternatively (if you chose to do your own docker build locally):

    docker run --rm -it -v ${PWD}:/gba gba-compiler

If the compilation succeeded, you should now see a Project.gba (or whatever you renamed it to) in your project's folder.

Setting it and forgetting it for a project in Visual Studio Code

Copy the included .vscode folder (containing tasks.json) into your project folder. Update tasks.json's "build" command to point to your visualboyadvance-m installation:

Windows example:

    "command": "C:/Users/Aaron/Desktop/visualboyadvance-m.exe ./Project.gba",

Mac Example:

    "command": "open /path/to/visualboyadvance-m.app ./Project.gba",

Note: If you've renamed Project.gba, you should fix that part of the command as well. Also Note: if you did a local docker build and want to use that image, update the docker commands for build and clean accordingly (basically just remove the "aaaronic/" and the ":1.0").

Once that's all set up and happy, the Terminal -> Run Build Task... command in the menu should now compile your project and open the emulator with the result (if the compile succeeds).

Terminal -> Run Task should provide 3 options:

  • build run: build and run the project
  • build: just build the project (but don't run anything).
  • clean: remove all the intermediate files from builds so the next build is from scratch. This is helpful if something buggy is going on or if you've only changed header files and aren't seeing your expected changes in the build.

Acknowledgements

The provided Dockerfile is a fork/combination of the Dockerfiles provided by devkitPro: https://github.com/devkitPro/docker. I have included the GPLv3 License in this repository to match theirs, as this work is derivative.

The example main.c is a nice little demo and I have no clue where it came from. I will provide an acknowledgement here once I know its original author.

gba-compiler-docker's People

Contributors

aaaronic avatar edvardo1 avatar mariezimmy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.