aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/km
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-04-28 05:03:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-04-28 05:03:57 +0300
commitbc3fcd57386d0202f9551c21a23b141d6dee1dea (patch)
tree5be98dabfefcce6e65ca10fdadbbdc8a5aba59a4 /km
parentbuild/wdk7.1: refactoring (diff)
downloadwindows7-drivers-bc3fcd57386d0202f9551c21a23b141d6dee1dea.tar.gz
windows7-drivers-bc3fcd57386d0202f9551c21a23b141d6dee1dea.zip
build/wdk7.1: detect debug/release builds
Diffstat (limited to 'km')
-rw-r--r--km/build/wdk7.1/build_driver.bat6
-rw-r--r--km/build/wdk7.1/check_ddk.bat7
-rw-r--r--km/build/wdk7.1/check_env.bat10
-rw-r--r--km/build/wdk7.1/clean_driver.bat6
-rw-r--r--km/build/wdk7.1/setenv.bat37
5 files changed, 41 insertions, 25 deletions
diff --git a/km/build/wdk7.1/build_driver.bat b/km/build/wdk7.1/build_driver.bat
index 80089b8..7d7bfb7 100644
--- a/km/build/wdk7.1/build_driver.bat
+++ b/km/build/wdk7.1/build_driver.bat
@@ -22,9 +22,9 @@ for /f %%i in ("%drv_src_dir%") do (
call :make_relative drv_subdir "%proj_src_dir%"
-set "sys_dist_dir=%proj_bin_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
-set "pdb_dist_dir=%proj_bin_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
-set "lib_dist_dir=%proj_lib_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
+set "sys_dist_dir=%proj_bin_dir%\%target_arch%\%target_config%\%drv_subdir%"
+set "pdb_dist_dir=%proj_bin_dir%\%target_arch%\%target_config%\%drv_subdir%"
+set "lib_dist_dir=%proj_lib_dir%\%target_arch%\%target_config%\%drv_subdir%"
echo =========================== DRIVER INFO ===========================
echo Driver source directory: %drv_src_dir%
diff --git a/km/build/wdk7.1/check_ddk.bat b/km/build/wdk7.1/check_ddk.bat
index f71e3c4..95142dc 100644
--- a/km/build/wdk7.1/check_ddk.bat
+++ b/km/build/wdk7.1/check_ddk.bat
@@ -7,15 +7,16 @@
@echo off
if not defined BUILD_ALT_DIR goto :ddk_not_set
-if not defined _BUILDARCH goto :ddk_not_set
+if not defined _BUILDARCH goto :ddk_not_set
+if not defined DDKBUILDENV goto :ddk_not_set
-where build.exe >nul 2>&1 || goto :build_not_found
+where build.exe >nul 2>&1 || goto :build_not_found
where signtool.exe >nul 2>&1 || goto :signtool_not_found
where makecert.exe >nul 2>&1 || goto :makecert_not_found
exit /b 0
:ddk_not_set
-echo Error: either %%BUILD_ALT_DIR%% or %%_BUILDARCH%% are not set ^(have you set up the WinDDK environment?^) >&2
+echo Error: either %%BUILD_ALT_DIR%%, %%_BUILDARCH%% or %%DDKBUILDENV%% are not set ^(have you set up the WinDDK environment?^) >&2
exit /b 1
:build_not_found
diff --git a/km/build/wdk7.1/check_env.bat b/km/build/wdk7.1/check_env.bat
index 5a73d5f..6d2039e 100644
--- a/km/build/wdk7.1/check_env.bat
+++ b/km/build/wdk7.1/check_env.bat
@@ -9,9 +9,11 @@
call check_ddk.bat || exit /b !errorlevel!
if not defined proj_build_dir goto :env_not_set
-if not defined proj_bin_dir goto :env_not_set
-if not defined proj_lib_dir goto :env_not_set
-if not defined proj_src_dir goto :env_not_set
+if not defined proj_bin_dir goto :env_not_set
+if not defined proj_lib_dir goto :env_not_set
+if not defined proj_src_dir goto :env_not_set
+if not defined target_config goto :env_not_set
+if not defined target_arch goto :env_not_set
if not exist "%proj_build_dir%\sign.bat" (
echo Error: %proj_build_dir%\sign.bat was not found ^(don^'t know how to sign drivers otherwise^) >&2
@@ -21,5 +23,5 @@ if not exist "%proj_build_dir%\sign.bat" (
exit /b 0
:env_not_set
-echo Error: either %%proj_build_dir%%, %%proj_bin_dir%%, %%proj_lib_dir%% or %%proj_src_dir%% are not set ^(have set up the build environment using setenv.bat?^) >&2
+echo Error: either %%proj_build_dir%%, %%proj_bin_dir%%, %%proj_lib_dir%%, %%proj_src_dir%%, %%target_arch%% or %%target_config%% are not set ^(have set up the build environment using setenv.bat?^) >&2
exit /b 1
diff --git a/km/build/wdk7.1/clean_driver.bat b/km/build/wdk7.1/clean_driver.bat
index 36723da..8b3d7d4 100644
--- a/km/build/wdk7.1/clean_driver.bat
+++ b/km/build/wdk7.1/clean_driver.bat
@@ -23,9 +23,9 @@ for /f %%i in ("%drv_src_dir%") do (
call :make_relative drv_subdir "%proj_src_dir%"
-set "sys_dist_dir=%proj_bin_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
-set "pdb_dist_dir=%proj_bin_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
-set "lib_dist_dir=%proj_lib_dir%\%target_platform%\%target_configuration%\%drv_subdir%"
+set "sys_dist_dir=%proj_bin_dir%\%target_arch%\%target_config%\%drv_subdir%"
+set "pdb_dist_dir=%proj_bin_dir%\%target_arch%\%target_config%\%drv_subdir%"
+set "lib_dist_dir=%proj_lib_dir%\%target_arch%\%target_config%\%drv_subdir%"
echo =========================== DRIVER INFO ===========================
echo Driver source directory: %drv_src_dir%
diff --git a/km/build/wdk7.1/setenv.bat b/km/build/wdk7.1/setenv.bat
index 4d490b3..dc01a0b 100644
--- a/km/build/wdk7.1/setenv.bat
+++ b/km/build/wdk7.1/setenv.bat
@@ -5,6 +5,8 @@
@echo off
+call check_ddk.bat || goto :ddk_not_set
+
set "proj_build_dir=%~dp0%"
set "proj_dir=%proj_build_dir%\..\..\.."
@@ -14,22 +16,33 @@ set "proj_src_dir=%proj_dir%\km\src"
set "proj_bin_dir=%proj_build_dir%\bin"
set "proj_lib_dir=%proj_build_dir%\lib"
-set target_configuration=Release
-
-if not defined _BUILDARCH (
- echo Error: %%_BUILDARCH%% is not defined ^(have you set up the WinDDK environment?^) >&2
- exit /b 1
-)
-
if "%_BUILDARCH%" == "AMD64" (
- set target_platform=x64
- exit /b 0
+ set target_arch=x64
)
-
if "%_BUILDARCH%" == "x86" (
- set target_platform=x86
- exit /b 0
+ set target_arch=x86
+)
+
+if not defined target_arch goto :invalid_buildarch
+
+if "%DDKBUILDENV%" == "fre" (
+ set target_config=release
+)
+if "%DDKBUILDENV%" == "chk" (
+ set target_config=debug
)
+if not defined target_config goto :invalid_ddkbuildenv
+
+exit /b 0
+
+:ddk_not_set
+exit /b %errorlevel%
+
+:invalid_buildarch
echo Error: invalid %%_BUILDARCH%% value "%_BUILDARCH%" ^(the only supported architecture is x86^(-64^)^) >&2
exit /b 1
+
+:invalid_ddkbuildenv
+echo Error: invalid %%DDKBUILDENV%% value "%DDKBUILDENV%" >&2
+exit /b 1