@echo OFF

if .==.%1           goto error1
if not exist %1.nap goto error2

if exist %1.tmp     del %1.tmp
if exist %1.exp     del %1.exp

echo ===============================================================================
echo.

echo %1   **** MAC PREPROCESSOR running
\Simulate\Macdos\Dos\Macdos.exe -l -c %1.nap > %1.tmp

if errorlevel 1     goto error0
if not exist %1.tmp goto error0

title [ %1.nap ]

echo %1   **** NAPA COMPILER    running

rem  Initialize variables if not already done
call \Simulate\Napados\Dos\UserInit.bat

if .==.%OWNER%                     call \Simulate\myinit.bat

\Simulate\Napados\Dos\Napados.exe %1.tmp -dir /Simulate/Napados -user %OWNER% -expand > %1.exp
goto end

:error0

echo.
echo %1   **** ABNORMAL TERMINATION

goto end

:error1
echo %1   **** Input file is missing. No Processing.

goto end

:error2
echo %1   **** Input file %1.nap does not exist. No Processing.

:end
echo.
