#!/bin/bash

CA_DIR=`pwd`/../
CA_COM="BKTurbo8"
CA_B2O="BKbin2obj"
CA_BTL="BKTools"

ASSEMBLER=$CA_DIR$CA_COM
BIN2OBJ=$CA_DIR$CA_B2O
TOOLS=$CA_DIR$CA_BTL

$ASSEMBLER -l co LOADER.ASM

$BIN2OBJ -sbin -lmusic SC2INTRO.SND
$BIN2OBJ -sbin -lpanel PANEL.CRN
$BIN2OBJ -sbin -lbutton BUTTONS.SPR
$BIN2OBJ -sbin -ltrees TREES.SPR
$BIN2OBJ -sbin -lammun AMMUN.SPR
$BIN2OBJ -sbin -lmotocy MOTO.SPR
$BIN2OBJ -sbin -lmotexp MOTEXPL.SPR
$BIN2OBJ -sbin -lhelic HELIC.SPR
$BIN2OBJ -sbin -lhelexp HELEXPL.SPR
$ASSEMBLER -l -o cl RP2.ASM
$ASSEMBLER -l li RACEPLAY RP2.obj sc2intro.obj panel.obj buttons.obj trees.obj ammun.obj moto.obj motexpl.obj helic.obj helexpl.obj

$BIN2OBJ -sbin -lmusic RALLY.SND
$BIN2OBJ -sbin -ltm TM.PCK
$BIN2OBJ -sbin -lfon FON.PCK
$BIN2OBJ -sbin -lmobil MOBIL.PCK
$ASSEMBLER -l -o cl SCRPLY.ASM
$ASSEMBLER -l li SCRNPLAY SCRPLY.obj rally.obj tm.obj fon.obj mobil.obj

mv RACEPLAY.bin RACEPLAY.OVL.bin
mv SCRNPLAY.bin SCRNPLAY.OVL.bin

mkdir out
cp *.bin out/
cp *.lst out/

rm *.bin
rm *.obj
rm *.lst
