home *** CD-ROM | disk | FTP | other *** search
- echo off
-
- if /%1==/ goto HELP
- if /%2==/ goto HELP
- if /%3==/ goto HELP
- if /%4==/ goto HELP
-
- if %1==SMALL goto modelOK
- if %1==small goto modelOK
- if %1==MEDIUM goto modelOK
- if %1==medium goto modelOK
- if %1==COMPACT goto modelOK
- if %1==compact goto modelOK
- if %1==LARGE goto modelOK
- if %1==large goto modelOK
- if %1==HUGE goto modelOK
- if %1==huge goto modelOK
- if %1==ALL goto modelOK
- if %1==all goto modelOK
-
- :HELP
- echo
- echo This batch file will recompile the specified module for the
- echo selected memory model, and replace the resultant object module
- echo in the SMALL, COMPACT, MEDIUM, LARGE, or HUGE library file
- echo in the specified library directory.
- echo
- echo The "model" parameter specifies which memory model should be used.
- echo When ALL is specified, the file is recompiled and replaced for all
- echo memory models.
- echo
- echo Usage: clibrepl model filename ext lib-dir [TCC or TASM switches]
- echo
- echo Examples: clibrepl ALL screen cas \turboc\lib -N
- echo clibrepl MEDIUM setargv asm \turboc\lib
- echo
- echo Note: do not include the trailing "\" in the lib-dir directory spec
- goto DONE
-
- :modelOK
-
- if %3==asm goto ASMfile
- if %3==ASM goto ASMfile
-
- if %1==MEDIUM goto DOmd1
- if %1==medium goto DOmd1
- if %1==COMPACT goto DOcp1
- if %1==compact goto DOcp1
- if %1==LARGE goto DOlg1
- if %1==large goto DOlg1
- if %1==HUGE goto DOhg1
- if %1==huge goto DOhg1
-
- :DOsm1
- echo *** Compiling SMALL model version ***
- tcc -ms -c %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCerror
- tlib /0 %4\CS -+%2
- if errorlevel 1 goto TLerror
- if %1==SMALL goto REMOVE
- if %1==small goto REMOVE
-
- :DOmd1
- echo *** Compiling MEDIUM model version ***
- tcc -mm -c %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCerror
- tlib /0 %4\CM -+%2
- if errorlevel 1 goto TLerror
- if %1==MEDIUM goto REMOVE
- if %1==medium goto REMOVE
-
- :DOcp1
- echo *** Compiling COMPACT model version ***
- tcc -mc -c %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCerror
- tlib /0 %4\CC -+%2
- if errorlevel 1 goto TLerror
- if %1==COMPACT goto REMOVE
- if %1==compact goto REMOVE
-
- :DOlg1
- echo *** Compiling LARGE model version ***
- tcc -ml -c %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCerror
- tlib /0 %4\CL -+%2
- if errorlevel 1 goto TLerror
- if %1==LARGE goto REMOVE
- if %1==large goto REMOVE
-
- :DOhg1
- echo *** Compiling HUGE model version ***
- tcc -mh -c %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCerror
- tlib /0 %4\CH -+%2
- if errorlevel 1 goto TLerror
-
- goto REMOVE
-
-
- :ASMfile
-
- if %1==MEDIUM goto DOmd2
- if %1==medium goto DOmd2
- if %1==COMPACT goto DOcp2
- if %1==compact goto DOcp2
- if %1==LARGE goto DOlg2
- if %1==large goto DOlg2
- if %1==HUGE goto DOhg2
- if %1==huge goto DOhg2
-
- :DOsm2
- echo *** Assembling SMALL model version ***
- tasm %2 /D__S__ %5 %6 %7 %8 %9
- if errorlevel 1 goto ASMerror
- tlib /0 %4\CS -+%2
- if errorlevel 1 goto TLerror
- if %1==SMALL goto REMOVE
- if %1==small goto REMOVE
-
- :DOmd2
- echo *** Assembling MEDIUM model version ***
- tasm %2 /D__M__ %5 %6 %7 %8 %9
- if errorlevel 1 goto ASMerror
- tlib /0 %4\CM -+%2
- if errorlevel 1 goto TLerror
- if %1==MEDIUM goto REMOVE
- if %1==medium goto REMOVE
-
- :DOcp2
- echo *** Assembling COMPACT model version ***
- tasm %2 /D__C__ %5 %6 %7 %8 %9
- if errorlevel 1 goto ASMerror
- tlib /0 %4\CC -+%2
- if errorlevel 1 goto TLerror
- if %1==COMPACT goto REMOVE
- if %1==compact goto REMOVE
-
- :DOlg2
- echo *** Assembling LARGE model version ***
- tasm %2 /D__L__ %5 %6 %7 %8 %9
- if errorlevel 1 goto ASMerror
- tlib /0 %4\CL -+%2
- if errorlevel 1 goto TLerror
- if %1==LARGE goto REMOVE
- if %1==large goto REMOVE
-
- :DOhg2
- echo *** Assembling HUGE model version ***
- tasm %2 /D__H__ %5 %6 %7 %8 %9
- if errorlevel 1 goto ASMerror
- tlib /0 %4\CH -+%2
- if errorlevel 1 goto TLerror
-
- goto REMOVE
-
- :TCerror
- echo ********************************************************************
- echo Compilation errors !!
- echo ********************************************************************
- goto DONE
-
- :TLerror
- echo ********************************************************************
- echo Librarian errors !!
- echo ********************************************************************
- goto REMOVE
-
- :ASMerror
- echo ********************************************************************
- echo Assembly errors !!
- echo ********************************************************************
- goto DONE
-
- :REMOVE
- if exist %2.obj del %2.obj
-
- :DONE
-