home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / CLIBRCMP.BAT < prev    next >
Encoding:
DOS Batch File  |  1990-06-07  |  3.9 KB  |  146 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 CLIBRLIB.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:     clibrcmp   model   filename  extension  [TCC or TASM switches]
  31. echo 
  32. echo Examples:  clibrcmp   ALL     screen    cas
  33. echo            clibrcmp   HUGE    fopen     c          -N
  34. echo            clibrcmp   LARGE   setargv   asm
  35. echo 
  36. goto DONE
  37.  
  38. :modelOK
  39.  
  40. if %3==asm goto ASMfile
  41. if %3==ASM goto ASMfile
  42.  
  43. if %1==MEDIUM   goto DOmd1
  44. if %1==medium   goto DOmd1
  45. if %1==COMPACT  goto DOcp1
  46. if %1==compact  goto DOcp1
  47. if %1==LARGE    goto DOlg1
  48. if %1==large    goto DOlg1
  49. if %1==HUGE     goto DOhg1
  50. if %1==huge     goto DOhg1
  51.  
  52. :DOsm1
  53. echo *** Compiling SMALL   model version ***
  54. tcc -ms -nsmall -c %4 %5 %6 %7 %8 %9 %2.%3
  55. if errorlevel 1 goto TCCerror
  56. if %1==SMALL    goto DONE
  57. if %1==small    goto DONE
  58.  
  59. :DOmd1
  60. echo *** Compiling MEDIUM  model version ***
  61. tcc -mm -nmedium -c %4 %5 %6 %7 %8 %9 %2.%3 
  62. if errorlevel 1 goto TCCerror
  63. if %1==MEDIUM   goto DONE
  64. if %1==medium   goto DONE
  65.  
  66. :DOcp1
  67. echo *** Compiling COMPACT model version ***
  68. tcc -mc -ncompact -c %4 %5 %6 %7 %8 %9 %2.%3 
  69. if errorlevel 1 goto TCCerror
  70. if %1==COMPACT  goto DONE
  71. if %1==compact  goto DONE
  72.  
  73. :DOlg1
  74. echo *** Compiling LARGE   model version ***
  75. tcc -ml -nlarge -c %4 %5 %6 %7 %8 %9 %2.%3 
  76. if errorlevel 1 goto TCCerror
  77. if %1==LARGE    goto DONE
  78. if %1==large    goto DONE
  79.  
  80. :DOhg1
  81. echo *** Compiling HUGE    model version ***
  82. tcc -mh -nhuge -c %4 %5 %6 %7 %8 %9 %2.%3 
  83. if errorlevel 1 goto TCCerror
  84.  
  85. goto DONE
  86.  
  87. :TCCerror
  88. echo ********************************************************************
  89. echo Compilation errors !!
  90. echo ********************************************************************
  91. goto DONE
  92.  
  93. :ASMfile
  94.  
  95. if %1==MEDIUM   goto DOmd2
  96. if %1==medium   goto DOmd2
  97. if %1==COMPACT  goto DOcp2
  98. if %1==compact  goto DOcp2
  99. if %1==LARGE    goto DOlg2
  100. if %1==large    goto DOlg2
  101. if %1==HUGE     goto DOhg2
  102. if %1==huge     goto DOhg2
  103.  
  104. :DOsm2
  105. echo *** Assembling SMALL   model version ***
  106. tasm %2 /D__S__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, small\;
  107. if errorlevel 1 goto ASMerror
  108. if %1==SMALL    goto DONE
  109. if %1==small    goto DONE
  110.  
  111. :DOmd2
  112. echo *** Assembling MEDIUM  model version ***
  113. tasm %2 /D__M__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, medium\;
  114. if errorlevel 1 goto ASMerror
  115. if %1==MEDIUM   goto DONE
  116. if %1==medium   goto DONE
  117.  
  118. :DOcp2
  119. echo *** Assembling COMPACT model version ***
  120. tasm %2 /D__C__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, compact\;
  121. if errorlevel 1 goto ASMerror
  122. if %1==COMPACT  goto DONE
  123. if %1==compact  goto DONE
  124.  
  125. :DOlg2
  126. echo *** Assembling LARGE   model version ***
  127. tasm %2 /D__L__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, large\;
  128. if errorlevel 1 goto ASMerror
  129. if %1==LARGE    goto DONE
  130. if %1==large    goto DONE
  131.  
  132. :DOhg2
  133. echo *** Assembling HUGE    model version ***
  134. tasm %2 /D__H__ /MX /t /i..\include /m %4 %5 %6 %7 %8 %9, huge\;
  135. if errorlevel 1 goto ASMerror
  136.  
  137. goto DONE
  138.  
  139. :ASMerror
  140. echo ********************************************************************
  141. echo Assembly errors !!
  142. echo ********************************************************************
  143. goto DONE
  144.  
  145. :DONE
  146.