home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / odbcsdk / samples / cppdemo / build.bat < prev    next >
Encoding:
DOS Batch File  |  1994-12-07  |  2.5 KB  |  134 lines

  1. @echo off
  2. rem =======================================================================
  3. rem
  4. rem     BUILD.BAT
  5. rem
  6. rem     Builds demo application
  7. rem
  8. rem     "Syntax: build [debug16 | ndebug16 | debug32 | ndebug32] [borland]"
  9. rem
  10. rem =======================================================================
  11. rem
  12.  
  13.  
  14. rem --- Check for environment space ---
  15. set bcc=N
  16. set typ=d16
  17. set ok=N
  18.  
  19. if NOT "%ok%" == "N" goto err_env
  20.  
  21.  
  22. rem --- Parse arguments ---
  23. :parse
  24. if "%1" == "" goto check
  25. if "%1" == "borland" set bcc=Y
  26. if "%1" == "debug16" goto debug16
  27. if "%1" == "debug32" goto debug32
  28. if "%1" == "ndebug16" goto ndebug16
  29. if "%1" == "ndebug32" goto ndebug32
  30. shift
  31. goto parse
  32.  
  33. rem --- Handle "debug16" ---
  34. :debug16
  35. if "%ok%" == "Y" goto err_usage
  36. set ok=Y
  37. set typ=d16
  38. shift
  39. goto parse
  40.  
  41. rem --- Handle "debug32" ---
  42. :debug32
  43. if "%ok%" == "Y" goto err_usage
  44. if not '%OS%' == 'Windows_NT' goto err_ops
  45. set ok=Y
  46. set typ=d32
  47. shift
  48. goto parse
  49.  
  50. rem --- Handle "ndebug16" ---
  51. :ndebug16
  52. if "%ok%" == "Y" goto err_usage
  53. set ok=Y
  54. set typ=n16
  55. shift
  56. goto parse
  57.  
  58. rem --- Handle "ndebug32" ---
  59. :ndebug32
  60. if "%ok%" == "Y" goto err_usage
  61. if not '%OS%' == 'Windows_NT' goto err_ops
  62. set ok=Y
  63. set typ=n32
  64. shift
  65. goto parse
  66.  
  67.  
  68. rem --- Verify correctness of everything ---
  69. :check
  70. if NOT "%ok%" == "Y" goto err_usage
  71. if NOT "%bcc%" == "Y" goto doit
  72. if "%typ%" == "d32" goto err_borland
  73. if "%typ%" == "n32" goto err_borland
  74. goto borland
  75.  
  76.  
  77. rem --- Make the demo ---
  78. :doit
  79. if "%typ%" == "n16" nmake
  80. if "%typ%" == "d16" nmake DEBUG=YES
  81. if "%typ%" == "n32" nmake WIN32=YES
  82. if "%typ%" == "d32" nmake WIN32=YES DEBUG=YES
  83. goto end
  84.  
  85.  
  86. rem --- Borland make ---
  87. :borland
  88. if "%typ%" == "n16" make -f bccmake
  89. if "%typ%" == "d16" make -f bccmake DEBUG=YES
  90. goto end
  91.  
  92.  
  93. rem --- Out of environment space ---
  94. :err_env
  95. echo.
  96. echo Error: out of environment space
  97. echo.
  98. goto end
  99.  
  100.  
  101. rem --- Invalid operating system environment ---
  102. :err_ops
  103. echo.
  104. echo Error: Windows/NT required to build debug32 or ndebug32
  105. echo.
  106. goto end
  107.  
  108.  
  109. rem --- Usage message ---
  110. :err_usage
  111. echo.
  112. echo "Usage: BUILD [debug16 | ndebug16 | debug32 | ndebug32] [borland]"
  113. echo.
  114. echo     Note that the 'borland' option can not be used with either
  115. echo     the 'debug32' or the 'ndebug32' option.
  116. echo.
  117. goto end
  118.  
  119.  
  120. rem --- Borland-specific error ---
  121. :err_borland
  122. echo.
  123. echo Error: the 'borland' option cannot be used with either the
  124. echo        'debug32' or the 'ndebug32' option.
  125. echo.
  126. goto end
  127.  
  128.  
  129. rem --- Clear environment variables ---
  130. :end
  131. set bcc=
  132. set typ=
  133. set ok=
  134.