home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / MATH.ZIP / MATHRCMP.BAT < prev    next >
Encoding:
DOS Batch File  |  1990-06-07  |  4.5 KB  |  166 lines

  1. echo off
  2.  
  3. if /%1==/ goto HELP
  4. if /%2==/ goto HELP
  5. if /%3==/ goto HELP
  6.  
  7. if %1==SMALL    goto modelOK
  8. if %1==small    goto modelOK
  9. if %1==MEDIUM   goto modelOK
  10. if %1==medium   goto modelOK
  11. if %1==COMPACT  goto modelOK
  12. if %1==compact  goto modelOK
  13. if %1==LARGE    goto modelOK
  14. if %1==large    goto modelOK
  15. if %1==HUGE     goto modelOK
  16. if %1==huge     goto modelOK
  17. if %1==ALL      goto modelOK
  18. if %1==all      goto modelOK
  19.  
  20. :HELP
  21. echo 
  22. echo This batch file will recompile the specified source file for
  23. echo the selected memory model, and place the resultant object file
  24. echo in the SMALL, COMPACT, MEDIUM, LARGE, or HUGE subdirectory
  25. echo (for use with MATHRLIB.BAT).
  26. echo 
  27. echo The "model" parameter specifies which memory model should be used.
  28. echo When ALL is specified, the file is recompiled for all memory models.
  29. echo 
  30. echo Usage:     mathrcmp   model   filename  extension  [TCC or TASM switches]
  31. echo 
  32. echo Examples:  mathrcmp   ALL     realcvt   cas
  33. echo            mathrcmp   LARGE   gcvt      c          -N
  34. echo 
  35. goto DONE
  36.  
  37. :modelOK
  38.  
  39. if %3==asm goto ASMfile
  40. if %3==ASM goto ASMfile
  41.  
  42. if %1==MEDIUM   goto DOmd1
  43. if %1==medium   goto DOmd1
  44. if %1==COMPACT  goto DOcp1
  45. if %1==compact  goto DOcp1
  46. if %1==LARGE    goto DOlg1
  47. if %1==large    goto DOlg1
  48. if %1==HUGE     goto DOhg1
  49. if %1==huge     goto DOhg1
  50.  
  51. :DOsm1
  52. echo *** Compiling SMALL version ***
  53. tcc -c -ms -nsmall %4 %5 %6 %7 %8 %9 %2.%3
  54. if errorlevel 1 goto TCCerror
  55. if %1==SMALL    goto DONE
  56. if %1==small    goto DONE
  57.  
  58. :DOmd1
  59. echo *** Compiling MEDIUM version ***
  60. tcc -c -mm -nmedium %4 %5 %6 %7 %8 %9 %2.%3
  61. if errorlevel 1 goto TCCerror
  62. if %1==MEDIUM   goto DONE
  63. if %1==medium   goto DONE
  64.  
  65. :DOcp1
  66. echo *** Compiling COMPACT version ***
  67. tcc -c -mc -ncompact %4 %5 %6 %7 %8 %9 %2.%3
  68. if errorlevel 1 goto TCCerror
  69. if %1==COMPACT  goto DONE
  70. if %1==compact  goto DONE
  71.  
  72. :DOlg1
  73. echo *** Compiling LARGE version ***
  74. tcc -c -ml -nlarge %4 %5 %6 %7 %8 %9 %2.%3
  75. if errorlevel 1 goto TCCerror
  76. if %1==LARGE    goto DONE
  77. if %1==large    goto DONE
  78.  
  79. :DOhg1
  80. echo *** Compiling HUGE version ***
  81. tcc -c -mh -nhuge %4 %5 %6 %7 %8 %9 %2.%3
  82. if errorlevel 1 goto TCCerror
  83.  
  84. goto DONE
  85.  
  86. :ASMfile
  87. if %2==flags87 goto ASMindep1
  88. if %2==FLAGS87 goto ASMindep1
  89. if %2==ftol    goto ASMindep2
  90. if %2==FTOL    goto ASMindep2
  91. if %2==emuvars goto ASMdep
  92. if %2==EMUVARS goto ASMdep
  93.  
  94. echo ********************************************************************
  95. echo Error: unknown source file "%2.%3" !!!
  96. echo ********************************************************************
  97. goto DONE
  98.  
  99. :ASMdep
  100. if %1==MEDIUM   goto DOmd2
  101. if %1==medium   goto DOmd2
  102. if %1==COMPACT  goto DOcp2
  103. if %1==compact  goto DOcp2
  104. if %1==LARGE    goto DOlg2
  105. if %1==large    goto DOlg2
  106. if %1==HUGE     goto DOhg2
  107. if %1==huge     goto DOhg2
  108.  
  109. :DOsm2
  110. echo *** Assembling SMALL   model version ***
  111. tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=0 %4 %5 %6 %7 %8 %9, small\
  112. if errorlevel 1 goto ASMerror
  113. if %1==SMALL    goto DONE
  114. if %1==small    goto DONE
  115.  
  116. :DOmd2
  117. echo *** Assembling MEDIUM  model version ***
  118. tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=0 %4 %5 %6 %7 %8 %9, medium\
  119. if errorlevel 1 goto ASMerror
  120. if %1==MEDIUM   goto DONE
  121. if %1==medium   goto DONE
  122.  
  123. :DOcp2
  124. echo *** Assembling COMPACT model version ***
  125. tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, compact\
  126. if errorlevel 1 goto ASMerror
  127. if %1==COMPACT  goto DONE
  128. if %1==compact  goto DONE
  129.  
  130. :DOlg2
  131. echo *** Assembling LARGE   model version ***
  132. tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, large\
  133. if errorlevel 1 goto ASMerror
  134. if %1==LARGE    goto DONE
  135. if %1==large    goto DONE
  136.  
  137. :DOhg2
  138. echo *** Assembling HUGE    model version ***
  139. tasm %2 /D__COMPACT__ /D__BSS__ /E /DLDATA=1 %4 %5 %6 %7 %8 %9, huge\
  140. if errorlevel 1 goto ASMerror
  141. goto DONE
  142.  
  143. :ASMindep1
  144. tasm flags87 /D__COMPACT__ /D__BSS__ %4 %5 %6 %7 %8 %9, obj\
  145. if errorlevel 1 goto ASMerror
  146. goto DONE
  147.  
  148. :ASMindep2
  149. tasm ftol.asm /D__COMPACT__ /D__BSS__ /DFCall %4 %5 %6 %7 %8 %9, obj\fftol.obj
  150. tasm ftol.asm /D__COMPACT__ /D__BSS__ /DNCall %4 %5 %6 %7 %8 %9, obj\nftol.obj
  151. if errorlevel 1 goto ASMerror
  152. goto DONE
  153.  
  154. :TCCerror
  155. echo ********************************************************************
  156. echo Compilation errors !!
  157. echo ********************************************************************
  158. goto DONE
  159.  
  160. :ASMerror
  161. echo ********************************************************************
  162. echo Assembly errors !!
  163. echo ********************************************************************
  164.  
  165. :DONE
  166.