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

  1. @echo off
  2. rem cbase installation batch file-----------------------------------------------
  3. rem install.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 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, 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. :arg2
  75.  
  76. if "%3" == "" goto arg3
  77. echo usage:  install model [x]
  78. echo Too many arguments specified.
  79. :arg3
  80.  
  81. rem check if underlying libraries installed-------------------------------------
  82. if exist \usr\include\lseq.h goto lseq
  83. echo The lseq library must be installed first.
  84. goto end
  85. :lseq
  86. if exist \usr\include\btree.h goto btree
  87. echo The btree library must be installed first.
  88. goto end
  89. :btree
  90.  
  91. rem extract the reference manual------------------------------------------------
  92. if not "%2" == "x" goto skipman
  93. echo Extracting reference manual into cbase.man.
  94. if not exist cbase.man goto man
  95. echo cbase.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. type cbase.h | manx -c > cbase.man
  104. copy cbclose.c/a+cbcreate.c+cbdelcur.c+cbexport.c+cbgetkcu.c+cbgetlck.c tmp
  105. type tmp | manx -c >> cbase.man
  106. copy cbgetr.c/a+cbgetrcu.c+cbgetrf.c+cbimport.c+cbinsert.c+cbkcurso.c tmp
  107. type tmp | manx -c >> cbase.man
  108. copy cbkeyali.c/a+cbkeyfir.c+cbkeylas.c+cbkeynex.c+cbkeypre.c+cbkeysrc.c tmp
  109. type tmp | manx -c >> cbase.man
  110. copy cblock.c/a+cbmkndx.c+cbopen.c+cbputr.c+cbrcurso.c+cbrecali.c tmp
  111. type tmp | manx -c >> cbase.man
  112. copy cbreccnt.c/a+cbrecfir.c+cbreclas.c+cbrecnex.c+cbrecpre.c+cbrecsiz.c tmp
  113. type tmp | manx -c >> cbase.man
  114. copy cbrmndx.c/a+cbsetkcu.c+cbsetrcu.c+cbsync.c tmp
  115. type tmp | manx -c >> cbase.man
  116. del tmp
  117. @echo off
  118. :skipman
  119.  
  120. rem compile all cbase source files----------------------------------------------
  121. echo on
  122. tcc -c -O -G -A -C- -m%1 cbclose.c  cbcreate.c cbdelcur.c cbexport.c cbgetkcu.c cbgetlck.c
  123. tcc -c -O -G -A -C- -m%1 cbgetr.c   cbgetrcu.c cbgetrf.c  cbimport.c cbinsert.c cbkeyali.c
  124. tcc -c -O -G -A -C- -m%1 cbkeyfir.c cbkeylas.c cbkeynex.c cbkeypre.c cbkeysrc.c cblock.c
  125. tcc -c -O -G -A -C- -m%1 cbmkndx.c  cbopen.c   cbputr.c   cbrecali.c cbrecfir.c cbreclas.c
  126. tcc -c -O -G -A -C- -m%1 cbrecnex.c cbrecpre.c cbrmndx.c  cbsetkcu.c cbsetrcu.c cbsync.c
  127. tcc -c -O -G -A -C- -m%1 cbcmp.c    cbexp.c    cbimp.c    cbops.c
  128. @echo off
  129.  
  130. rem build the cbase library archive---------------------------------------------
  131. if exist %1cbase.lib del %1cbase.lib
  132. echo on
  133. tlib %1cbase @cbase.rsp
  134. @echo off
  135.  
  136. rem install the cbase library---------------------------------------------------
  137. if not exist \usr\include\cbase.h goto h
  138. echo \usr\include\cbase.h exists.  ^C to exit, any other key to continue.
  139. pause
  140. :h
  141. echo on
  142. copy cbase.h \usr\include\cbase.h
  143. @echo off
  144.  
  145. if not exist \usr\lib\%1cbase.lib goto lib
  146. echo \usr\lib\%1cbase.lib exists.  ^C to exit, any other key to continue.
  147. pause
  148. :lib
  149. echo on
  150. copy %1cbase.lib \usr\lib\%1cbase.lib
  151. @echo off
  152.  
  153. rem end of cbase installation batch file----------------------------------------
  154. :end
  155.