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

  1. echo off
  2. if /%1==/ goto HELP
  3.  
  4. if %1==SMALL    goto modelOK
  5. if %1==small    goto modelOK
  6. if %1==MEDIUM   goto modelOK
  7. if %1==medium   goto modelOK
  8. if %1==COMPACT  goto modelOK
  9. if %1==compact  goto modelOK
  10. if %1==LARGE    goto modelOK
  11. if %1==large    goto modelOK
  12. if %1==HUGE     goto modelOK
  13. if %1==huge     goto modelOK
  14. if %1==ALL      goto modelOK
  15. if %1==all      goto modelOK
  16.  
  17. :HELP
  18. echo 
  19. echo This batch file will recompile all the MATH library files for the
  20. echo specifed memory model, placing the resultant object files in the
  21. echo appropriate directory (OBJ and SMALL, COMPACT, MEDIUM, LARGE, or
  22. echo HUGE). The library file can then be built from these object files
  23. echo using the MATHRLIB batch file.
  24. echo 
  25. echo The "model" parameter specifies which memory model should be used.
  26. echo When ALL is specified, the library is recompiled for all memory models.
  27. echo 
  28. echo Usage:    math  model   [tcc options]
  29. echo 
  30. echo Examples: math  ALL     -I\turboc\include
  31. echo           math  LARGE   -I.  -p  -N
  32. echo           math  MEDIUM
  33. echo 
  34. echo Note that recompiling all the source files using this batch file
  35. echo may take a considerable amount of time.
  36. echo 
  37. goto DONE
  38.  
  39. :modelOK
  40.  
  41. if exist *.obj del *.obj
  42. cd obj
  43. if exist *.obj del *.obj
  44. cd ..
  45.  
  46. echo ***
  47. echo *** Compile Model-Independent modules ***
  48. echo ***
  49. tasm /D__COMPACT__ /D__BSS__ flags87.asm, obj\
  50. if errorlevel 1 goto ASMerror
  51. tasm /D__COMPACT__ /D__BSS__ /DFCall ftol.asm, obj\fftol.obj
  52. if errorlevel 1 goto ASMerror
  53. tasm /D__COMPACT__ /D__BSS__ /DNCall ftol.asm, obj\nftol.obj
  54. if errorlevel 1 goto ASMerror
  55.  
  56. if %1z==MEDIUM   goto DOmd
  57. if %1==medium   goto DOmd
  58. if %1==COMPACT  goto DOcp
  59. if %1==compact  goto DOcp
  60. if %1==LARGE    goto DOlg
  61. if %1==large    goto DOlg
  62. if %1==HUGE     goto DOhg
  63. if %1==huge     goto DOhg
  64.  
  65. :DOsm
  66. echo ***
  67. echo *** Building SMALL Math Library ***
  68. echo ***
  69. cd small
  70. if exist *.obj del *.obj
  71. cd ..
  72. tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=0 emuvars.asm, small\
  73. if errorlevel 1 goto ASMerror
  74. tcc -ms -nsmall -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
  75. if errorlevel 1 goto TCCerror
  76. if exist MATHS.LIB del MATHS.LIB
  77. cd small
  78. copy ..\obj\*.obj 
  79. tlib /E /0 ..\MATHS @..\MATH.RSP
  80. cd ..
  81. if %1==SMALL    goto DONE
  82. if %1==small    goto DONE
  83.  
  84. :DOmd
  85. echo ***
  86. echo *** Building MEDIUM Math Library ***
  87. echo ***
  88. cd medium
  89. if exist *.obj del *.obj
  90. cd ..
  91. tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=0 emuvars.asm, medium\
  92. if errorlevel 1 goto ASMerror
  93. tcc -mm -nmedium -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
  94. if errorlevel 1 goto TCCerror
  95. if exist MATHM.LIB del MATHM.LIB
  96. cd medium
  97. copy ..\obj\*.obj 
  98. tlib /E /0 ..\MATHM @..\MATH.RSP
  99. cd ..
  100. if %1==MEDIUM   goto DONE
  101. if %1==medium   goto DONE
  102.  
  103. :DOcp
  104. echo ***
  105. echo *** Building COMPACT Math Library ***
  106. echo ***
  107. cd compact
  108. if exist *.obj del *.obj
  109. cd ..
  110. tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, compact\
  111. if errorlevel 1 goto ASMerror
  112. tcc -mc -ncompact -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
  113. if errorlevel 1 goto TCCerror
  114. if exist MATHC.LIB del MATHC.LIB
  115. cd compact
  116. copy ..\obj\*.obj 
  117. tlib /E /0 ..\MATHC @..\MATH.RSP
  118. cd ..
  119. if %1==COMPACT  goto DONE
  120. if %1==compact  goto DONE
  121.  
  122. :DOlg
  123. echo ***
  124. echo *** Building LARGE Math Library ***
  125. echo ***
  126. cd large
  127. if exist *.obj del *.obj
  128. cd ..
  129. tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, large\
  130. if errorlevel 1 goto ASMerror
  131. tcc -ml -nlarge -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
  132. if errorlevel 1 goto TCCerror
  133. if exist MATHL.LIB del MATHL.LIB
  134. cd large
  135. copy ..\obj\*.obj 
  136. tlib /E /0 ..\MATHL @..\MATH.RSP
  137. cd ..
  138. if %1==LARGE    goto DONE
  139. if %1==large    goto DONE
  140.  
  141. :DOhg
  142. echo ***
  143. echo *** Building HUGE Math Library ***
  144. echo ***
  145. cd huge
  146. if exist *.obj del *.obj
  147. cd ..
  148. tasm /D__COMPACT__ /D__BSS__ /E /DLDATA=1 emuvars.asm, huge\
  149. if errorlevel 1 goto ASMerror
  150. tcc -mh -nhuge -c %2 %3 %4 %5 %6 %7 %8 %9 *.C *.CAS
  151. if errorlevel 1 goto TCCerror
  152. if exist MATHH.LIB del MATHH.LIB
  153. cd huge
  154. copy ..\obj\*.obj 
  155. tlib /E /0 ..\MATHH @..\MATH.RSP
  156. cd ..
  157. goto DONE
  158.  
  159. :ASMerror
  160. echo ********************************************************************
  161. echo Assembly errors !!
  162. echo ********************************************************************
  163. goto DONE
  164.  
  165. :TCCerror
  166. echo ********************************************************************
  167. echo Compile errors !!
  168. echo ********************************************************************
  169.  
  170. :DONE
  171.