2015-09-29 01:45:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-11-28 20:21:44 +00:00
|
|
|
# SET THESE TOOLS UP ON YOUR SYSTEM AND UPDATE THE PATHS HERE TO BUILD
|
|
|
|
CADIUS="../tools/Cadius"
|
|
|
|
MERLIN="../tools/Merlin32_v1.0/MacOSX/Merlin32"
|
2015-09-29 01:45:46 +00:00
|
|
|
|
2015-11-28 20:21:44 +00:00
|
|
|
# Here's our fancy build pipeline. Output = src/mtsystem (binary file)
|
|
|
|
$MERLIN -V . src/mmt.s
|
2015-09-29 01:45:46 +00:00
|
|
|
|
|
|
|
# whatever the build produces
|
2015-11-28 20:21:44 +00:00
|
|
|
OUTFILE="src/mmtsystem"
|
2015-09-29 01:45:46 +00:00
|
|
|
if [ ! -f $OUTFILE ]; then
|
2015-11-28 20:21:44 +00:00
|
|
|
echo "Can't find $OUTFILE. Check assembler output."
|
2015-09-29 01:45:46 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2015-11-28 20:21:44 +00:00
|
|
|
mv $OUTFILE src/mmt.system
|
2015-09-29 01:45:46 +00:00
|
|
|
|
|
|
|
SRCFILES=(`ls src/*.s`)
|
2015-11-28 20:21:44 +00:00
|
|
|
DOCFILES=(`ls docs/*.txt`)
|
2015-09-29 01:45:46 +00:00
|
|
|
SYSFILES=(`ls src/PRODOS src/*system`)
|
2015-11-28 20:21:44 +00:00
|
|
|
|
|
|
|
DISK="MMT" # base name of disk image
|
2015-09-29 01:45:46 +00:00
|
|
|
SRCDIR=src
|
|
|
|
BLDDIR=build/nix
|
|
|
|
|
|
|
|
if [ ! -d $BLDDIR ] ; then
|
|
|
|
echo "Build directory for this platform doesn't exist so I will create it."
|
|
|
|
mkdir -p $BLDDIR
|
|
|
|
echo "Created: $BLDDIR"
|
|
|
|
sleep 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# need to autogen
|
2015-11-28 20:21:44 +00:00
|
|
|
cp src/_FileInformation.txt $BLDDIR
|
|
|
|
|
|
|
|
$CADIUS createvolume ${DISK}800.2mg ${DISK}800 800KB >/dev/null
|
|
|
|
$CADIUS createvolume ${DISK}800.po ${DISK}800 800KB >/dev/null
|
|
|
|
$CADIUS createvolume ${DISK}140.po ${DISK}140 140KB >/dev/null
|
|
|
|
$CADIUS createfolder ${DISK}800.2mg /${DISK}800/src
|
|
|
|
$CADIUS createfolder ${DISK}800.po /${DISK}800/src
|
|
|
|
$CADIUS createfolder ${DISK}140.po /${DISK}140/src
|
|
|
|
$CADIUS createfolder ${DISK}800.2mg /${DISK}800/doc
|
|
|
|
$CADIUS createfolder ${DISK}800.po /${DISK}800/doc
|
|
|
|
$CADIUS createfolder ${DISK}140.po /${DISK}140/doc
|
2015-09-29 01:45:46 +00:00
|
|
|
|
|
|
|
#SOURCE FILES
|
|
|
|
for f in ${SRCFILES[@]};
|
|
|
|
do
|
|
|
|
FNAME=${f##*/}
|
|
|
|
echo Processing $FNAME
|
|
|
|
cp $f $BLDDIR/$FNAME
|
|
|
|
$CADIUS sethighbit $BLDDIR/$FNAME > /dev/null
|
|
|
|
# add -V to debug
|
2015-11-28 20:21:44 +00:00
|
|
|
$CADIUS addfile ${DISK}800.2mg /${DISK}800/src $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}800.po /${DISK}800/src $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}140.po /${DISK}140/src $BLDDIR/$FNAME >/dev/null
|
2015-09-29 01:45:46 +00:00
|
|
|
done
|
|
|
|
|
2015-11-28 20:21:44 +00:00
|
|
|
#DOC FILES
|
|
|
|
for f in ${DOCFILES[@]};
|
|
|
|
do
|
|
|
|
FNAME=${f##*/}
|
|
|
|
echo Processing $FNAME
|
|
|
|
cp $f $BLDDIR/$FNAME
|
|
|
|
# add -V to debug
|
|
|
|
$CADIUS addfile ${DISK}800.2mg /${DISK}800/doc $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}800.po /${DISK}800/doc $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}140.po /${DISK}140/doc $BLDDIR/$FNAME >/dev/null
|
|
|
|
done
|
2015-09-29 01:45:46 +00:00
|
|
|
|
|
|
|
#SYSTEM FILES
|
|
|
|
for f in ${SYSFILES[@]};
|
|
|
|
do
|
|
|
|
FNAME=${f##*/}
|
|
|
|
echo Processing $FNAME
|
|
|
|
cp $f $BLDDIR/$FNAME
|
2015-11-28 20:21:44 +00:00
|
|
|
$CADIUS addfile ${DISK}800.2mg /${DISK}800/ $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}800.po /${DISK}800/ $BLDDIR/$FNAME >/dev/null
|
|
|
|
$CADIUS addfile ${DISK}140.po /${DISK}140/ $BLDDIR/$FNAME >/dev/null
|
2015-09-29 01:45:46 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|