home *** CD-ROM | disk | FTP | other *** search
- echo off
- if /%1==/ 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 all the CLIB library files for the
- echo specifed memory model, placing the resultant object files in the
- echo appropriate directory (SMALL, COMPACT, MEDIUM, LARGE, or HUGE).
- echo The library file can then be built from these object files using
- echo the CLIBRLIB batch file.
- echo
- echo The "model" parameter specifies which memory model should be used.
- echo When ALL is specified, the library is recompiled for all memory models.
- echo
- echo Usage: clib model [tcc options]
- echo
- echo Examples: clib ALL -I\tc\include
- echo clib LARGE -I. -p -u-
- echo clib MEDIUM
- echo
- echo Note that recompiling all the source files using this batch file
- echo may take a considerable amount of time.
- echo
- goto DONE
-
- :modelOK
-
- if %1==MEDIUM goto DOmd
- if %1==medium goto DOmd
- if %1==COMPACT goto DOcp
- if %1==compact goto DOcp
- if %1==LARGE goto DOlg
- if %1==large goto DOlg
- if %1==HUGE goto DOhg
- if %1==huge goto DOhg
-
- :DOsm
- echo ***
- echo *** Building SMALL & TINY memory model libraries
- echo ***
- cd small
- if exist *.obj del *.obj
- cd ..
- tasm /D__S__ *.asm, small\;
- if errorlevel 1 goto ASMerror
- tcc -ms -nsmall -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
- if errorlevel 1 goto tccerror
- if exist CS.LIB del CS.LIB
- if exist OLDSTRMS.LIB del OLDSTRMS.LIB
- cd small
- tlib ..\CS /0 @..\CLIB.rsp
- tlib ..\OLDSTRMS /0 /C @..\OLDSTRM.rsp
- cd ..
- if %1==SMALL goto DONE
- if %1==small goto DONE
-
- :DOmd
- echo ***
- echo *** Building MEDIUM memory model library
- echo ***
- cd medium
- if exist *.obj del *.obj
- cd ..
- tasm /D__M__ *.asm, medium\;
- if errorlevel 1 goto ASMerror
- tcc -mm -nmedium -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
- if errorlevel 1 goto tccerror
- if exist CM.LIB del CM.LIB
- if exist OLDSTRMM.LIB del OLDSTRMM.LIB
- cd medium
- tlib ..\CM /0 @..\CLIB.rsp
- tlib ..\OLDSTRMM /0 @..\OLDSTRM.rsp
- cd ..
- if %1==MEDIUM goto DONE
- if %1==medium goto DONE
-
- :DOcp
- echo ***
- echo *** Building COMPACT memory model library
- echo ***
- cd compact
- if exist *.obj del *.obj
- cd ..
- tasm /D__C__ *.asm, compact\;
- if errorlevel 1 goto ASMerror
- tcc -mc -ncompact -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
- if errorlevel 1 goto tccerror
- if exist CC.LIB del CC.LIB
- if exist OLDSTRMC.LIB del OLDSTRMC.LIB
- cd compact
- tlib ..\CC /0 @..\CLIB.rsp
- tlib ..\OLDSTRMC /0 @..\OLDSTRM.rsp
- cd ..
- if %1==COMPACT goto DONE
- if %1==compact goto DONE
-
- :DOlg
- echo ***
- echo *** Building LARGE memory model library
- echo ***
- cd large
- if exist *.obj del *.obj
- cd ..
- tasm /D__L__ *.asm, large\;
- if errorlevel 1 goto ASMerror
- tcc -ml -nlarge -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
- if errorlevel 1 goto tccerror
- if exist CL.LIB del CL.LIB
- if exist OLDSTRML.LIB del OLDSTRML.LIB
- cd large
- tlib ..\CL /0 @..\CLIB.rsp
- tlib ..\OLDSTRML /0 @..\OLDSTRM.rsp
- cd ..
- if %1==LARGE goto DONE
- if %1==large goto DONE
-
- :DOhg
- echo ***
- echo *** Building HUGE memory model library
- echo ***
- cd huge
- if exist *.obj del *.obj
- cd ..
- tasm /D__H__ *.asm, huge\;
- if errorlevel 1 goto ASMerror
- tcc -mh -nhuge -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
- if errorlevel 1 goto tccerror
- if exist CH.LIB del CH.LIB
- if exist OLDSTRMH.LIB del OLDSTRMH.LIB
- cd huge
- tlib ..\CH /0 @..\CLIB.rsp
- tlib ..\OLDSTRMH /0 @..\OLDSTRM.rsp
- cd ..
- goto DONE
-
- :ASMerror
- echo ********************************************************************
- echo Assembly errors !!
- echo ********************************************************************
- goto DONE
-
- :TCCerror
- echo ********************************************************************
- echo Compile errors !!
- echo ********************************************************************
-
- :DONE
-