commit ee047c1e99c57d9f59f421a649244ca0f0557187 Author: Sebastian Bergmann Date: Thu Mar 29 09:57:03 2018 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50f9751 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/test + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..15d6a7e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +FROM ubuntu:18.04 + +RUN apt-get update && apt-get install -y \ + autoconf \ + flex \ + g++ \ + gcc \ + gettext \ + git \ + lhasa \ + libgmpxx4ldbl \ + libgmp-dev \ + libmpfr6 \ + libmpfr-dev \ + libmpc3 \ + libmpc-dev \ + make \ + rsync \ + texinfo\ + wget \ + && rm -rf /var/lib/apt/lists/* && \ + cd /root && \ + git clone https://github.com/bebbo/amiga-gcc.git && \ + cd /root/amiga-gcc && \ + git checkout -qf 15aa4f3ab3054ba9dad32dd362ecaf7ff11410d3 && \ + mkdir -p /opt/amiga && \ + make update && \ + make all && \ + cd / && \ + rm -rf /root/amiga-gcc && \ + apt-get purge -y \ + autoconf \ + flex \ + g++ \ + gcc \ + gettext \ + git \ + lhasa \ + libgmp-dev \ + libmpfr-dev \ + libmpc-dev \ + make \ + rsync \ + texinfo\ + wget \ + && apt-get -y autoremove + +ENV PATH /opt/amiga/bin:$PATH + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e6041b0 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +# Dockerfile for AmigaOS Cross-Compiler Toolchain + +`Dockerfile` for [Stefan "Bebbo" Franke](https://github.com/bebbo)'s [amiga-gcc](https://github.com/bebbo/amiga-gcc) toolchain for Linux/AmigaOS cross-development. + +A ready-to-use image built from this Dockerfile is available on [Docker Hub](https://hub.docker.com/r/sebastianbergmann/amiga-gcc/). + + +## "Hello world!" Example + +### AmigaOS C API + +`hello.c` from [Radosław Kujawa](https://github.com/Sakura-IT/Amiga-programming-examples/tree/master/C/hello-world-amiga): + +```c +#include +#include + +int main(int argc, void *argv[]) +{ + struct Library *SysBase; + struct Library *DOSBase; + + SysBase = *((struct Library **)4UL); + DOSBase = OpenLibrary("dos.library", 0); + + if (DOSBase) { + Write(Output(), "Hello world!\n", 13); + CloseLibrary(DOSBase); + } + + return(0); +} +``` + + +### Standard C Library + +`hello.c` from [Radosław Kujawa](https://github.com/Sakura-IT/Amiga-programming-examples/tree/master/C/hello-world): + +```c +#include + +int main() +{ + printf("Hello world!\n"); + + return(0); +} +``` + + +### Compilation + +``` +$ docker run -v $HOME:/host -it sebastianbergmann/amiga-gcc \ + m68k-amigaos-gcc /host/hello.c -o /host/hello -noixemul +``` + + +### Execution + +#### Docker-ized Emulation using FS-UAE + +The `docker-execute-amiga` script used below can be downloaded from [here](https://raw.githubusercontent.com/sebastianbergmann/docker-execute-amiga/master/docker-execute-amiga.sh). + +``` +$ docker-execute-amiga helloworld +``` + +![Screenshot](screenshot.png) + + +#### Docker-ized Emulation using Virtual AmigaOS (vamos) + +``` +$ docker run -v $HOME:/host sebastianbergmann/amitools:latest \ + vamos -C 68020 /host/hello +Hello world! +``` + diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..2475644 --- /dev/null +++ b/build.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..e8fb0cf Binary files /dev/null and b/screenshot.png differ