@echo off
if not x%1 == xs if not x%1 == xl goto errM
set __CFLAGS=-q -i..\..\include -c -b%1

if exist errlist set __CFLAGS=%__CFLAGS% -E+errlist

..\..\bin\rm -sf *.obj errlist compile.tmp

call mkdynsrc.bat

if exist foreach.com goto haveFE
cc foreach.xc -fop _MICROC_=1 NDEBUG=1
if errorlevel 1 goto ende
if not exist foreach.com goto err1
:haveFE

type compile.ccc >compile.tmp
type dyn_src >>compile.tmp
.\foreach /v compile.tmp pacc %__CFLAGS% %%name:
if exist errlist copy errlist errlist._%__MODEL% >nul

if exist suppl_%1.lib del suppl_%1.lib >nul
LIBr.exe r suppl_%1.lib *.obj
if not errorlevel 1 libr s suppl_%1.lib >suppl_%1.lst

..\..\bin\rm -sf *.obj  compile.tmp
goto ende

:err1
echo Failed to make FOREACH.COM (from FOREACH.XC)
echo To compile FOREACH you need Micro-C.
goto ende

:errM
echo Script to compile the supplemental library with Pacific C
echo Useage: %0 s -or- l

:ende
set __CFLAGS=
set __ASMFLAGS=
