diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f3bb7ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.git/ +.gitignore +.gitattributes +.github/ +output/ +installer/output/ +*.bin +html_data.c +html_data.h +*.o +*.rel +*.lst +*.sym +*.asm +*.ihx +*.img +*.map +*.mem +*.lk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ed31e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM debian:13-slim + +RUN apt-get update && apt-get install -y \ + make \ + gcc \ + sdcc \ + xxd \ + python3 \ + libjson-c-dev \ + golang-go \ + git \ + && rm -rf /var/lib/apt/lists/* + +# git safe.directory for mounted repos (Makefile uses git describe) +RUN git config --global --add safe.directory /workspace + +WORKDIR /workspace + +CMD ["bash"] diff --git a/README.md b/README.md index a1d11bf..9044a0c 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,42 @@ still has an older version of sdcc, but you will need sdcc version 4.5 for the c sudo apt install make gcc sdcc xxd python-is-python3 libjson-c-dev ``` +
+If using Docker (click to expand) + +A Dockerfile is provided for a reproducible build environment: + +``` +docker build -t rtlplayground-dev . +``` + +Build the firmware (replace MACHINE with your target, e.g. `DEFAULT_8C_1SFP`): + +``` +docker run --rm -v $(pwd):/workspace rtlplayground-dev make MACHINE=DEFAULT_8C_1SFP +``` + +The resulting `.bin` file appears in `output/` on your host. + +Build host tools only: + +``` +docker run --rm -v $(pwd):/workspace rtlplayground-dev make -C tools +``` + +Run the web-interface simulator locally: + +``` +docker run --rm -p 8080:8080 -v $(pwd):/workspace rtlplayground-dev \ + tools/output/httpd_sim /workspace/html +``` + +Edit `machine.h` or `config.txt` on your host, then re-run `make` — the +source directory is mounted into the container, so changes take effect +immediately. To build for a different machine, pass `MACHINE=...`. + +
+ ## (1) Compiling for direct chip flashing AND upgrading an existing RTLPlayground running device Edit machine.h with an editor like vi or nano. Select the correct machine the firmware should build for.