Initial commit

This commit is contained in:
Sebastian Bergmann 2018-03-29 09:57:03 +02:00
commit ee047c1e99
5 changed files with 191 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/test

49
Dockerfile Normal file
View File

@ -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

80
README.md Normal file
View File

@ -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 <proto/exec.h>
#include <proto/dos.h>
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 <stdio.h>
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!
```

60
build.xml Normal file
View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="docker-amiga-gcc" default="build">
<target name="clean">
<delete dir="${basedir}/test"/>
</target>
<target name="build">
<exec executable="docker" taskname="docker">
<arg value="build"/>
<arg value="--pull"/>
<arg value="--tag"/>
<arg value="sebastianbergmann/amiga-gcc:latest"/>
<arg path="${basedir}"/>
</exec>
</target>
<target name="test" depends="build">
<mkdir dir="${basedir}/test"/>
<get src="https://raw.githubusercontent.com/Sakura-IT/Amiga-programming-examples/master/C/hello-world-amiga/hello.c"
dest="${basedir}/test/hello.c"
skipexisting="true"/>
<exec executable="docker" taskname="docker">
<arg value="run"/>
<arg value="--rm"/>
<arg value="--volume"/>
<arg value="${basedir}/test:/host"/>
<arg value="sebastianbergmann/amiga-gcc:latest"/>
<arg value="m68k-amigaos-gcc"/>
<arg value="/host/hello.c"/>
<arg value="-o"/>
<arg value="/host/hello"/>
<arg value="-noixemul"/>
</exec>
<exec executable="docker" taskname="docker" outputproperty="hello.c">
<arg value="run"/>
<arg value="--rm"/>
<arg value="--volume"/>
<arg value="${basedir}/test:/host"/>
<arg value="sebastianbergmann/amitools:latest"/>
<arg value="vamos"/>
<arg value="-C"/>
<arg value="68020"/>
<arg value="/host/hello"/>
</exec>
<fail message="hello.c could not be compiled and executed">
<condition>
<not>
<equals arg1="${hello.c}" arg2="Hello world!"/>
</not>
</condition>
</fail>
<delete file="${basedir}/test/hello"/>
</target>
</project>

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB