home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / odbcsdk / samples / crsrdemo / build.bat next >
Encoding:
DOS Batch File  |  1994-12-07  |  2.0 KB  |  111 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] [thread | nothread]"
  9. rem
  10. rem =======================================================================
  11. rem
  12.  
  13.  
  14. rem --- Check for environment space ---
  15. set typ=d16
  16. set ok=N
  17.  
  18. if NOT "%ok%" == "N" goto err_env
  19.  
  20. set THREAD=NO
  21. if "%2" == "thread" set THREAD=YES
  22.  
  23. rem --- Parse arguments ---
  24. :parse
  25. if "%1" == "" goto check
  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. goto doit
  72.  
  73.  
  74. rem --- Make the demo ---
  75. :doit
  76. if "%typ%" == "n16" nmake
  77. if "%typ%" == "d16" nmake DEBUG=YES
  78. if "%typ%" == "n32" nmake WIN32=YES
  79. if "%typ%" == "d32" nmake WIN32=YES DEBUG=YES
  80. goto end
  81.  
  82.  
  83. rem --- Out of environment space ---
  84. :err_env
  85. echo.
  86. echo Error: out of environment space
  87. echo.
  88. goto end
  89.  
  90.  
  91. rem --- Invalid operating system environment ---
  92. :err_ops
  93. echo.
  94. echo Error: Windows/NT required to build debug32 or ndebug32
  95. echo.
  96. goto end
  97.  
  98.  
  99. rem --- Usage message ---
  100. :err_usage
  101. echo.
  102. echo "Usage: BUILD [debug16 | ndebug16 | debug32 | ndebug32] [thread | nothread]"
  103. echo.
  104. goto end
  105.  
  106.  
  107. rem --- Clear environment variables ---
  108. :end
  109. set typ=
  110. set ok=
  111.