runprebuild.bat 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. rem Prebuild.exe /target VS2010
  2. @ECHO OFF
  3. echo ==========================================
  4. echo ==== WhiteCore Prebuild Configuration ====
  5. echo ==========================================
  6. echo.
  7. echo If you wish to customize the configuration, re-run with the switch '-p'
  8. echo e.g. runprebuild -p
  9. echo.
  10. rem ## Default "configuration" choice ((r)elease, (d)ebug)
  11. set configuration=d
  12. rem ## Default Visual Studio edition
  13. set vstudio=2010
  14. rem ## Default Framework
  15. set framework=4_0
  16. rem ## Default architecture (86 (for 32bit), 64)
  17. :CheckArch
  18. set bits=AnyCPU
  19. rem if exist "%PROGRAMFILES(X86)%" (set bits=x64)
  20. rem if %bits% == x64 (
  21. rem echo Found 64bit architecture
  22. rem )
  23. rem if %bits% == x86 (
  24. rem echo Found 32 bit architecture
  25. rem )
  26. rem ## Determine native framework
  27. :CheckOS
  28. set framework=4_5
  29. for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
  30. if %version% == 10.0 (
  31. set framework=4_5
  32. echo Windows 10
  33. )
  34. if %version% == 6.3 (
  35. set framework=4_5
  36. echo Windows 8.1 or Server 2012 R2
  37. )
  38. if %version% == 6.2 (
  39. set framework=4_5
  40. echo Windows 8 or Server 2012
  41. )
  42. if %version% == 6.1 (
  43. set framework=4_0
  44. echo Windows 7 or Server 2008 R2
  45. )
  46. if %version% == 6.0 (
  47. set framework=3_5
  48. echo hmmm... Windows Vista or Server 2008
  49. )
  50. if %version% == 5.2 (
  51. set framework=3_5
  52. echo hmmm... Windows XP x64 or Server 2003
  53. )
  54. if %version% == 5.1 (
  55. set framework=3_5
  56. echo hmmm... Windows XP
  57. )
  58. rem ## If not requested, skip the prompting
  59. if "%1" =="" goto final
  60. if %1 == -p goto prompt
  61. if %1 == --prompt goto prompt
  62. goto final
  63. :prompt
  64. echo I will now ask you four questions regarding your build.
  65. echo However, if you wish to build for:
  66. echo %bits% Architecture
  67. echo .NET %framework%
  68. echo Visual Studio %vstudio%
  69. echo.
  70. echo Simply tap [ENTER] three times.
  71. echo.
  72. echo Note that you can change these defaults by opening this
  73. echo batch file in a text editor.
  74. echo.
  75. :bits
  76. set /p bits="Choose your architecture (x86, x64, AnyCPU) [%bits%]: "
  77. if %bits%==86 goto configuration
  78. if %bits%==x86 goto configuration
  79. if %bits%==64 goto configuration
  80. if %bits%==x64 goto configuration
  81. if %bits%==AnyCPU goto configuration
  82. if %bits%==anycpu goto configuration
  83. echo "%bits%" isn't a valid choice!
  84. goto bits
  85. :configuration
  86. set /p configuration="Choose your configuration ((r)elease or (d)ebug)? [%configuration%]: "
  87. if %configuration%==r goto framework
  88. if %configuration%==d goto framework
  89. if %configuration%==release goto framework
  90. if %configuration%==debug goto framework
  91. echo "%configuration%" isn't a valid choice!
  92. goto configuration
  93. :framework
  94. set /p framework="Choose your .NET framework (4_0 or 4_5)? [%framework%]: "
  95. if %framework%==4_0 goto final
  96. if %framework%==4_5 goto final
  97. echo "%framework%" isn't a valid choice!
  98. goto framework
  99. :final
  100. echo.
  101. echo Configuring for %bits% architecture using %framework% .NET framework
  102. echo.
  103. echo.
  104. if %framework%==4_5 set %vstudio%=2012
  105. echo Calling Prebuild for target %vstudio% with framework %framework%...
  106. ..\bin\Prebuild.exe /target vs%vstudio% /targetframework v%framework% /conditionals ISWIN;NET_%framework%