echo off
cls
if %1.==. goto Message
set ARG=%1
set DEB=
set LST=
set BIND=
:Loop
shift
if %1.==. goto ExitLoop
if %1.==D. set DEB=/Zi
if %1.==d. set DEB=/Zi
if %1.==L. set LST=/Fl
if %1.==l. set LST=/Fl
goto Loop
:ExitLoop
if %ARG%.==P. goto Prot
if %ARG%.==p. goto Prot
if %ARG%.==B. goto Bind
if %ARG%.==b. goto Bind
goto Message
:Bind
set BIND=1
set DEB=
:Prot
echo pl /Lp %DEB% %LST% sortdemo.pas
pl /Lp %DEB% %LST% sortdemo.pas
if %BIND%.==1. echo bind sortdemo %LIB%\doscalls.lib %LIB%\api.lib
if %BIND%.==1. bind sortdemo %LIB%\doscalls.lib %LIB%\api.lib
goto Exit
:Message
echo ÿ
echo Start MAKESORT with one or more of the following parameters:
echo ÿ
echo Parameter 1
echo   P            Protected mode
echo   B            Bound family API program (runs in real or protected)
echo ÿ
echo Additional parameters (inappropriate arguments will be ignored)
echo   D            Debuggable by CodeView
echo   L            Listing file
echo ÿ
echo Examples:
echo ÿ
echo   MAKESORT P L D        Compile protected-mode debuggable with listing
echo   MAKESORT P D          Compile protected-mode debuggable
echo   MAKESORT B            Compile and bind
echo ÿ
echo Note that this batch file requires DOS 3.1 or higher.
:Exit
set DEB=
set LST=
set STUB=
set BIND=
set ARG=
