home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 328_01 / mwmake.bat < prev    next >
DOS Batch File  |  1989-12-27  |  2KB  |  91 lines

  1. ECHO OFF
  2. CLS
  3. REM MICROSOFT C version
  4. REM This .BAT file compiles the windows routines and places them in
  5. REM a library. You can specify model, and text-only vs text/graphics
  6. REM
  7. REM Note that this .bat file can't be used to build the library from scratch
  8. REM    because the microsoft librarian halts if you specify -+ on a new lib.
  9. REM 
  10. REM default is all files matching w*,
  11. REM but parameter %3 may name files
  12.  
  13.    set wn=w*
  14.    if (%3) == () goto :WSTAR
  15.    set wn=%3
  16.  
  17. :WSTAR
  18.  
  19. REM see if we're building TEXT or graphics libraries
  20.     set d = error
  21.     if (%1)  == (T) set d=/DTEXTONLY
  22.     if (%1)  == (t) set d=/DTEXTONLY
  23.     if (%1)  == (G) set d=
  24.     if (%1)  == (g) set d=
  25.     if (%d%) == (error) goto :HELPEM
  26.  
  27. REM validate choice of model, define symbols for compiler
  28.     if NOT (%2) == (T) goto :TRYS
  29.         set mdl=__TINY__
  30.         goto :OK
  31. :TRYS
  32.     if NOT (%2) == (S) goto :TRYC
  33.         set mdl=__SMALL__
  34.         goto :OK
  35. :TRYC
  36.     if NOT (%2) == (C) goto :TRYM
  37.         set mdl=__COMPACT__
  38.         goto :OK
  39. :TRYM
  40.     if NOT (%2) == (M) goto :TRYL
  41.         set mdl=__MEDIUM__
  42.         goto :OK
  43. :TRYL
  44.     if NOT (%2) == (L) goto :HELPEM
  45.         set mdl=__LARGE__
  46.         goto :OK
  47. :HELPEM
  48. ECHO This batch file 'makes' the windows libraries.
  49. ECHO the first parameter should be
  50. ECHO            T= TEXTONLY  --or-- G= graphics
  51. ECHO the second parameter should be the memory model
  52. ECHO            T, S, M, C, L, H
  53. ECHO ...
  54. ECHO the third thru ninth parameter(s) is the name(s) of the file to make.
  55. ECHO ...
  56. ECHO leave out the .c extension. May use wildcards.
  57. ECHO ...
  58. ECHO library not made.
  59. goto :QUIT
  60.  
  61.  
  62. :OK
  63. ECHO making windows libraries.
  64. ECHO the following warning messages are acceptable:
  65. ECHO      superfluous & on structure or array
  66. ECHO      short/long mismatch... conversion supplied
  67. ECHO ...
  68. ECHO on
  69.       erase w*.obj
  70.        echo COMPILING window routines      > errors.lst
  71.     for %%a in (%wn% %4 %5 %6 %7 %8 %9) do cl /A%2 /J /Os /c  %d% /D%mdl% %%a.c >>errors.lst
  72.        dir w*.obj | dir2bat -+@ &          > objlst.lst 
  73.     REM microsoft c librarian needs a few blank lines at end of file.
  74.     type mblank.bat     >>objlst.lst
  75.     type mblank.bat     >>objlst.lst
  76.     type mblank.bat     >>objlst.lst
  77.     echo PLACING MODULES IN LIBRARY     >>errors.lst
  78.     lib  mw%1%2.lib @objlst.lst            >>errors.lst    
  79.        echo off
  80.    
  81.     erase objlst.lst
  82.        erase %wn%.obj
  83. ECHO library updated. compiler messages in errors.lst
  84.  
  85. :QUIT
  86.  
  87. set p=
  88. set wn=
  89. set mdl=
  90.  
  91.