diff --git a/scripts/build-IIgs.helper.sh b/scripts/build-IIgs.helper.sh index 6daf5fd..617445c 100644 --- a/scripts/build-IIgs.helper.sh +++ b/scripts/build-IIgs.helper.sh @@ -25,9 +25,10 @@ function buildIIgs() { TARGET=${JOEY}/sdks/IIgs/ORCA/out/${PROJECT} GSTARGET=31:/out/${PROJECT} CADIUS=${JOEY}/sdks/IIgs/cadius/cadius - VOL=Import + VOL=${PROJECT} WORK=/tmp/IIgs IMPORT=${WORK}/import.po + DEBUG=. # Clean up target and working directories if [ -d ${TARGET} ]; then @@ -40,6 +41,13 @@ function buildIIgs() { fi mkdir -p ${WORK} + # Where to put debugging information? + if [[ ! -z ${RESULTS} ]]; then + mkdir ${RESULTS}/IIgs + DEBUG=${RESULTS}/IIgs + fi + + #***TODO*** Add image and music conversion. # Automatically copy converted images, stencils, and audio so they # no longer need to be specified in the build script. @@ -78,11 +86,20 @@ function buildIIgs() { OFILES="${GSTARGET}/jIIgsc ${GSTARGET}/joey ${GSTARGET}/jIIgsasm ${OFILES}" # Link our program and create a map file - iix -DKeepType=S16 link +L ${OFILES} keep=${GSTARGET}/${PROJECT}#b3db03 > ${PROJECT}.map + iix -DKeepType=S16 link +L ${OFILES} keep=${GSTARGET}/${PROJECT}#b3db03 > ${DEBUG}/${PROJECT}.map # Create a disassembly and linker input listing - iix dumpobj +D ${GSTARGET}/${PROJECT}#b3db03 &> ${PROJECT}.dis || true - echo ${OFILES} > ${PROJECT}.lnk + iix dumpobj +D ${GSTARGET}/${PROJECT}#b3db03 &> ${DEBUG}/${PROJECT}.dis || true + echo ${OFILES} > ${DEBUG}/${PROJECT}.lnk + + # Clean up SYM files + CFILES=($(ls -1 *.c)) + for F in "${CFILES[@]}"; do + O=${F%.*}.sym + if [[ -e ${O} ]]; then + rm ${O} + fi + done echo "Creating disk image..." @@ -115,7 +132,6 @@ function buildIIgs() { mkdir -p ${JOEY}/builds/${PROJECT}/IIgs/ cp ${IMPORT} ${JOEY}/builds/${PROJECT}/IIgs/${PROJECT}.po else - mkdir ${RESULTS}/IIgs cp ${IMPORT} ${RESULTS}/IIgs/${PROJECT}.po fi