home *** CD-ROM | disk | FTP | other *** search
- : *****************************************************************
- : MAKELIB.BAT
- : *****************************************************************
- :
- : A batch file used to create or update a library
- :
- : Copyright(c) 1988-1990 -- James Occhiogrosso
- :
- : Syntax:
- : -------
- : MAKELIB Makefile
- :
- : "Makefile" is the name of an RMAKE utility description file for
- : the library you want to create or update. It must have the same
- : name as the library and an extension of RMK. Enter it without
- : any extension.
- :
- : Notes:
- : ------
- : MAKELIB assumes the target library is in the default directory
- : \CLIPPER5\LIB. To change the default, change all references to
- : \CLIPPER5\LIB in the code below to the desired directory.
- :
- : If you are using a DOS version prior to 3.30, remove the "@"
- : symbol in the ECHO line below.
-
- @ECHO OFF
-
- IF %1!==! GOTO SYNTAX
- IF NOT EXIST %1.RMK GOTO MAKFILE
-
- : Delete old library response file if present
-
- IF EXIST LIB_RESP.TXT DEL LIB_RESP.TXT
-
- : Check for existence of library file
-
- IF EXIST \CLIPPER5\LIB\%1.LIB GOTO MAKEIT
- ECHO
- ECHO Library file \CLIPPER5\LIB\%1.LIB does not exist.
- ECHO Press Ctrl-C to abort, or any key to create the library.
- ECHO .
- PAUSE > NUL
- DEL *.OBJ
-
- :MAKEIT
-
- : Compile all changed PRG and ASM files
-
- ECHO .
- ECHO . CREATING \CLIPPER5\LIB\%1.LIB
- ECHO .
- RMAKE %1.RMK
- ECHO .
-
- : Abort on any error or if a file list was not created
-
- IF ERRORLEVEL=1 GOTO ERROR
- IF NOT EXIST LIB_LIST.TXT GOTO CURRENT
-
- : Otherwise, create response file
-
- ECHO \CLIPPER5\LIB\%1.LIB > LIB_RESP.TXT
- IF NOT EXIST \CLIPPER5\LIB\%1.LIB ECHO Y >> LIB_RESP.TXT
- TYPE LIB_LIST.TXT >> LIB_RESP.TXT
- ECHO ;: >> LIB_RESP.TXT
-
- : And generate library
-
- LIB @LIB_RESP.TXT
- DIR \CLIPPER5\LIB\%1.LIB
- :
- : If you have a RAMDISK you may want to copy the library to it
- : to speed the linking process. The COPY below assumes drive
- : E: is used as a ramdisk. Remove or change it if your ramdisk
- : is different or you are not using one.
-
- COPY \CLIPPER5\LIB\%1.LIB E: > NUL
-
- : Delete all temporary files and exit
- :
- IF EXIST LIB_LIST.TXT DEL LIB_LIST.TXT
- IF EXIST LIB_RESP.TXT DEL LIB_RESP.TXT
- IF EXIST \CLIPPER5\LIB\%1.BAK DEL \CLIPPER5\LIB\%1.BAK
- GOTO END
-
-
- : --------------------------------------------------------------
- : MAKELIB --- Error messages
- : --------------------------------------------------------------
- :
- :ERROR
- ECHO Aborted! Error with above file
- GOTO END
-
- :SYNTAX
- ECHO Aborted! Correct SYNTAX is ..... MAKELIB libname
- ECHO Do not enter extension. Default is .LIB
- GOTO END
-
- :CURRENT
- ECHO Aborted! Library is current.
- GOTO END
-
- :MAKFILE
- ECHO Aborted! %1.RMK file missing.
- GOTO END
-
- :END
- : Sound bell and quit
- ECHO
- ECHO .
-
-