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 MATH library files for the
- echo specifed memory model, placing the resultant object files in the
- echo appropriate directory (OBJ and SMALL, COMPACT, MEDIUM, LARGE, or
- echo HUGE). The library file can then be built from these object files
- echo using the MATHRLIB 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: math model [tcc options]
- echo
- echo Examples: math ALL -I\turboc\include
- echo math LARGE -I. -p -N
- echo math 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 exist *.obj del *.obj
- cd obj
- if exist *.obj del *.obj
- cd ..
-
- echo ***
- echo *** Compile Model-Independent modules ***
- echo ***
- tasm /D__COMPACT__ /D__BSS__ flags87.asm, obj\
- if errorlevel 1 goto ASMerror
- tasm /D__COMPACT__ /D__BSS__ /DFCall ftol.asm, obj\fftol.obj
- if errorlevel 1 goto ASMerror
- tasm /D__COMPACT__ /D__BSS__ /DNCall ftol.asm, obj\nftol.obj
- if errorlevel 1 goto ASMerror
-
- if %1z==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 Math Library ***
- echo ***
- cd small
- if exist *.obj del *.obj
- cd ..
- tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=0 emuvars.asm, small\
- if errorlevel 1 goto ASMerror
- tcc -ms -nsmall -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
- if errorlevel 1 goto TCCerror
- if exist MATHS.LIB del MATHS.LIB
- cd small
- copy ..\obj\*.obj
- tlib /E /0 ..\MATHS @..\MATH.RSP
- cd ..
- if %1==SMALL goto DONE
- if %1==small goto DONE
-
- :DOmd
- echo ***
- echo *** Building MEDIUM Math Library ***
- echo ***
- cd medium
- if exist *.obj del *.obj
- cd ..
- tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=0 emuvars.asm, medium\
- if errorlevel 1 goto ASMerror
- tcc -mm -nmedium -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
- if errorlevel 1 goto TCCerror
- if exist MATHM.LIB del MATHM.LIB
- cd medium
- copy ..\obj\*.obj
- tlib /E /0 ..\MATHM @..\MATH.RSP
- cd ..
- if %1==MEDIUM goto DONE
- if %1==medium goto DONE
-
- :DOcp
- echo ***
- echo *** Building COMPACT Math Library ***
- echo ***
- cd compact
- if exist *.obj del *.obj
- cd ..
- tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, compact\
- if errorlevel 1 goto ASMerror
- tcc -mc -ncompact -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
- if errorlevel 1 goto TCCerror
- if exist MATHC.LIB del MATHC.LIB
- cd compact
- copy ..\obj\*.obj
- tlib /E /0 ..\MATHC @..\MATH.RSP
- cd ..
- if %1==COMPACT goto DONE
- if %1==compact goto DONE
-
- :DOlg
- echo ***
- echo *** Building LARGE Math Library ***
- echo ***
- cd large
- if exist *.obj del *.obj
- cd ..
- tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, large\
- if errorlevel 1 goto ASMerror
- tcc -ml -nlarge -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
- if errorlevel 1 goto TCCerror
- if exist MATHL.LIB del MATHL.LIB
- cd large
- copy ..\obj\*.obj
- tlib /E /0 ..\MATHL @..\MATH.RSP
- cd ..
- if %1==LARGE goto DONE
- if %1==large goto DONE
-
- :DOhg
- echo ***
- echo *** Building HUGE Math Library ***
- echo ***
- cd huge
- if exist *.obj del *.obj
- cd ..
- tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, huge\
- if errorlevel 1 goto ASMerror
- tcc -mh -nhuge -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
- if errorlevel 1 goto TCCerror
- if exist MATHH.LIB del MATHH.LIB
- cd huge
- copy ..\obj\*.obj
- tlib /E /0 ..\MATHH @..\MATH.RSP
- cd ..
- goto DONE
-
- :ASMerror
- echo ********************************************************************
- echo Assembly errors !!
- echo ********************************************************************
- goto DONE
-
- :TCCerror
- echo ********************************************************************
- echo Compile errors !!
- echo ********************************************************************
-
- :DONE
-