#! /bin/sh

# Definitionen
##D="-D __DEBUG -D __LANG_EN"
##D="-D __LANG_EN"
D="-D __LANG_DE"

# Pfade
bin="../Bin"
##bin="/home/ftp/hive"
sdbas="${bin}/sdcard/Basic"
sdsys="${bin}/sdcard/system"
libpath="../TriOS/lib"
BSTC="bstc"

# ----------------------------------------------------------------
# Alte Versionen löschen

rm -rf ${sdbas}
##rm -rf ${sdsys}/xxxx
mkdir -p ${sdbas}
##mkdir ${sdsys}


# ----------------------------------------------------------------
# Code für Administra und Bellatrix erzeugen

${BSTC} -L ${libpath} ${D} -D __ADM_FAT -D __ADM_FAT_EXT -D __ADM_RTC -D __ADM_SID  -D __ADM_LAN -D __ADM_PLX -D __ADM_DCF -D __ADM_BLT -b -O a ../TriOS/flash/administra/admflash.spin
mv admflash.binary ${sdbas}/adm.sys

${BSTC} -L ${libpath} ${D} -b -O a source/belsVGA64.spin
mv belsVGA64.binary ${sdbas}/bel.sys

# ----------------------------------------------------------------
# Basic-Programme erzeugen

${BSTC} -L ${libpath} ${D} -b -O a source/Basic2_1-word.spin
mv Basic2_1-word.binary ${sdbas}/Basic.bin

${BSTC} -L ${libpath} ${D} -b -O a source/Basic-Runtime.spin
mv Basic-Runtime.binary ${sdbas}/BasRun.dll

${BSTC} -L ${libpath} ${D} -b -O a source/Export.spin
mv Export.binary ${sdbas}/Export.sys

${BSTC} -L ${libpath} ${D} -b -O a source/Import.spin
mv Import.binary ${sdbas}/Import.sys

# ----------------------------------------------------------------
# Daten kopieren

cp -r data/* ${sdbas}
