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

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