From 6d059cc3355aaf22c83d48b20fc22abdb41213da Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sat, 20 Apr 2019 18:27:54 -0500 Subject: [PATCH] Working on installer and build scripts. --- {joeylib => scripts}/build-IIgs.helper.sh | 0 {joeylib => scripts}/build-PC.helper.sh | 27 ++++++---- buildPCDeps.sh => scripts/buildPCDeps.sh | 0 scripts/buildVBCC.sh | 62 +++++++++++++++++++++++ scripts/fixIIgsTypes.sh | 31 ++++++++++++ installer.sh => scripts/installer.sh | 1 + scripts/joeyDev.sh | 23 +++++++++ 7 files changed, 133 insertions(+), 11 deletions(-) rename {joeylib => scripts}/build-IIgs.helper.sh (100%) mode change 100755 => 100644 rename {joeylib => scripts}/build-PC.helper.sh (67%) rename buildPCDeps.sh => scripts/buildPCDeps.sh (100%) create mode 100644 scripts/buildVBCC.sh create mode 100755 scripts/fixIIgsTypes.sh rename installer.sh => scripts/installer.sh (98%) create mode 100755 scripts/joeyDev.sh diff --git a/joeylib/build-IIgs.helper.sh b/scripts/build-IIgs.helper.sh old mode 100755 new mode 100644 similarity index 100% rename from joeylib/build-IIgs.helper.sh rename to scripts/build-IIgs.helper.sh diff --git a/joeylib/build-PC.helper.sh b/scripts/build-PC.helper.sh similarity index 67% rename from joeylib/build-PC.helper.sh rename to scripts/build-PC.helper.sh index d158b89..e6b7013 100644 --- a/joeylib/build-PC.helper.sh +++ b/scripts/build-PC.helper.sh @@ -8,9 +8,14 @@ function doPCBuild() { local OSNAME=$1 local OSARCH=$2 + local EXT=$3 local DEST=${TARGET}/${OSNAME}/${OSARCH} local G_CFLAGS="-Wall -D_REENTRANT_ -I${JOEY}/dist" + + echo '-------------------------------------------------------------------------------' + echo "Building ${OSNAME} ${OSARCH}" + echo '-------------------------------------------------------------------------------' # Clean up target and working directories if [ -d ${DEST} ]; then @@ -33,7 +38,7 @@ function doPCBuild() { done # Link source & JoeyLib - ${CC} -o ${DEST}/${PROJECT} ${OFILES} ${JOEY}/dist/${OSNAME}/${OSARCH}/libjoeylib.a -lstdc++ ${LDFLAGS} + ${CC} -o ${DEST}/${PROJECT}${EXT} ${OFILES} ${JOEY}/dist/${OSNAME}/${OSARCH}/libjoeylib.a ${LDFLAGS} # Copy game data mkdir -p ${DEST}/data @@ -46,32 +51,32 @@ function doPCBuild() { function buildLinux32() { CC="gcc" CFLAGS="-m32" - LDFLAGS="" - doPCBuild linux x86 + LDFLAGS="-m32 -lstdc++ -lm -ldl -lpthread" + doPCBuild linux x86 '' } function buildLinux64() { CC="gcc" CFLAGS="" - LDFLAGS="-lm -lpthread -ldl" - doPCBuild linux x64 + LDFLAGS="-lstdc++ -lm -ldl -lpthread" + doPCBuild linux x64 '' } function buildWindows32() { CC="i686-w64-mingw32-gcc" CFLAGS="" - LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi" - doPCBuild windows x86 + LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi -static -lstdc++" + doPCBuild windows x86 '.exe' } function buildWindows64() { CC="x86_64-w64-mingw32-gcc" CFLAGS="" - LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi" - doPCBuild windows x64 + LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi -static -lstdc++" + doPCBuild windows x64 '.exe' } @@ -79,7 +84,7 @@ function buildmacOS32() { CC="o32-clang" CFLAGS="" LDFLAGS="" - doPCBuild macos x86 + doPCBuild macos x86 '' } @@ -87,5 +92,5 @@ function buildmacOS64() { CC="o64-clang" CFLAGS="" LDFLAGS="" - doPCBuild macos x64 + doPCBuild macos x64 '' } diff --git a/buildPCDeps.sh b/scripts/buildPCDeps.sh similarity index 100% rename from buildPCDeps.sh rename to scripts/buildPCDeps.sh diff --git a/scripts/buildVBCC.sh b/scripts/buildVBCC.sh new file mode 100644 index 0000000..31b0ff2 --- /dev/null +++ b/scripts/buildVBCC.sh @@ -0,0 +1,62 @@ +#!/bin/false + +# DO NOT RUN WITHOUT EDITING. THIS IS DOCUMENTATION. + +apt-get -y install lhasa + +wget http://sun.hasenbraten.de/vasm/release/vasm.tar.gz +wget http://sun.hasenbraten.de/vlink/release/vlink.tar.gz +wget http://www.ibaug.de/vbcc/vbcc.tar.gz + +CURRENT="2017-08-14" +wget http://server.owl.de/~frank/vbcc/${CURRENT}/vbcc_target_m68k-amigaos.lha +wget http://server.owl.de/~frank/vbcc/${CURRENT}/vbcc_target_m68k-atari.lha +wget http://server.owl.de/~frank/vbcc/${CURRENT}/vbcc_unix_config.tar + +# We download this but don't set it up +wget http://www.haage-partner.de/download/AmigaOS/NDK39.lha + +tar xzf vasm.tar.gz +tar xzf vlink.tar.gz +tar xzf vbcc.tar.gz + +pushd vasm +make CPU=m68k SYNTAX=mot +popd + +pushd vlink +mkdir -p objects +make +popd + +pushd vbcc +mkdir -p bin +make TARGET=m68k +make TARGET=m68ks +popd + +export VBCC=$(pwd)/sdks/vbcc +mkdir -p ${VBCC}/targets +cp vasm/{vasmm68k_mot,vobjdump} ${VBCC}/bin/. +cp vlink/vlink ${VBCC}/bin/. +cp vbcc/bin/* ${VBCC}/bin/. + +tar xzf vbcc_unix_config.tar.gz +mv config ${VBCC}/. + +lha x vbcc_target_m68k-amigaos.lha +mv vbcc_target_m68k-amigaos/targets/m68k-amigaos ${VBCC}/targets/. +rm vbcc_target_m68k-amigaos.info +rm -rf vbcc_target_m68k-amigaos + +lha x vbcc_target_m68k-atari.lha +mv vbcc_target_m68k-atari/targets/m68k-amigaos ${VBCC}/targets/. +rm vbcc_target_m68k-atari.info +rm -rf vbcc_target_m68k-atari + +mkdir -p sdks/amiga +pushd sdks/amiga +lha x ../../NDK39.lha +popd + +export PATH=$VBCC/bin:$PATH diff --git a/scripts/fixIIgsTypes.sh b/scripts/fixIIgsTypes.sh new file mode 100755 index 0000000..5d5711a --- /dev/null +++ b/scripts/fixIIgsTypes.sh @@ -0,0 +1,31 @@ +#!/bin/bash -e + +pushd ${GOLDEN_GATE} + +#find . -type d -exec chmod 755 {} \; +#find . -type f -exec chmod 644 {} \; + +for x in etc/* ; do iix chtyp -t txt "$x" ; done +for x in lib/* ; do if [ -f "$x" ] ; then iix chtyp -t lib "$x" ; fi ; done +for x in usr/lib/lib* ; do iix chtyp -t lib "$x" ; done +for x in usr/lib/tmac/* ; do iix chtyp -t txt "$x" ; done +for x in bin/* ; do iix chtyp -t exe "$x" ; done +for x in usr/bin/* ; do iix chtyp -t exe "$x" ; done +for x in usr/local/bin/* ; do iix chtyp -t exe "$x" ; done + +for f in Languages/* ; do if [ -f "$f" ] ; then iix chtyp -t exe "$f" ; fi ; done ; +for f in Utilities/Help/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ; +for f in Utilities/* ; do if [ -f "$f" ] ; then iix chtyp -t exe "$f" ; fi ; done ; +for f in Libraries/* ; do if [ -f "$f" ] ; then iix chtyp -t lib "$f" ; fi ; done ; +for f in Libraries/AInclude/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ; +for f in Libraries/APWCInclude/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ; +for f in Libraries/AppleUtil/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ; +for f in Libraries/ORCACDefs/* ; do if [ -f "$f" ] ; then iix chtyp -l cc "$f" ; fi ; done ; +for f in Libraries/ORCAInclude/* ; do if [ -f "$f" ] ; then iix chtyp -l asm "$f" ; fi ; done ; +for f in Libraries/RInclude/* ; do if [ -f "$f" ] ; then iix chtyp -l rez "$f" ; fi ; done ; +for f in Libraries/Tool.Interface/* ; do if [ -f "$f" ] ; then iix chtyp -l pascal "$f" ; fi ; done ; +for f in Libraries/GSoftDefs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8007 "$f" ; fi ; done ; +for f in Libraries/ORCAPascalDefs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8009 "$f" ; fi ; done ; +for f in Libraries/m2defs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8006 "$f" ; fi ; done ; + +popd \ No newline at end of file diff --git a/installer.sh b/scripts/installer.sh similarity index 98% rename from installer.sh rename to scripts/installer.sh index 867e561..cc3ea2b 100755 --- a/installer.sh +++ b/scripts/installer.sh @@ -167,6 +167,7 @@ installGsPlus() { unzip harddrive_image.zip mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po" echo "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt" + echo "s7d1 = System601.po\ns7d2 = /tmp/IIgs/import.po\n" > "${IIGS}/gsplus/IIgsTest.cfg" } diff --git a/scripts/joeyDev.sh b/scripts/joeyDev.sh new file mode 100755 index 0000000..2c69bd9 --- /dev/null +++ b/scripts/joeyDev.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + +# --- Joey Development Below Here --- + +export JOEY="/home/scott/joey" + +# Amiga & Atari ST Cross Compiler +export VBCC="${JOEY}/sdks/vbcc" +export PATH="${VBCC}/bin:${PATH}" + +# IIgs Runtime & ORCA Compilers +export GOLDEN_GATE="${JOEY}/sdks/IIgs/ORCA" +export PATH="${JOEY}/sdks/IIgs:${PATH}" + +# macOS Cross Compiler +export MACOSX_DEPLOYMENT_TARGET=10.6 +export PATH="${JOEY}/sdks/macos/bin:${PATH}" + +# Raspberry Pi Cross Compiler +#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/arm-bmc2708-linux-gnueabi/bin:${PATH}" +#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:${PATH}" +#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:${PATH}"