home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / CLIB.BAT < prev    next >
Encoding:
DOS Batch File  |  1990-06-07  |  4.1 KB  |  161 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 CLIB library files for the
  20. echo specifed memory model, placing the resultant object files in the
  21. echo appropriate directory (SMALL, COMPACT, MEDIUM, LARGE, or HUGE).
  22. echo The library file can then be built from these object files using
  23. echo the CLIBRLIB 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:    clib  model   [tcc options]
  29. echo 
  30. echo Examples: clib  ALL     -I\tc\include
  31. echo           clib  LARGE   -I.  -p  -u-
  32. echo           clib  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 %1==MEDIUM   goto DOmd
  42. if %1==medium   goto DOmd
  43. if %1==COMPACT  goto DOcp
  44. if %1==compact  goto DOcp
  45. if %1==LARGE    goto DOlg
  46. if %1==large    goto DOlg
  47. if %1==HUGE     goto DOhg
  48. if %1==huge     goto DOhg
  49.  
  50. :DOsm
  51. echo ***
  52. echo *** Building SMALL & TINY memory model libraries
  53. echo ***
  54. cd small
  55. if exist *.obj del *.obj
  56. cd ..
  57. tasm /D__S__ *.asm, small\;
  58. if errorlevel 1 goto ASMerror
  59. tcc -ms -nsmall -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
  60. if errorlevel 1 goto tccerror
  61. if exist CS.LIB del CS.LIB
  62. if exist OLDSTRMS.LIB del OLDSTRMS.LIB
  63. cd small
  64. tlib ..\CS /0 @..\CLIB.rsp
  65. tlib ..\OLDSTRMS /0 /C  @..\OLDSTRM.rsp
  66. cd ..
  67. if %1==SMALL    goto DONE
  68. if %1==small    goto DONE
  69.  
  70. :DOmd
  71. echo ***
  72. echo *** Building MEDIUM memory model library
  73. echo ***
  74. cd medium
  75. if exist *.obj del *.obj
  76. cd ..
  77. tasm /D__M__ *.asm, medium\;
  78. if errorlevel 1 goto ASMerror
  79. tcc -mm -nmedium -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
  80. if errorlevel 1 goto tccerror
  81. if exist CM.LIB del CM.LIB
  82. if exist OLDSTRMM.LIB del OLDSTRMM.LIB
  83. cd medium
  84. tlib ..\CM /0  @..\CLIB.rsp
  85. tlib ..\OLDSTRMM /0  @..\OLDSTRM.rsp
  86. cd ..
  87. if %1==MEDIUM   goto DONE
  88. if %1==medium   goto DONE
  89.  
  90. :DOcp
  91. echo ***
  92. echo *** Building COMPACT memory model library
  93. echo ***
  94. cd compact
  95. if exist *.obj del *.obj
  96. cd ..
  97. tasm /D__C__ *.asm, compact\;
  98. if errorlevel 1 goto ASMerror
  99. tcc -mc -ncompact -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
  100. if errorlevel 1 goto tccerror
  101. if exist CC.LIB del CC.LIB
  102. if exist OLDSTRMC.LIB del OLDSTRMC.LIB
  103. cd compact
  104. tlib ..\CC /0  @..\CLIB.rsp
  105. tlib ..\OLDSTRMC /0  @..\OLDSTRM.rsp
  106. cd ..
  107. if %1==COMPACT  goto DONE
  108. if %1==compact  goto DONE
  109.  
  110. :DOlg
  111. echo ***
  112. echo *** Building LARGE memory model library
  113. echo ***
  114. cd large
  115. if exist *.obj del *.obj
  116. cd ..
  117. tasm /D__L__ *.asm, large\;
  118. if errorlevel 1 goto ASMerror
  119. tcc -ml -nlarge -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
  120. if errorlevel 1 goto tccerror
  121. if exist CL.LIB del CL.LIB
  122. if exist OLDSTRML.LIB del OLDSTRML.LIB
  123. cd large
  124. tlib ..\CL /0  @..\CLIB.rsp
  125. tlib ..\OLDSTRML /0  @..\OLDSTRM.rsp
  126. cd ..
  127. if %1==LARGE    goto DONE
  128. if %1==large    goto DONE
  129.  
  130. :DOhg
  131. echo ***
  132. echo *** Building HUGE memory model library
  133. echo ***
  134. cd huge
  135. if exist *.obj del *.obj
  136. cd ..
  137. tasm /D__H__ *.asm, huge\;
  138. if errorlevel 1 goto ASMerror
  139. tcc -mh -nhuge -c %2 %3 %4 %5 %6 %7 %8 %9 *.c *.cas *.cpp
  140. if errorlevel 1 goto tccerror
  141. if exist CH.LIB del CH.LIB
  142. if exist OLDSTRMH.LIB del OLDSTRMH.LIB
  143. cd huge
  144. tlib ..\CH /0  @..\CLIB.rsp
  145. tlib ..\OLDSTRMH /0  @..\OLDSTRM.rsp
  146. cd ..
  147. goto DONE
  148.  
  149. :ASMerror
  150. echo ********************************************************************
  151. echo Assembly errors !!
  152. echo ********************************************************************
  153. goto DONE
  154.  
  155. :TCCerror
  156. echo ********************************************************************
  157. echo Compile errors !!
  158. echo ********************************************************************
  159.  
  160. :DONE
  161.