echo off
REM Microsoft Pascal Compiler Setup (MAKELIB.BAT)
REM (C) Copyright Microsoft Corp. 1988.
if not %1.==. goto nohelp
:HELP
cls
echo MAKELIB builds the desired Pascal Libraries on your system from your
echo Pascal distribution disks.
echo .
echo This procedure should only be used when SETUP does not work.
echo .
echo NOTE: If you already have Libraries with the same names as
echo	   those being created, they will be overwritten.
echo 
pause
cls
echo To use MAKELIB, type:    MAKELIB dst dos lib mathlib
echo where:
echo	dst =	The destination drive - MUST include a colon.
echo	dos =	The DOS library type you will be building (DOS, OS2, DUAL).
echo		DOS for DOS 2.x or 3.x, OS2 for OS/2, DUAL for both.
echo	lib =	The directory into which to put Library files.
echo	mathlib = The type of math routines you want in your library:
echo	    ALTMATH  - won't use 8087, fast runtime,
echo		       binary math, average precision
echo	    DECMATH  - Decimal math, best accounting accuracy
echo	    EMULATOR - very precise
echo		       with    8087 - very fast runtime
echo		       without 8087 - slow runtime
echo        87MATH   - must have 80x87 installed
echo                   very fast runtime
echo                   very precise
echo .
echo Example:	MAKELIB C: OS2 \LIB EMULATOR
echo	    Will install Pascal Libraries on drive C:,
echo	    C:\LIB\LIBPASE.LIB will be created for OS2,
echo Please rerun MAKELIB with the desired options.
goto exit
:NOHELP
if .%2==.dos  goto dosok
if .%2==.DOS  goto dosok
if .%2==.os2  goto dosok
if .%2==.OS2  goto dosok
if .%2==.dual goto dosok
if .%2==.DUAL goto dosok
echo Incorrect DOS parameter - rerun MAKELIB
echo			       with the correct DOS number.
goto exit
:DOSOK
if .%4==.altmath goto libok
if .%4==.ALTMATH goto libok
if .%4==.decmath  goto libok
if .%4==.DECMATH  goto libok
if .%4==.emulator goto libok
if .%4==.EMULATOR goto libok
if .%4==.87math   goto libok
if .%4==.87MATH   goto libok
cls
echo %4 is an incorrect library parameter.
echo Strike any key for instructions, then rerun MAKELIB.
echo 
pause
makelib rerun
:LIBOK
if exist api.lib goto gotlib
:NOLIB
cls
echo Insert the PASCAL Library 1 diskette
echo 
pause
if exist api.lib goto gotlib
goto nolib
:GOTLIB
echo Your OS dependent Object files and Libraries are being copied.
for %%f in (api.lib) do echo %1%3\%%f
for %%f in (api.lib) do copy %%f %1%3
if .%2==.dos  goto gotdos
if .%2==.DOS  goto gotdos
if .%2==.os2  goto gotos2
if .%2==.OS2  goto gotos2
:GOTDUAL
for %%f in (*.lib) do echo %1%3\%%f
for %%f in (*.lib) do copy %%f %1%3
copy entx6l.obj %1%3
copy 5entx6l.obj %1%3
goto makelib3
:GOTDOS
copy entx6l.obj %1%3
copy dos30p.lib %1%3
copy emr.lib %1%3
copy 87r.lib %1%3
copy cexec.lib %1%3
goto makelib3
:GOTOS2
copy 5entx6l.obj %1%3
copy dos50p.lib %1%3
copy em.lib %1%3
copy 87.lib %1%3
copy doscalls.lib %1%3
:makelib3
if exist lib.exe goto gotlib2
:NOLIB2
cls
echo Insert the PASCAL Library 2 diskette
echo 
pause
if exist lib.exe goto gotlib2
goto nolib2
:GOTLIB2
makelib2 %1 %2 %3 %4
:EXIT
echo 
