mirror of
https://github.com/pret/pokeemerald.git
synced 2026-05-15 07:50:05 -05:00
feat: add Docker build environment
Ubuntu 24.04 container with ARM cross-compilation toolchain for building the ROM without host toolchain setup. Includes Makefile targets for docker-build, docker-shell, and docker-clean. Co-Authored-By: Claude
This commit is contained in:
parent
30185ea16b
commit
7d8c2b8ff6
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.git
|
||||
.gitignore
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
build/**
|
||||
30
DOCKER.md
Normal file
30
DOCKER.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Docker
|
||||
|
||||
Build pokeemerald without installing the toolchain on your host machine.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Docker](https://docs.docker.com/get-docker/) with Compose v2
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Build the ROM
|
||||
make docker-build
|
||||
|
||||
# Open a shell inside the container
|
||||
make docker-shell
|
||||
|
||||
# Clean build artifacts
|
||||
make docker-clean
|
||||
```
|
||||
|
||||
The output ROM is written to `pokeemerald_modern.gba` in the project root.
|
||||
|
||||
## How it works
|
||||
|
||||
The container is an Ubuntu 24.04 image with the ARM cross-compilation toolchain (`gcc-arm-none-eabi`, `binutils-arm-none-eabi`) and build dependencies pre-installed. Your project directory is volume-mounted into the container at `/workspace`, so source edits on the host are immediately reflected.
|
||||
|
||||
The build uses `MODERN=1`, which compiles with the system `arm-none-eabi-gcc` rather than the legacy `agbcc` compiler. A persistent Docker volume caches `ccache` data across builds to speed up recompilation.
|
||||
|
||||
On first run, Docker will build the image - subsequent runs reuse the cached image.
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM ubuntu:24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV PATH="/usr/lib/ccache:${PATH}"
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
binutils-arm-none-eabi \
|
||||
gcc-arm-none-eabi \
|
||||
git \
|
||||
make \
|
||||
python3 \
|
||||
ccache \
|
||||
libpng-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
CMD ["bash"]
|
||||
12
Makefile
12
Makefile
|
|
@ -389,3 +389,15 @@ $(ROM): $(ELF)
|
|||
# Symbol file (`make syms`)
|
||||
$(SYM): $(ELF)
|
||||
$(OBJDUMP) -t $< | sort -u | grep -E "^0[2389]" | $(PERL) -p -e 's/^(\w{8}) (\w).{6} \S+\t(\w{8}) (\S+)$$/\1 \2 \3 \4/g' > $@
|
||||
|
||||
# Docker
|
||||
.PHONY: docker-build docker-shell docker-clean
|
||||
|
||||
docker-build:
|
||||
HOST_UID=$$(id -u) HOST_GID=$$(id -g) docker compose run --rm pokeemerald
|
||||
|
||||
docker-shell:
|
||||
HOST_UID=$$(id -u) HOST_GID=$$(id -g) docker compose run --rm pokeemerald bash
|
||||
|
||||
docker-clean:
|
||||
HOST_UID=$$(id -u) HOST_GID=$$(id -g) docker compose run --rm pokeemerald make clean
|
||||
|
|
|
|||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
services:
|
||||
pokeemerald:
|
||||
build: .
|
||||
working_dir: /workspace
|
||||
environment:
|
||||
CCACHE_DIR: /ccache
|
||||
volumes:
|
||||
- ./:/workspace
|
||||
- pokeemerald_ccache:/ccache
|
||||
command: bash -lc "make clean-tools && make MODERN=1 -j$$(nproc)"
|
||||
|
||||
volumes:
|
||||
pokeemerald_ccache:
|
||||
Loading…
Reference in New Issue
Block a user