home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CBASE101.ZIP / CBATS101.ZIP / CBINST.BAT < prev    next >
DOS Batch File  |  1990-06-21  |  6KB  |  155 lines

  1. @echo off
  2. rem cbase installation batch file-----------------------------------------------
  3. rem cbinst.bat    1.4 - 90/06/21
  4.  
  5. rem ----------------------------------------------------------------------------
  6. rem NAME
  7. rem      install.bat - cbase 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 cbase 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 cbasem.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 Microsoft C.  To convert
  34. rem      it for use with another compiler, make the following
  35. rem      modifications:
  36. rem           1. Replace \c\include with the include directory used by
  37. rem              the new compiler.
  38. rem           2. Replace \c\lib with the library directory used by the
  39. rem              new compiler.
  40. rem           3. Replace cl with the command to invoke the compiler being
  41. rem              used, replacing the switches also, if necessary.  Below
  42. rem              are listed the Microsoft C switches used and their
  43. rem              meanings.
  44. rem                   -Oalt     optimization
  45. rem                   -Gs       speed optimization
  46. rem                   -c        compile but don't link
  47. rem                   -Za       ANSI keywords only
  48. rem                   -A        memory model
  49. rem           4. The command to build the library archive from the object
  50. rem              modules may vary more drastically.  Microsoft C uses the
  51. rem              lib 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 upper 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 \c\include\lseq.h goto lseq
  83. echo The lseq library must be installed first.
  84. goto end
  85. :lseq
  86. if exist \c\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+cbopen.c+cbputr.c+cbrcurso.c+cbrecali.c+cbreccnt.c tmp
  111. type tmp | manx -c >> cbase.man
  112. copy cbrecfir.c/a+cbreclas.c+cbrecnex.c+cbrecpre.c+cbrecsiz.c+cbsetkcu.c tmp
  113. type tmp | manx -c >> cbase.man
  114. copy cbsetrcu.c/a+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. cl -c -Oalt -Gs -Za -A%1 cbclose.c  cbcreate.c cbdelcur.c cbexport.c cbgetkcu.c cbgetlck.c
  123. cl -c -Oalt -Gs -Za -A%1 cbgetr.c   cbgetrcu.c cbgetrf.c  cbimport.c cbinsert.c cbkeyali.c
  124. cl -c -Oalt -Gs -Za -A%1 cbkeyfir.c cbkeylas.c cbkeynex.c cbkeypre.c cbkeysrc.c cblock.c
  125. cl -c -Oalt -Gs -Za -A%1 cbopen.c   cbputr.c   cbrecali.c cbrecfir.c cbreclas.c cbrecnex.c
  126. cl -c -Oalt -Gs -Za -A%1 cbrecpre.c cbsetkcu.c cbsetrcu.c cbsync.c
  127. cl -c -Oalt -Gs -Za -A%1 cbcmp.c    cbexp.c    cbimp.c    cbops.c
  128. @echo off
  129.  
  130. rem build the cbase library archive---------------------------------------------
  131. if exist cbase%1.lib del cbase%1.lib
  132. echo on
  133. lib cbase%1 @cbase.rsp
  134. @echo off
  135.  
  136. rem install the cbase library---------------------------------------------------
  137. if not exist \c\include\cbase.h goto h
  138. echo \c\include\cbase.h exists.  ^C to exit, any other key to continue.
  139. pause
  140. :h
  141. echo on
  142. copy cbase.h \c\include\cbase.h
  143. @echo off
  144.  
  145. if not exist \c\lib\cbase%1.lib goto lib
  146. echo \c\lib\cbase%1.lib exists.  ^C to exit, any other key to continue.
  147. pause
  148. :lib
  149. echo on
  150. copy cbase%1.lib \c\lib\cbase%1.lib
  151. @echo off
  152.  
  153. rem end of cbase installation batch file----------------------------------------
  154. :end
  155.