home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l351 / 1.ddi / MSVC / LIB / MKLIB.BAT < prev    next >
Encoding:
DOS Batch File  |  1993-01-25  |  2.5 KB  |  107 lines

  1. @echo off
  2. rem $Id: mklib.bat 1.2 93/01/25 17:41:47 rob Exp $
  3. set M=%2
  4. set PLLPTH=%3
  5. if "%1" == "s" goto valid_model
  6. if "%1" == "m" goto valid_model
  7. if "%1" == "l" goto valid_model
  8. if "%1" == "c" goto valid_model
  9. goto usage
  10. :valid_model
  11. if "%2" == "e" goto valid_fp
  12. if "%2" == "7" goto valid_fp
  13. if "%2" == "a" goto valid_fp
  14. goto usage
  15. :valid_fp
  16. if "%PLLPTH%" == "" goto no_path
  17. goto path_supplied
  18. :no_path
  19. set PLLPTH=.
  20. :path_supplied
  21. set S=%PLLPTH%\%1libc%M%.lib
  22. if exist %S% goto lib_exists
  23. set S=%PLLPTH%\%1libc%M%r.lib
  24. if exist %S% goto lib_exists
  25. goto error1
  26. :lib_exists
  27. rem provide llibpe.lib for backward compat.
  28. if not exist %1libp%M%.lib goto lib1_gone
  29. del %1libp%M%.lib
  30. :lib1_gone
  31. lib /nologo /noe %1libp%M%;
  32. if errorlevel 1 goto error4
  33. if not exist %1libp%M%.lib goto error4
  34. set T=%1libc%M%p
  35. if not exist %T%.lib goto targ_no_exist
  36. echo * Warning: File "%T%.lib" already exists and will be overwritten.
  37. echo *          Press Ctrl-C to Abort ...
  38. pause
  39. :targ_no_exist
  40. copy %S% %T%.lib
  41. rem
  42. rem Extract OBJs from PL libraries
  43. rem
  44. @echo on
  45. lib msc8%1.lib @extmods.lbc;
  46. @echo off
  47. if errorlevel 1 goto error2
  48. rem
  49. rem Update new library
  50. rem
  51. @echo on
  52. lib %T% @fp%2.lbc @insmods.lbc;
  53. @echo off
  54. if errorlevel 1 goto error3
  55. rem
  56. rem Delete intermediate object files
  57. rem
  58. call remobjs.bat
  59. del %T%.bak
  60. echo *
  61. echo *    Library "%T%.lib" created successfully.
  62. echo *
  63. goto end
  64. :usage
  65. echo Usage: MKLIB [smlc] [7ea] [dir path]
  66. echo The first two parameters are letters that determine which library
  67. echo to extract files from:
  68. echo      s : Small Model 
  69. echo      m : Medium Model 
  70. echo      l : Large Model 
  71. echo      c : Compact Model 
  72. echo      e : Emulation Libraries
  73. echo      7 : 80x87 Libraries 
  74. echo      a : Alternate Math Libraries
  75. echo The third parameter is the path to the DIRECTORY (e.g. c:\msvc\lib )
  76. echo that contains the Microsoft Visual C++ library
  77. echo files. The new library will be created in the current directory.
  78. echo Sample Usage:
  79. echo MKLIB s e c:\msvc\lib      (creates libraries sLIBPe.LIB, sLIBCeP.LIB)
  80. goto end
  81. :error1
  82. echo *
  83. echo *  ERROR: Library "%S%" Not Found.
  84. echo *
  85. goto end
  86. :error2
  87. echo *
  88. echo *    ERROR: Could Not Extract Modules from library "msc8%1.lib".
  89. echo *
  90. goto end
  91. :error3
  92. echo *
  93. echo *    ERROR: Could Not Create New Library "%T%.lib".
  94. echo *
  95. goto end
  96. :error4
  97. echo *
  98. echo *    ERROR: Could Not Invoke Librarian "lib.exe"
  99. echo *
  100. goto end
  101. :end
  102. set PLLPTH=
  103. set M=
  104. set S=
  105. set T=
  106. rem Microsoft (R) is a registered trademark of Microsoft Corporation.
  107.