ifengine/build-IIgs.sh
2018-10-14 21:40:50 -05:00

59 lines
1.2 KiB
Bash
Executable file

#!/bin/bash -e
PROJECT=ifengine
DATA=(thin.sta output.z8 gamedata.dat)
#SOURCE=(*.c *.h)
SOURCE=()
# --- HERE BE DRAGONS ---
TARGET=${JOEY}/sdks/iix/IIgs/out/${PROJECT}
GSTARGET=31:/out/${PROJECT}
AC=${JOEY}/sdks/iix/ac/
IMPORT=/tmp/import.po
if [ -d ${TARGET} ]; then
rm -rf ${TARGET}
fi
mkdir -p ${TARGET}
rm JLSTATS || true
rm /tmp/import.po || true
cp -f ${JOEY}/dist/joey.h .
CFILES=($(ls -1 *.c))
OFILES=""
for F in "${CFILES[@]}"; do
O=${F%.*}
OFILES="${OFILES} ${GSTARGET}/${O}"
echo "Compiling ${F}..."
iix compile ${F} keep=${GSTARGET}/${O}
done
rm joey.h
cp -f ${JOEY}/dist/IIgs/joeylib#b20000 ${JOEY}/sdks/iix/IIgs/Libraries/joeylib
iix chtyp -t lib ${JOEY}/sdks/iix/IIgs/Libraries/joeylib
iix -DKeepType=S16 link ${OFILES} 13:joeylib keep=${GSTARGET}/${PROJECT}
${AC}/import.sh ${TARGET}/${PROJECT} S16
for F in "${DATA[@]}"; do
${AC}/import.sh ${F} BIN
done
mkdir -p /tmp/IIgs/source
for S in "${SOURCE[@]}"; do
for F in `ls -1 ${S}`; do
tr "\n" "\r" < ${F} > /tmp/IIgs/source/${F}
${AC}/import.sh /tmp/IIgs/source/${F} TXT
rm /tmp/IIgs/source/${F}
done
done
if [ ! -z $1 ]; then
pushd ${JOEY}/sdks/iix/gsplus
./gsplus -config IIgsTest.cfg || true
popd
echo ""
${AC}/export.sh JLSTATS
cat JLSTATS
fi