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

  1. echo off
  2.  
  3. if /%1==/ goto HELP
  4. if /%2==/ goto HELP
  5. if /%3==/ goto HELP
  6. if /%4==/ goto HELP
  7.  
  8. if %1==SMALL    goto modelOK
  9. if %1==small    goto modelOK
  10. if %1==MEDIUM   goto modelOK
  11. if %1==medium   goto modelOK
  12. if %1==COMPACT  goto modelOK
  13. if %1==compact  goto modelOK
  14. if %1==LARGE    goto modelOK
  15. if %1==large    goto modelOK
  16. if %1==HUGE     goto modelOK
  17. if %1==huge     goto modelOK
  18. if %1==ALL      goto modelOK
  19. if %1==all      goto modelOK
  20.  
  21. :HELP
  22. echo 
  23. echo This batch file will recompile the specified module for the
  24. echo selected memory model, and replace the resultant object module
  25. echo in the SMALL, COMPACT, MEDIUM, LARGE, or HUGE library file
  26. echo in the specified library directory.
  27. echo 
  28. echo The "model" parameter specifies which memory model should be used.
  29. echo When ALL is specified, the file is recompiled and replaced for all
  30. echo memory models.
  31. echo 
  32. echo Usage:     clibrepl   model   filename  ext  lib-dir     [TCC or TASM switches]
  33. echo 
  34. echo Examples:  clibrepl   ALL     screen    cas  \turboc\lib -N
  35. echo            clibrepl   MEDIUM  setargv   asm  \turboc\lib
  36. echo 
  37. echo Note: do not include the trailing "\" in the lib-dir directory spec
  38. goto DONE
  39.  
  40. :modelOK
  41.  
  42. if %3==asm goto ASMfile
  43. if %3==ASM goto ASMfile
  44.  
  45. if %1==MEDIUM   goto DOmd1
  46. if %1==medium   goto DOmd1
  47. if %1==COMPACT  goto DOcp1
  48. if %1==compact  goto DOcp1
  49. if %1==LARGE    goto DOlg1
  50. if %1==large    goto DOlg1
  51. if %1==HUGE     goto DOhg1
  52. if %1==huge     goto DOhg1
  53.  
  54. :DOsm1
  55. echo *** Compiling SMALL   model version ***
  56. tcc -ms -c %5 %6 %7 %8 %9 %2.%3
  57. if errorlevel 1 goto TCerror
  58. tlib /0 %4\CS -+%2
  59. if errorlevel 1 goto TLerror
  60. if %1==SMALL    goto REMOVE
  61. if %1==small    goto REMOVE
  62.  
  63. :DOmd1
  64. echo *** Compiling MEDIUM  model version ***
  65. tcc -mm -c %5 %6 %7 %8 %9 %2.%3
  66. if errorlevel 1 goto TCerror
  67. tlib /0 %4\CM -+%2
  68. if errorlevel 1 goto TLerror
  69. if %1==MEDIUM   goto REMOVE
  70. if %1==medium   goto REMOVE
  71.  
  72. :DOcp1
  73. echo *** Compiling COMPACT model version ***
  74. tcc -mc -c %5 %6 %7 %8 %9 %2.%3
  75. if errorlevel 1 goto TCerror
  76. tlib /0 %4\CC -+%2
  77. if errorlevel 1 goto TLerror
  78. if %1==COMPACT  goto REMOVE
  79. if %1==compact  goto REMOVE
  80.  
  81. :DOlg1
  82. echo *** Compiling LARGE   model version ***
  83. tcc -ml -c %5 %6 %7 %8 %9 %2.%3
  84. if errorlevel 1 goto TCerror
  85. tlib /0 %4\CL -+%2
  86. if errorlevel 1 goto TLerror
  87. if %1==LARGE    goto REMOVE
  88. if %1==large    goto REMOVE
  89.  
  90. :DOhg1
  91. echo *** Compiling HUGE    model version ***
  92. tcc -mh -c %5 %6 %7 %8 %9 %2.%3
  93. if errorlevel 1 goto TCerror
  94. tlib /0 %4\CH -+%2
  95. if errorlevel 1 goto TLerror
  96.  
  97. goto REMOVE
  98.  
  99.  
  100. :ASMfile
  101.  
  102. if %1==MEDIUM   goto DOmd2
  103. if %1==medium   goto DOmd2
  104. if %1==COMPACT  goto DOcp2
  105. if %1==compact  goto DOcp2
  106. if %1==LARGE    goto DOlg2
  107. if %1==large    goto DOlg2
  108. if %1==HUGE     goto DOhg2
  109. if %1==huge     goto DOhg2
  110.  
  111. :DOsm2
  112. echo *** Assembling SMALL   model version ***
  113. tasm %2 /D__S__ %5 %6 %7 %8 %9
  114. if errorlevel 1 goto ASMerror
  115. tlib /0 %4\CS -+%2
  116. if errorlevel 1 goto TLerror
  117. if %1==SMALL    goto REMOVE
  118. if %1==small    goto REMOVE
  119.  
  120. :DOmd2
  121. echo *** Assembling MEDIUM  model version ***
  122. tasm %2 /D__M__ %5 %6 %7 %8 %9
  123. if errorlevel 1 goto ASMerror
  124. tlib /0 %4\CM -+%2
  125. if errorlevel 1 goto TLerror
  126. if %1==MEDIUM   goto REMOVE
  127. if %1==medium   goto REMOVE
  128.  
  129. :DOcp2
  130. echo *** Assembling COMPACT model version ***
  131. tasm %2 /D__C__ %5 %6 %7 %8 %9
  132. if errorlevel 1 goto ASMerror
  133. tlib /0 %4\CC -+%2
  134. if errorlevel 1 goto TLerror
  135. if %1==COMPACT  goto REMOVE
  136. if %1==compact  goto REMOVE
  137.  
  138. :DOlg2
  139. echo *** Assembling LARGE   model version ***
  140. tasm %2 /D__L__ %5 %6 %7 %8 %9
  141. if errorlevel 1 goto ASMerror
  142. tlib /0 %4\CL -+%2
  143. if errorlevel 1 goto TLerror
  144. if %1==LARGE    goto REMOVE
  145. if %1==large    goto REMOVE
  146.  
  147. :DOhg2
  148. echo *** Assembling HUGE    model version ***
  149. tasm %2 /D__H__ %5 %6 %7 %8 %9
  150. if errorlevel 1 goto ASMerror
  151. tlib /0 %4\CH -+%2
  152. if errorlevel 1 goto TLerror
  153.  
  154. goto REMOVE
  155.  
  156. :TCerror
  157. echo ********************************************************************
  158. echo Compilation errors !!
  159. echo ********************************************************************
  160. goto DONE
  161.  
  162. :TLerror
  163. echo ********************************************************************
  164. echo Librarian errors !!
  165. echo ********************************************************************
  166. goto REMOVE
  167.  
  168. :ASMerror
  169. echo ********************************************************************
  170. echo Assembly errors !!
  171. echo ********************************************************************
  172. goto DONE
  173.  
  174. :REMOVE
  175. if exist %2.obj del %2.obj
  176.  
  177. :DONE
  178.