home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / database / cbase103 / blkio / install.bat < prev    next >
Encoding:
DOS Batch File  |  1991-09-23  |  5.1 KB  |  148 lines

  1. @echo off
  2. rem blkio installation batch file-----------------------------------------------
  3. rem install.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - blkio library installation batch file for DOS
  8. rem
  9. rem SYNOPSIS
  10. rem      install model [x]
  11. rem
  12. rem DESCRIPTION
  13. rem     install.bat performs the installation of the blkio library for
  14. rem     DOS.  model specifies the memory model as one of the following.
  15. rem
  16. rem          s        small model
  17. rem          m        medium model
  18. rem          c        compact model
  19. rem          l        large model
  20. rem          h        huge model
  21. rem
  22. rem     The library file is named Mblkio.lib, where M would correspond
  23. rem     to the memory model of the library.
  24. rem
  25. rem     If specified, the second parameter causes the reference manual to
  26. rem     be extracted from the source code.  The reference manual is placed
  27. rem     in the file blkio.man.
  28. rem
  29. rem SEE ALSO
  30. rem      makefile
  31. rem
  32. rem NOTES
  33. rem      This batch file is written for use with Borland Turbo C.  To
  34. rem      convert it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \usr\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \usr\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace tcc with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Turbo C switches used and their meanings.
  43. rem                   -c        compile but don't link
  44. rem                   -O        jump optimization
  45. rem                   -G        speed optimization
  46. rem                   -A        ANSI keywords only
  47. rem                   -C-       no nested comments
  48. rem                   -m        memory model
  49. rem           4. The command to build the library archive from the object
  50. rem              modules may vary more drastically.  Turbo C uses the tlib
  51. rem              command with what is called a response file.  This
  52. rem              response file, blkio.rsp, contains a list of all the
  53. rem              object modules in the library.
  54. rem
  55. rem ----------------------------------------------------------------------------
  56.  
  57. rem verify arguments------------------------------------------------------------
  58. if "%1" == "s" goto arg1
  59. if "%1" == "m" goto arg1
  60. if "%1" == "c" goto arg1
  61. if "%1" == "l" goto arg1
  62. if "%1" == "h" goto arg1
  63. echo usage:  install model [x]
  64. echo Valid values for model are s (small), m (medium), c (compact),
  65. echo   l (large), and h (huge).  Model must be lower case.
  66. echo If x is specified, the reference manual will be extracted.
  67. goto end
  68. :arg1
  69.  
  70. if "%2" == "" goto arg2
  71. if "%2" == "x" goto arg2
  72. echo usage:  install model [x]
  73. echo Invalid second argument.  Valid value is lowercase x.
  74. goto end
  75. :arg2
  76.  
  77. if "%3" == "" goto arg3
  78. echo usage:  install model [x]
  79. echo Too many arguments specified.
  80. goto end
  81. :arg3
  82.  
  83. rem install boolean header file-------------------------------------------------
  84. rem
  85. if not exist \usr\include\bool.h goto bool
  86. echo \usr\include\bool.h exists.  ^C to exit, any other key to continue.
  87. pause
  88. :bool
  89. echo on
  90. copy bool.h \usr\include\bool.h
  91. @echo off
  92.  
  93. rem extract the reference manual------------------------------------------------
  94. if not "%2" == "x" goto skipman
  95. echo Extracting reference manual into blkio.man.
  96. if not exist blkio.man goto man
  97. echo blkio.man exists.  ^C to exit, any other key to continue.
  98. pause
  99. :man
  100. if not exist tmp goto tmp
  101. echo tmp exists.  ^C to exit, any other key to continue.
  102. pause
  103. :tmp
  104. echo on
  105. copy blkio.h/a+bclose.c+bcloseal.c+bexit.c+bflpop.c+bflpush.c+bflush.c tmp
  106. type tmp | manx -c > blkio.man
  107. copy bgetb.c/a+bgetbf.c+bgeth.c+bgethf.c+bopen.c+bputb.c tmp
  108. type tmp | manx -c >> blkio.man
  109. copy bputbf.c/a+bputh.c+bputhf.c+bsetbuf.c+bsetvbuf.c+bsync.c+lockb.c tmp
  110. type tmp | manx -c >> blkio.man
  111. del tmp
  112. @echo off
  113. :skipman
  114.  
  115. rem compile all blkio source files----------------------------------------------
  116. echo on
  117. tcc -c -O -G -A -C- -m%1 bclose.c   bcloseal.c bexit.c    bflpop.c   bflpush.c  bflush.c
  118. tcc -c -O -G -A -C- -m%1 bgetb.c    bgetbf.c   bgeth.c    bgethf.c   bopen.c    bputb.c
  119. tcc -c -O -G -A -C- -m%1 bputbf.c   bputh.c    bputhf.c   bsetbuf.c  bsetvbuf.c bsync.c    lockb.c
  120. tcc -c -O -G -A -C- -m%1 bops.c     buops.c
  121. @echo off
  122.  
  123. rem build the blkio library archive---------------------------------------------
  124. if exist %1blkio.lib del %1blkio.lib
  125. echo on
  126. tlib %1blkio @blkio.rsp
  127. @echo off
  128.  
  129. rem install the blkio library---------------------------------------------------
  130. if not exist \usr\include\blkio.h goto h
  131. echo \usr\include\blkio.h exists.  ^C to exit, any other key to continue.
  132. pause
  133. :h
  134. echo on
  135. copy blkio.h \usr\include\blkio.h
  136. @echo off
  137.  
  138. if not exist \usr\lib\%1blkio.lib goto lib
  139. echo \usr\lib\%1blkio.lib exists.  ^C to exit, any other key to continue.
  140. pause
  141. :lib
  142. echo on
  143. copy %1blkio.lib \usr\lib\%1blkio.lib
  144. @echo off
  145.  
  146. rem end of blkio installation batch file----------------------------------------
  147. :end
  148.