aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/setenv.bat
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-04-27 14:07:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-04-27 14:07:57 +0300
commitb137ccc9bfd96524093071f9ee75ac820b6ad903 (patch)
treec8afdd8433b228eba636ce13b0a3be814a576d79 /setenv.bat
parentconsistent indentation in *.bat files (diff)
downloadwindows7-drivers-b137ccc9bfd96524093071f9ee75ac820b6ad903.tar.gz
windows7-drivers-b137ccc9bfd96524093071f9ee75ac820b6ad903.zip
*.bat: bugfix & refactoring
Diffstat (limited to 'setenv.bat')
-rw-r--r--setenv.bat34
1 files changed, 20 insertions, 14 deletions
diff --git a/setenv.bat b/setenv.bat
index f8e5073..ee164df 100644
--- a/setenv.bat
+++ b/setenv.bat
@@ -5,21 +5,27 @@
@echo off
-set root=%~dp0%
-set src_root=%root%src
-set bin_root=%root%bin
-set lib_root=%root%lib
+set "root=%~dp0%"
+set "src_root=%root%src"
+set "bin_root=%root%bin"
+set "lib_root=%root%lib"
set target_configuration=Release
-if [%_BUILDARCH%] == [AMD64] goto :target_platform_x64
-if [%_BUILDARCH%] == [x86] goto :target_platform_x86
-echo Unsupported %%_BUILDARCH%% (supported build architectures: AMD64, x86)
-exit /b -1
+if not defined _BUILDARCH (
+ echo Error: %%_BUILDARCH%% is not defined ^(have you set up the WinDDK environment?^) >&2
+ exit /b 1
+)
-:target_platform_x64
-set target_platform=x64
-exit /b 0
-:target_platform_x86
-set target_platform=x86
-exit /b 0
+if "%_BUILDARCH%" == "AMD64" (
+ set target_platform=x64
+ exit /b 0
+)
+
+if "%_BUILDARCH%" == "x86" (
+ set target_platform=x86
+ exit /b 0
+)
+
+echo Error: invalid %%_BUILDARCH%% value "%_BUILDARCH%" ^(the only supported architecture is x86^(-64^)^) >&2
+exit /b 1