home *** CD-ROM | disk | FTP | other *** search
- : BUILDLIB.BAT (C)Copyright Blaise Computing Inc. 1987, 1989
- :
- : This batch file can be used to reconstruct the Turbo C TOOLS
- : libraries. It assumes that all source files are in the
- : current directory, that the necessary MAC files are in the
- : subdirectory MAC, and the Turbo C assembly language helper file,
- : rules.asi, is in the current directory. Moreover, it is assumed
- : that the include files reside in a directory \turboc\include.
- : If this is not your configuration you should alter the batch
- : file accordingly.
- :
- : Furthermore, the Turbo C compiler (TCC), the Turbo Assembler (TASM),
- : and the Turbo Librarian (TLIB) must be in directories accessible
- : via the PATH environment variable.
- :
- : BUILDLIB is invoked with the command
- :
- : buildlib model
- :
- : where model is either s, m, c, l, or h (in lower case). The
- : corresponding small, medium, compact, large, or huge memory model
- : library is constructed.
- :
- set saveprompt=%prompt%
- prompt .$h
-
- if exist rules.asi goto check1
- pause The Turbo C file rules.asi must be in the current directory.
- goto end
-
- :check1
- if exist mac\beginasm.mac goto check2
- pause The file beginasm.mac must be present in the subdirectory MAC.
- goto end
-
- :check2
- if a%1==a goto fail3
-
- if %1==s goto check4
- if %1==m goto check4
- if %1==c goto check4
- if %1==l goto check4
- if %1==h goto check4
- :fail3
- pause Either s(mall), m(edium), c(ompact), l(arge), or h(uge) must be specified.
- goto end
-
- :check4
- if exist mac\comp_t2%1.mac goto check5
- pause The file comp_t2%1.mac must be present in the subdirectory MAC.
- goto end
-
- :check5
- copy mac\beginasm.mac
- copy mac\comp_t2%1.mac compiler.mac
- erase *.obj
- if exist tct.lib erase tct.lib
-
- tcc -c -w -O -m%1 -I\turboc\include ed*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include fl*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include hl*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include is*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ is*.asm
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include iv*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ ivctrl
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include kb*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ kb*.asm
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include mm*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include mn*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include mo*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ mocatch
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include pr*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include sc*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include st*.c
- if errorlevel 1 goto comperror
-
- tcc -c -w -O -m%1 -I\turboc\include ut*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ ut*.asm
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include vi*.c
- if errorlevel 1 goto comperror
- tasm /mx /w+ vidirec0
- if errorlevel 1 goto asmerror
-
- tcc -c -w -O -m%1 -I\turboc\include wn*.c
- if errorlevel 1 goto comperror
-
- echo Compilation complete
-
- tlib tct.lib /0 @libresp
- if errorlevel 1 goto liberror
- if not exist tct.lib goto liberror
- if exist tct_t2%1.lib erase tct_t2%1.lib
- rename tct.lib tct_t2%1.lib
- pause Library has been constructed
- goto end
-
- :comperror
- pause Error in compilation
- goto end
-
- :asmerror
- pause Error during assembly
- goto end
-
- :liberror
- pause Error in library construction
-
- :end
- set prompt=%saveprompt%