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

  1. @echo off
  2. rem cbase installation batch file-----------------------------------------------
  3. rem cbinst.bat    1.5 - 91/09/23
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - cbase 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 cbase 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 Mcbase.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 cbase.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 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 bcc with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Borland 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.  Borland C++ uses the tlib
  51. rem              command with what is called a response file.  This
  52. rem              response file, cbase.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 check if underlying libraries installed-------------------------------------
  84. if exist \usr\include\lseq.h goto lseq
  85. echo The lseq library must be installed first.
  86. goto end
  87. :lseq
  88. if exist \usr\include\btree.h goto btree
  89. echo The btree library must be installed first.
  90. goto end
  91. :btree
  92.  
  93. rem extract the reference manual------------------------------------------------
  94. if not "%2" == "x" goto skipman
  95. echo Extracting reference manual into cbase.man.
  96. if not exist cbase.man goto man
  97. echo cbase.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. type cbase.h | manx -c > cbase.man
  106. copy cbclose.c/a+cbcreate.c+cbdelcur.c+cbexport.c+cbgetkcu.c+cbgetlck.c tmp
  107. type tmp | manx -c >> cbase.man
  108. copy cbgetr.c/a+cbgetrcu.c+cbgetrf.c+cbimport.c+cbinsert.c+cbkcurso.c tmp
  109. type tmp | manx -c >> cbase.man
  110. copy cbkeyali.c/a+cbkeyfir.c+cbkeylas.c+cbkeynex.c+cbkeypre.c+cbkeysrc.c tmp
  111. type tmp | manx -c >> cbase.man
  112. copy cblock.c/a+cbmkndx.c+cbopen.c+cbputr.c+cbrcurso.c+cbrecali.c tmp
  113. type tmp | manx -c >> cbase.man
  114. copy cbreccnt.c/a+cbrecfir.c+cbreclas.c+cbrecnex.c+cbrecpre.c+cbrecsiz.c tmp
  115. type tmp | manx -c >> cbase.man
  116. copy cbrmndx.c/a+cbsetkcu.c+cbsetrcu.c+cbsync.c tmp
  117. type tmp | manx -c >> cbase.man
  118. del tmp
  119. @echo off
  120. :skipman
  121.  
  122. rem compile all cbase source files----------------------------------------------
  123. echo on
  124. bcc -c -O -G -A -C- -m%1 cbclose.c  cbcreate.c cbdelcur.c cbexport.c cbgetkcu.c cbgetlck.c
  125. bcc -c -O -G -A -C- -m%1 cbgetr.c   cbgetrcu.c cbgetrf.c  cbimport.c cbinsert.c cbkeyali.c
  126. bcc -c -O -G -A -C- -m%1 cbkeyfir.c cbkeylas.c cbkeynex.c cbkeypre.c cbkeysrc.c cblock.c
  127. bcc -c -O -G -A -C- -m%1 cbmkndx.c  cbopen.c   cbputr.c   cbrecali.c cbrecfir.c cbreclas.c
  128. bcc -c -O -G -A -C- -m%1 cbrecnex.c cbrecpre.c cbrmndx.c  cbsetkcu.c cbsetrcu.c cbsync.c
  129. bcc -c -O -G -A -C- -m%1 cbcmp.c    cbexp.c    cbimp.c    cbops.c
  130. @echo off
  131.  
  132. rem build the cbase library archive---------------------------------------------
  133. if exist %1cbase.lib del %1cbase.lib
  134. echo on
  135. tlib %1cbase @cbase.rsp
  136. @echo off
  137.  
  138. rem install the cbase library---------------------------------------------------
  139. if not exist \usr\include\cbase.h goto h
  140. echo \usr\include\cbase.h exists.  ^C to exit, any other key to continue.
  141. pause
  142. :h
  143. echo on
  144. copy cbase.h \usr\include\cbase.h
  145. @echo off
  146.  
  147. if not exist \usr\lib\%1cbase.lib goto lib
  148. echo \usr\lib\%1cbase.lib exists.  ^C to exit, any other key to continue.
  149. pause
  150. :lib
  151. echo on
  152. copy %1cbase.lib \usr\lib\%1cbase.lib
  153. @echo off
  154.  
  155. rem end of cbase installation batch file----------------------------------------
  156. :end
  157.