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 CLIBRLIB.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: clibrcmp model filename extension [TCC or TASM switches]
- echo
- echo Examples: clibrcmp ALL screen cas
- echo clibrcmp HUGE fopen c -N
- echo clibrcmp LARGE setargv asm
- 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 model version ***
- tcc -ms -nsmall -c %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 model version ***
- tcc -mm -nmedium -c %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 model version ***
- tcc -mc -ncompact -c %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 model version ***
- tcc -ml -nlarge -c %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 model version ***
- tcc -mh -nhuge -c %4 %5 %6 %7 %8 %9 %2.%3
- if errorlevel 1 goto TCCerror
-
- goto DONE
-
- :TCCerror
- echo ********************************************************************
- echo Compilation errors !!
- echo ********************************************************************
- goto DONE
-
- :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__ /MX /t /i..\include /m %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__M__ /MX /t /i..\include /m %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__C__ /MX /t /i..\include /m %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__L__ /MX /t /i..\include /m %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__H__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, huge\;
- if errorlevel 1 goto ASMerror
-
- goto DONE
-
- :ASMerror
- echo ********************************************************************
- echo Assembly errors !!
- echo ********************************************************************
- goto DONE
-
- :DONE
-