Skip to content

Instantly share code, notes, and snippets.

@Ced2911
Last active February 20, 2021 01:17
Show Gist options
  • Save Ced2911/ac694b6c7b3679278a1e9a7e810bac22 to your computer and use it in GitHub Desktop.
Save Ced2911/ac694b6c7b3679278a1e9a7e810bac22 to your computer and use it in GitHub Desktop.
Docker libyaul
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_OPTION_DEV_CARTRIDGE=0
ARG BUILD_OPTION_MALLOC_IMPL="tlsf"
ARG BUILD_OPTION_SPIN_ON_ABORT=1
ARG BUILD_CDB=1
ENV YAUL_INSTALL_ROOT=/opt/tool-chains/sh-elf
ENV YAUL_PROG_SH_PREFIX=
ENV YAUL_ARCH_SH_PREFIX=sh-elf
ENV YAUL_BUILD_ROOT=/tmp
ENV YAUL_BUILD=build
ENV YAUL_ARCH_M68K_PREFIX=m68keb-elf
ENV YAUL_PREFIX=""
ENV YAUL_CDB=$BUILD_CDB
ENV YAUL_OPTION_DEV_CARTRIDGE=$BUILD_OPTION_DEV_CARTRIDGE
ENV YAUL_OPTION_MALLOC_IMPL=$BUILD_OPTION_MALLOC_IMPL
ENV YAUL_OPTION_SPIN_ON_ABORT=$BUILD_OPTION_SPIN_ON_ABORT
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
WORKDIR /tmp
# install required tools
RUN apt-get update && \
apt-get install -y git make bzip2 build-essential libncurses5-dev texinfo gcc wget unzip zip p7zip diffutils dos2unix patch libftdi1-dev python3-click xorriso genisoimage && \
rm -rf /var/lib/apt/lists/*
# build compiler
RUN git clone https://github.com/ijacquez/libyaul --recursive && \
mkdir -p /opt/tool-chains/sh-elf && \
cd /tmp/libyaul/build-scripts/ && \
cp config.in config && \
sed -i 's/OPTION_BUILD_MAKE="yes"/OPTION_BUILD_MAKE="no"/g' config && \
sed -i 's/OPTION_BUILD_GDB="yes"/OPTION_BUILD_GDB="no"/g' config && \
sed -i 's/BUILD_INSTALL_DIR="\${HOME}\/tool-chains"/BUILD_INSTALL_DIR="\/opt\/tool-chains"/g' config && \
chmod a+x ./build-compiler && ./build-compiler
# build libyaul
run cd /tmp/libyaul && make install-release && make install-tools && make examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment