REM Copy input file to BIN.C
COPY %1 \SOURCE\BIN.C
REM Compile source code file to object file
MMCC.TTP \SOURCE\MKBIN.C %4
IF EXISTS ERRORS.OUT COPY ERRORS.OUT \OBJECT\%2\%3\MKBIN.ERR
COPY \SOURCE\MKBIN.O \OBJECT\%2\%3
DEL \SOURCE\MKBIN.O
REM Link object files to executable
MMLINK.TTP \OBJECT\%2\%3\MKBIN.O -o \OBJECT\%2\%3\MKBIN.PRG
REM Run executable to extract BIN.BIN
CD \BUILD\%2
\OBJECT\%2\%3\MKBIN.PRG
REM Copy output file to destination
COPY BIN.BIN %3
CD \SOURCE
REM Cleanup temporary files
DEL \SOURCE\BIN.C
DEL \BUILD\%2\BIN.BIN
