home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CBASE101.ZIP / BLKIO112.ZIP / INSTALL.BAT < prev    next >
DOS Batch File  |  1990-06-20  |  5KB  |  146 lines

  1. @echo off
  2. rem blkio installation batch file-----------------------------------------------
  3. rem install.bat    1.4 - 90/06/20
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - blkio library installation batch file for MS-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     MS-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 blkiom.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 \tc\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \tc\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                   -O        jump optimization
  44. rem                   -G        speed optimization
  45. rem                   -c        compile but don't link
  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. :arg2
  75.  
  76. if "%3" == "" goto arg3
  77. echo Usage:  install model [x]
  78. echo Too many arguments specified.
  79. :arg3
  80.  
  81. rem install boolean header file-------------------------------------------------
  82. rem
  83. if not exist \tc\include\bool.h goto bool
  84. echo \tc\include\bool.h exists.  ^C to exit, any other key to continue.
  85. pause
  86. :bool
  87. echo on
  88. copy bool.h \tc\include\bool.h
  89. @echo off
  90.  
  91. rem extract the reference manual------------------------------------------------
  92. if not "%2" == "x" goto skipman
  93. echo Extracting reference manual into blkio.man.
  94. if not exist blkio.man goto man
  95. echo blkio.man exists.  ^C to exit, any other key to continue.
  96. pause
  97. :man
  98. if not exist tmp goto tmp
  99. echo tmp exists.  ^C to exit, any other key to continue.
  100. pause
  101. :tmp
  102. echo on
  103. copy blkio.h/a+bclose.c+bexit.c+bflpop.c+bflpush.c+bflush.c+bgetb.c tmp
  104. type tmp | manx -c > blkio.man
  105. copy bgetbf.c/a+bgeth.c+bgethf.c+bopen.c+bputb.c+bputbf.c tmp
  106. type tmp | manx -c >> blkio.man
  107. copy bputh.c/a+bputhf.c+bsetbuf.c+bsetvbuf.c+bsync.c+lockb.c tmp
  108. type tmp | manx -c >> blkio.man
  109. del tmp
  110. @echo off
  111. :skipman
  112.  
  113. rem compile all blkio source files----------------------------------------------
  114. echo on
  115. tcc -c -O -G -A -C- -m%1 bclose.c   bexit.c    bflpop.c   bflpush.c  bflush.c   bgetb.c
  116. tcc -c -O -G -A -C- -m%1 bgetbf.c   bgeth.c    bgethf.c   bopen.c    bputb.c    bputbf.c
  117. tcc -c -O -G -A -C- -m%1 bputh.c    bputhf.c   bsetbuf.c  bsetvbuf.c bsync.c    lockb.c
  118. tcc -c -O -G -A -C- -m%1 bops.c     buops.c
  119. @echo off
  120.  
  121. rem build the blkio library archive---------------------------------------------
  122. if exist blkio%1.lib del blkio%1.lib
  123. echo on
  124. tlib blkio%1 @blkio.rsp
  125. @echo off
  126.  
  127. rem install the blkio library---------------------------------------------------
  128. if not exist \tc\include\blkio.h goto h
  129. echo \tc\include\blkio.h exists.  ^C to exit, any other key to continue.
  130. pause
  131. :h
  132. echo on
  133. copy blkio.h \tc\include\blkio.h
  134. @echo off
  135.  
  136. if not exist \tc\lib\blkio%1.lib goto lib
  137. echo \tc\lib\blkio%1.lib exists.  ^C to exit, any other key to continue.
  138. pause
  139. :lib
  140. echo on
  141. copy blkio%1.lib \tc\lib\blkio%1.lib
  142. @echo off
  143.  
  144. rem end of blkio installation batch file----------------------------------------
  145. :end
  146.