REM Parms are: dst dos lib math
if .%4==.altmath goto MA
if .%4==.ALTMATH goto MA
if .%4==.decmath goto MD
if .%4==.DECMATH goto MD
if .%4==.emulator goto ME
if .%4==.EMULATOR goto ME
if .%4==.87math   goto M7
if .%4==.87MATH   goto M7
echo Incorrect Math Library - rerun MAKELIB
echo with the correct Library parameter.
goto exit
:MA
echo %2 %1%3\LIBPASA.LIB will now be created.
del  %1%3\libpasar.lib
del  %1%3\libpasap.lib

echo %1%3\libpasar.lib/p:512  >%1%3\libr.ctl
echo y			     >>%1%3\libr.ctl
echo partial.lib&	>>%1%3\libr.ctl
echo %1%3\entx6l.obj&	>>%1%3\libr.ctl
echo %1%3\dos30p.lib&	>>%1%3\libr.ctl
echo altmath.lib,nul;	>>%1%3\libr.ctl

echo %1%3\libpasap.lib/p:512  >%1%3\libp.ctl
echo y			     >>%1%3\libp.ctl
echo partial.lib&	>>%1%3\libp.ctl
echo %1%3\5entx6l.obj&	>>%1%3\libp.ctl
echo %1%3\dos50p.lib&	>>%1%3\libp.ctl
echo %1%3\doscalls.lib& >>%1%3\libp.ctl
echo altmath.lib,nul;	>>%1%3\libp.ctl
goto mx
:MD
echo %2 %1%3\LIBPASD.LIB will now be created.
del  %1%3\libpasdr.lib
del  %1%3\libpasdp.lib

echo %1%3\libpasdr.lib/p:512  >%1%3\libr.ctl
echo y			     >>%1%3\libr.ctl
echo partial.lib&	>>%1%3\libr.ctl
echo %1%3\entx6l.obj&	>>%1%3\libr.ctl
echo %1%3\dos30p.lib&	>>%1%3\libr.ctl
echo decmath.lib,nul;	>>%1%3\libr.ctl

echo %1%3\libpasdp.lib/p:512  >%1%3\libp.ctl
echo y			     >>%1%3\libp.ctl
echo partial.lib&	>>%1%3\libp.ctl
echo %1%3\5entx6l.obj&	>>%1%3\libp.ctl
echo %1%3\dos50p.lib&	>>%1%3\libp.ctl
echo %1%3\doscalls.lib& >>%1%3\libp.ctl
echo decmath.lib,nul;	>>%1%3\libp.ctl
goto mx
:M7
echo %2 %1%3\LIBPAS7.LIB will now be created.
del  %1%3\libpas7r.lib
del  %1%3\libpas7p.lib

echo %1%3\libpas7r.lib/p:512  >%1%3\libr.ctl
echo y			     >>%1%3\libr.ctl
echo partial.lib&	>>%1%3\libr.ctl
echo %1%3\entx6l.obj&	>>%1%3\libr.ctl
echo %1%3\dos30p.lib&	>>%1%3\libr.ctl
echo 8087.lib&		>>%1%3\libr.ctl
echo %1%3\87r.lib,nul;	>>%1%3\libr.ctl

echo %1%3\libpas7p.lib/p:512  >%1%3\libp.ctl
echo y			     >>%1%3\libp.ctl
echo partial.lib&	>>%1%3\libp.ctl
echo %1%3\5entx6l.obj&	>>%1%3\libp.ctl
echo %1%3\dos50p.lib&	>>%1%3\libp.ctl
echo %1%3\doscalls.lib& >>%1%3\libp.ctl
echo 8087.lib&		>>%1%3\libp.ctl
echo %1%3\87.lib,nul;	>>%1%3\libp.ctl
goto mx
:ME
echo %2 %1%3\LIBPASE.LIB will now be created.
del  %1%3\libpaser.lib
del  %1%3\libpasep.lib

echo %1%3\libpaser.lib/p:512  >%1%3\libr.ctl
echo y			     >>%1%3\libr.ctl
echo partial.lib&	>>%1%3\libr.ctl
echo %1%3\entx6l.obj&	>>%1%3\libr.ctl
echo %1%3\dos30p.lib&	>>%1%3\libr.ctl
echo ieeemath.lib&	>>%1%3\libr.ctl
echo %1%3\emr.lib,nul;	>>%1%3\libr.ctl

echo %1%3\libpasep.lib/p:512  >%1%3\libp.ctl
echo y			     >>%1%3\libp.ctl
echo partial.lib&	>>%1%3\libp.ctl
echo %1%3\5entx6l.obj&	>>%1%3\libp.ctl
echo %1%3\dos50p.lib&	>>%1%3\libp.ctl
echo %1%3\doscalls.lib& >>%1%3\libp.ctl
echo ieeemath.lib&	>>%1%3\libp.ctl
echo %1%3\em.lib,nul;	>>%1%3\libp.ctl
:MX
if .%2==.os2 goto mxp
if .%2==.OS2 goto mxp
lib @%1%3\libr.ctl
del %1%3\entx6l.obj
del %1%3\dos30p.lib
del %1%3\emr.lib
del %1%3\87r.lib
if .%2==.dual goto mxp
if .%2==.DUAL goto mxp
copy %1%3\libpas?r.lib %1%3\libpas?.lib
del  %1%3\libpas?r.lib
goto mxx
:MXP
lib @%1%3\libp.ctl
del %1%3\5entx6l.obj
del %1%3\dos50p.lib
del %1%3\em.lib
del %1%3\87.lib
del %1%3\doscalls.lib
if .%2==.dual goto mxx
if .%2==.DUAL goto mxx
copy %1%3\libpas?p.lib %1%3\libpas?.lib
del  %1%3\libpas?p.lib
:MXX
del %1%3\libr.ctl
del %1%3\libp.ctl
if .%2==.dual goto done2
if .%2==.DUAL goto done2
:DONE
echo .
echo +++ MAKELIB completed +++
goto EXIT
:done2
cls
echo You have built libraries for both DOS and OS/2.
echo Use the PL switch /Lr to select the DOS  (real) mode library LIBPASxR.LIB.
echo Use the PL switch /Lp to select the OS/2 (prot) mode library LIBPASxP.LIB.
goto DONE
:EXIT
echo 
