Skip to content

Commit

Permalink
Add support for mintelf toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Apr 30, 2024
1 parent 4abfefe commit d53759e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
cross_tool: [ "m68k-atari-mint", "m68k-atari-mintelf" ]
steps:
- uses: actions/checkout@v4
- name: Install SSH keys
if: ${{ github.event_name == 'push' }}
env:
SSH_ID: ${{ secrets.SSH_ID }}
run: ./.scripts/install_ssh_id.sh
- name: Install packages
run: |
SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin
./.scripts/install-freemint.sh mintlib
- name: Setup environment
env:
PROJECT_VERSION: "5.3"
CROSS_TOOL: ${{ matrix.cross_tool }}
run: ./.scripts/setup_env.sh
- name: Install packages
run: |
SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin
./.scripts/install-freemint.sh mintlib
- name: build
run: ./.scripts/build.sh
- name: deploy
Expand Down
6 changes: 3 additions & 3 deletions .scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# -x: Display expanded script commands

unset CC
./configure --host=m68k-atari-mint
if ./configure --host=${CROSS_TOOL}; then :; else cat config.log; exit 1; fi
make
make prefix="${INSTALL_DIR}" install
make DESTDIR="${INSTALL_DIR}" install

find "${INSTALL_DIR}" -type f \( -name '*.a' -o -name '*.o' \) -exec m68k-atari-mint-strip -S -X -w -N '.L[0-9]*' {} \;
find "${INSTALL_DIR}" -type f \( -name '*.a' -o -name '*.o' \) -exec ${CROSS_TOOL}-strip -S -X -w -N '.L[0-9]*' {} \;
23 changes: 19 additions & 4 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/bin/sh -x

[email protected]:/home/www/snapshots
[email protected]
UPLOAD_DIR=$SERVER:/home/www/snapshots

if [ -z "${DEPLOY_ARCHIVE+x}" ]
then
# zip is default
DEPLOY_ARCHIVE="zip"
fi

toolsuffix=${CROSS_TOOL##*-}

if [ -n "${CPU_TARGET+x}" ]
then
ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}-${CPU_TARGET}.${DEPLOY_ARCHIVE}"
ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}-${CPU_TARGET}-${toolsuffix}.${DEPLOY_ARCHIVE}"
else
ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}.${DEPLOY_ARCHIVE}"
ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}-${toolsuffix}.${DEPLOY_ARCHIVE}"
fi
ARCHIVE_PATH="${DEPLOY_DIR}/${ARCHIVE_NAME}"

Expand Down Expand Up @@ -54,10 +57,22 @@ upload_file() {
exit 1
}

link_file() {
local from="$1"
local to="$2"
for i in 1 2 3
do
ssh -o "StrictHostKeyChecking no" $SERVER -- "cd www/snapshots/${PROJECT_DIR}; ln -sf $from $to"
[ $? = 0 ] && return 0
sleep 1
done
exit 1
}

upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${ARCHIVE_NAME}"
if test -z "${CPU_TARGET}"
then
upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}"
link_file "$ARCHIVE_NAME" "${PROJECT_DIR}-${toolsuffix}-latest.${DEPLOY_ARCHIVE}"
fi

echo ${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID} > .latest_version
Expand Down
15 changes: 13 additions & 2 deletions .scripts/install-freemint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
# -x: Display expanded script commands

DOWNLOAD_DIR=http://tho-otto.de/snapshots
SYSROOT_DIR=${SYSROOT_DIR:-"/usr/m68k-atari-mint/sys-root/usr"}
SYSROOT_DIR=${SYSROOT_DIR:-"/usr/${CROSS_TOOL}/sys-root"}

sudo mkdir -p "${SYSROOT_DIR}" && cd "${SYSROOT_DIR}"

toolsuffix=${CROSS_TOOL##*-}

for package in $*
do
wget -q -O - "$DOWNLOAD_DIR/${package}/${package}-latest.tar.bz2" | sudo tar xjf -
# for gcc and binutils, use stable current, not experimental latest build
case $package in
gcc | binutils)
filename=${package}-${toolsuffix}-current.tar.bz2
;;
*)
filename=${package}-${toolsuffix}-latest.tar.bz2
;;
esac
wget -q -O - "$DOWNLOAD_DIR/${package}/${filename}" | sudo tar xjf -
done
2 changes: 2 additions & 0 deletions .scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ BRANCH=$(echo "${GITHUB_REF}" | cut -d '/' -f 3)
if test "$CPU_TARGET" != ""; then
echo "CPU_TARGET=$CPU_TARGET" >> $GITHUB_ENV
fi
CROSS_TOOL=${CROSS_TOOL:-m68k-atari-mint}
echo "CROSS_TOOL=$CROSS_TOOL" >> $GITHUB_ENV

# GITHUB_HEAD_REF is only set for pull requests
if [ "${GITHUB_HEAD_REF}" = "" ]
Expand Down

0 comments on commit d53759e

Please sign in to comment.