home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / MAKELIB.BAT < prev   
Encoding:
DOS Batch File  |  1991-01-25  |  2.7 KB  |  114 lines

  1. : *****************************************************************
  2. : MAKELIB.BAT
  3. : *****************************************************************
  4. :
  5. : A batch file used to create or update a library
  6. :
  7. : Copyright(c) 1988-1990 -- James Occhiogrosso
  8. :
  9. : Syntax:
  10. : -------
  11. : MAKELIB Makefile
  12. :
  13. : "Makefile" is the name of an RMAKE utility description file for
  14. : the library you want to create or update. It must have the same
  15. : name as the library and an extension of RMK.  Enter it without
  16. : any extension.
  17. :
  18. : Notes:
  19. : ------
  20. : MAKELIB assumes the target library is in the default directory
  21. : \CLIPPER5\LIB. To change the default, change all references to
  22. : \CLIPPER5\LIB in the code below to the desired directory.
  23. :
  24. : If you are using a DOS version prior to 3.30, remove the "@"
  25. : symbol in the ECHO line below.
  26.  
  27. @ECHO OFF
  28.  
  29. IF %1!==! GOTO SYNTAX
  30. IF NOT EXIST %1.RMK GOTO MAKFILE
  31.  
  32. : Delete old library response file if present
  33.  
  34. IF EXIST LIB_RESP.TXT DEL LIB_RESP.TXT
  35.  
  36. : Check for existence of library file
  37.  
  38. IF EXIST \CLIPPER5\LIB\%1.LIB GOTO MAKEIT
  39. ECHO 
  40. ECHO Library file \CLIPPER5\LIB\%1.LIB does not exist.
  41. ECHO Press Ctrl-C to abort, or any key to create the library.
  42. ECHO .
  43. PAUSE > NUL
  44. DEL *.OBJ
  45.  
  46. :MAKEIT
  47.  
  48. : Compile all changed PRG and ASM files
  49.  
  50. ECHO .
  51. ECHO . CREATING \CLIPPER5\LIB\%1.LIB
  52. ECHO .
  53. RMAKE %1.RMK
  54. ECHO .
  55.  
  56. : Abort on any error or if a file list was not created
  57.  
  58. IF ERRORLEVEL=1 GOTO ERROR
  59. IF NOT EXIST LIB_LIST.TXT GOTO CURRENT
  60.  
  61. : Otherwise, create response file
  62.  
  63. ECHO \CLIPPER5\LIB\%1.LIB > LIB_RESP.TXT
  64. IF NOT EXIST \CLIPPER5\LIB\%1.LIB ECHO Y >> LIB_RESP.TXT
  65. TYPE LIB_LIST.TXT >> LIB_RESP.TXT
  66. ECHO ;: >> LIB_RESP.TXT
  67.  
  68. : And generate library
  69.  
  70. LIB @LIB_RESP.TXT
  71. DIR \CLIPPER5\LIB\%1.LIB
  72. :
  73. : If you have a RAMDISK you may want to copy the library to it
  74. : to speed the linking process. The COPY below assumes drive
  75. : E: is used as a ramdisk. Remove or change it if your ramdisk
  76. : is different or you are not using one.
  77.  
  78. COPY \CLIPPER5\LIB\%1.LIB E: > NUL
  79.  
  80. : Delete all temporary files and exit
  81. :
  82. IF EXIST LIB_LIST.TXT DEL LIB_LIST.TXT
  83. IF EXIST LIB_RESP.TXT DEL LIB_RESP.TXT
  84. IF EXIST \CLIPPER5\LIB\%1.BAK DEL \CLIPPER5\LIB\%1.BAK
  85. GOTO END
  86.  
  87.  
  88. : --------------------------------------------------------------
  89. : MAKELIB --- Error messages
  90. : --------------------------------------------------------------
  91. :
  92. :ERROR
  93. ECHO  Aborted! Error with above file
  94. GOTO END
  95.  
  96. :SYNTAX
  97. ECHO  Aborted!   Correct SYNTAX is ..... MAKELIB libname
  98. ECHO             Do not enter extension. Default is .LIB
  99. GOTO END
  100.  
  101. :CURRENT
  102. ECHO  Aborted!  Library is current.
  103. GOTO END
  104.  
  105. :MAKFILE
  106. ECHO  Aborted!  %1.RMK file missing.
  107. GOTO END
  108.  
  109. :END
  110. : Sound bell and quit
  111. ECHO 
  112. ECHO .
  113.  
  114.