home *** CD-ROM | disk | FTP | other *** search
- echo off
-
- if /%1==/ goto HELP
- if /%2==/ goto HELP
- if /%3==/ 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 source file for
- echo the selected memory model, and place the resultant object file
- echo in the SMALL, COMPACT, MEDIUM, LARGE, or HUGE subdirectory
- echo (for use with MATHRLIB.BAT).
- echo
- echo The "model" parameter specifies which memory model should be used.
- echo When ALL is specified, the file is recompiled for all memory models.
- echo
- echo Usage: mathrcmp model filename extension [TCC or TASM switches]
- echo
- echo Examples: mathrcmp ALL realcvt cas
- echo mathrcmp LARGE gcvt c -N
- echo
- 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 version ***
- tcc -c -ms -nsmall %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
- if %1==SMALL goto DONE
- if %1==small goto DONE
-
- :DOmd1
- echo *** Compiling MEDIUM version ***
- tcc -c -mm -nmedium %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
- if %1==MEDIUM goto DONE
- if %1==medium goto DONE
-
- :DOcp1
- echo *** Compiling COMPACT version ***
- tcc -c -mc -ncompact %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
- if %1==COMPACT goto DONE
- if %1==compact goto DONE
-
- :DOlg1
- echo *** Compiling LARGE version ***
- tcc -c -ml -nlarge %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
- if %1==LARGE goto DONE
- if %1==large goto DONE
-
- :DOhg1
- echo *** Compiling HUGE version ***
- tcc -c -mh -nhuge %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
-
- goto DONE
-
- :ASMfile
- if %2==flags87 goto ASMindep1
- if %2==FLAGS87 goto ASMindep1
- if %2==ftol goto ASMindep2
- if %2==FTOL goto ASMindep2
- if %2==emuvars goto ASMdep
- if %2==EMUVARS goto ASMdep
-
- echo ********************************************************************
- echo Error: unknown source file "%2.%3" !!!
- echo ********************************************************************
- goto DONE
-
- :ASMdep
- 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__COMPACT__ /D__BSS__ /E /DLDATA=0 %4 %5 %6 %7 %8 %9, small\
- if errorlevel 1 goto ASMerror
- if %1==SMALL goto DONE
- if %1==small goto DONE
-
- :DOmd2
- echo *** Assembling MEDIUM model version ***
- tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=0 %4 %5 %6 %7 %8 %9, medium\
- if errorlevel 1 goto ASMerror
- if %1==MEDIUM goto DONE
- if %1==medium goto DONE
-
- :DOcp2
- echo *** Assembling COMPACT model version ***
- tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, compact\
- if errorlevel 1 goto ASMerror
- if %1==COMPACT goto DONE
- if %1==compact goto DONE
-
- :DOlg2
- echo *** Assembling LARGE model version ***
- tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, large\
- if errorlevel 1 goto ASMerror
- if %1==LARGE goto DONE
- if %1==large goto DONE
-
- :DOhg2
- echo *** Assembling HUGE model version ***
- tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, huge\
- if errorlevel 1 goto ASMerror
- goto DONE
-
- :ASMindep1
- tasm flags87 /D__COMPACT__ /D__BSS__ %4 %5 %6 %7 %8 %9, obj\
- if errorlevel 1 goto ASMerror
- goto DONE
-
- :ASMindep2
- tasm ftol.asm /D__COMPACT__ /D__BSS__ /DFCall %4 %5 %6 %7 %8 %9, obj\fftol.obj
- tasm ftol.asm /D__COMPACT__ /D__BSS__ /DNCall %4 %5 %6 %7 %8 %9, obj\nftol.obj
- if errorlevel 1 goto ASMerror
- goto DONE
-
- :TCCerror
- echo ********************************************************************
- echo Compilation errors !!
- echo ********************************************************************
- goto DONE
-
- :ASMerror
- echo ********************************************************************
- echo Assembly errors !!
- echo ********************************************************************
-
- :DONE
-