aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--add_cert.bat4
-rw-r--r--build_driver.bat57
-rw-r--r--build_drivers.bat6
-rw-r--r--check_ddk.bat4
-rw-r--r--clean_driver.bat32
-rw-r--r--clean_drivers.bat6
-rw-r--r--sign.bat8
7 files changed, 60 insertions, 57 deletions
diff --git a/add_cert.bat b/add_cert.bat
index 8b4adce..fa457a8 100644
--- a/add_cert.bat
+++ b/add_cert.bat
@@ -15,9 +15,9 @@ echo.
echo ======================= ADDING CERTIFICATE ========================
call check_ddk.bat || goto :add_cert_failure
echo makecert.exe -r -pe -ss root -n CN="%cert_name%" "%cert_name%.cer"
-makecert.exe -r -pe -ss root -n CN="%cert_name%" "%cert_name%.cer" >nul || goto :add_cert_failure
+ makecert.exe -r -pe -ss root -n CN="%cert_name%" "%cert_name%.cer" >nul || goto :add_cert_failure
echo del "%cert_name%.cer"
-del "%cert_name%.cer" >nul || goto :add_cert_failure
+ del "%cert_name%.cer" >nul || goto :add_cert_failure
echo =================== ADDING CERTIFICATE SUCCESS ====================
exit /b 0
diff --git a/build_driver.bat b/build_driver.bat
index 2020dd9..283cde8 100644
--- a/build_driver.bat
+++ b/build_driver.bat
@@ -7,8 +7,8 @@
@echo off
if [%1] == [] (
- echo Usage: %~0 DRIVER_SRC_ROOT
- exit /b 1
+ echo Usage: %~0 DRIVER_SRC_ROOT
+ exit /b 1
)
call check_env.bat || exit /b !errorlevel!
@@ -17,8 +17,8 @@ call check_ddk.bat || exit /b !errorlevel!
set driver_src_root=%~f1
for /f %%i in ("%driver_src_root%") do (
- set driver_name=%%~ni
- set driver_dist_subdir=%%~dpi
+ set driver_name=%%~ni
+ set driver_dist_subdir=%%~dpi
)
call :make_relative driver_dist_subdir "%src_root%"
@@ -35,20 +35,20 @@ echo.
echo ============================== BUILD ==============================
set LIBDISTDIR=%lib_dist_dir%
pushd "%driver_src_root%" && (
- build.exe /cegwZ
- popd
+ build.exe /cegwZ
+ popd
)
if %errorlevel% equ 0 (
- echo ========================== BUILD SUCCESS ==========================
+ echo ========================== BUILD SUCCESS ==========================
) else (
- echo ========================== BUILD FAILURE ==========================
- exit /b %errorlevel%
+ echo ========================== BUILD FAILURE ==========================
+ exit /b %errorlevel%
)
if [%_BUILDARCH%] == [x86] (
- set buildarch_directory=i386
+ set buildarch_directory=i386
) else (
- set buildarch_directory=%_BUILDARCH%
+ set buildarch_directory=%_BUILDARCH%
)
set sys_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_name%.sys
@@ -56,34 +56,35 @@ set pdb_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_
set lib_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_name%.lib
if exist "%sys_path%" (
- echo.
- call "%root%\sign.bat" "%sys_path%" || exit /b !errorlevel!
+ echo.
+ call "%root%\sign.bat" "%sys_path%" || exit /b !errorlevel!
)
echo.
echo ============================== DISTR ==============================
if exist "%sys_path%" (
- call :distr_copy "%sys_path%" "%sys_dist_dir%" || goto :distr_failure
- call :distr_copy "%pdb_path%" "%pdb_dist_dir%" || goto :distr_failure
+ call :distr_copy "%sys_path%" "%sys_dist_dir%" || goto :distr_failure
+ call :distr_copy "%pdb_path%" "%pdb_dist_dir%" || goto :distr_failure
)
if exist "%lib_path%" (
- call :distr_copy "%lib_path%" "%lib_dist_dir%" || goto :distr_failure
+ call :distr_copy "%lib_path%" "%lib_dist_dir%" || goto :distr_failure
)
echo ========================== DISTR SUCCESS ==========================
exit /b
:distr_mkdir
if not exist "%~1\" (
- echo mkdir "%~1"
- mkdir "%~1" >nul || exit /b !errorlevel!
+ echo mkdir "%~1"
+ mkdir "%~1" >nul
+ exit /b !errorlevel!
)
-exit /b
+exit /b 0
:distr_copy
call :distr_mkdir "%~2" || exit /b !errorlevel!
echo copy "%~1" "%~2"
-copy "%~1" "%~2" >nul || exit /b !errorlevel!
-exit /b
+ copy "%~1" "%~2" >nul
+exit /b !errorlevel!
:distr_failure
echo ========================== DISTR FAILURE ==========================
@@ -100,13 +101,13 @@ for /f "tokens=*" %%a in ("%base%") do set base=%%~fa
set match=
set c=
for /f "tokens=*" %%a in ('echo.%base:\=^&echo.%') do (
- set sub=!sub!%%a\
- call set tmp=%%src:!sub!=%%
- if "!tmp!" neq "!src!" (
- set match=!sub!
- ) else (
- set upper=!upper!..\
- )
+ set sub=!sub!%%a\
+ call set tmp=%%src:!sub!=%%
+ if "!tmp!" neq "!src!" (
+ set match=!sub!
+ ) else (
+ set upper=!upper!..\
+ )
)
set src=%upper%!src:%match%=!
(endlocal
diff --git a/build_drivers.bat b/build_drivers.bat
index 2440e85..fd6f9b6 100644
--- a/build_drivers.bat
+++ b/build_drivers.bat
@@ -7,7 +7,7 @@
@echo off
for /f "delims=" %%i in ('dir /s sources /b') do (
- set driver_src_root=%%~dpi
- echo.
- call build_driver.bat "!driver_src_root:~0,-1!" || exit /b !errorlevel!
+ set driver_src_root=%%~dpi
+ echo.
+ call build_driver.bat "!driver_src_root:~0,-1!" || exit /b !errorlevel!
)
diff --git a/check_ddk.bat b/check_ddk.bat
index 6782770..a57a7fb 100644
--- a/check_ddk.bat
+++ b/check_ddk.bat
@@ -12,8 +12,8 @@ if [%BUILD_ALT_DIR%] == [] goto :ddk_not_set
if [%_BUILDARCH%] == [] goto :ddk_not_set
if not exist %root%\sign.bat (
- echo Error: %root%\sign.bat is missing ^(don^'t know how to sign drivers^)
- exit /b 1
+ echo Error: %root%\sign.bat is missing ^(don^'t know how to sign drivers^)
+ exit /b 1
)
where build.exe >nul 2>&1 || goto :build_not_found
diff --git a/clean_driver.bat b/clean_driver.bat
index d3f40d8..a74a1a6 100644
--- a/clean_driver.bat
+++ b/clean_driver.bat
@@ -7,8 +7,8 @@
@echo off
if [%1] == [] (
- echo Usage: %~0 DRIVER_SRC_ROOT
- exit /b 1
+ echo Usage: %~0 DRIVER_SRC_ROOT
+ exit /b 1
)
call check_ddk.bat || exit /b !errorlevel!
@@ -18,8 +18,8 @@ set driver_src_root=%~f1
cd "%driver_src_root%"
for /f %%i in ("%driver_src_root%") do (
- set driver_name=%%~ni
- set driver_dist_root=%%~dpi
+ set driver_name=%%~ni
+ set driver_dist_root=%%~dpi
)
call :make_relative driver_dist_root "%src_root%"
@@ -46,15 +46,17 @@ exit /b
:clean_rmdir
if exist "%~1\" (
- echo rmdir /s /q "%~1"...
- rmdir /s /q "%~1" >nul || exit /b !errorlevel!
+ echo rmdir /s /q "%~1"
+ rmdir /s /q "%~1" >nul
+ exit /b !errorlevel!
)
exit /b
:clean_del
if exist "%~1" (
- echo del "%~1"
- del "%~1" >nul || exit /b !errorlevel!
+ echo del "%~1"
+ del "%~1" >nul
+ exit /b !errorlevel!
)
exit /b
@@ -73,13 +75,13 @@ for /f "tokens=*" %%a in ("%base%") do set base=%%~fa
set match=
set c=
for /f "tokens=*" %%a in ('echo.%base:\=^&echo.%') do (
- set sub=!sub!%%a\
- call set tmp=%%src:!sub!=%%
- if "!tmp!" neq "!src!" (
- set match=!sub!
- ) else (
- set upper=!upper!..\
- )
+ set sub=!sub!%%a\
+ call set tmp=%%src:!sub!=%%
+ if "!tmp!" neq "!src!" (
+ set match=!sub!
+ ) else (
+ set upper=!upper!..\
+ )
)
set src=%upper%!src:%match%=!
(endlocal
diff --git a/clean_drivers.bat b/clean_drivers.bat
index 6ec8e49..76dabe0 100644
--- a/clean_drivers.bat
+++ b/clean_drivers.bat
@@ -7,7 +7,7 @@
@echo off
for /f "delims=" %%i in ('dir /s sources /b') do (
- set driver_src_root=%%~dpi
- echo.
- call clean_driver.bat "!driver_src_root:~0,-1!" || exit /b !errorlevel!
+ set driver_src_root=%%~dpi
+ echo.
+ call clean_driver.bat "!driver_src_root:~0,-1!" || exit /b !errorlevel!
)
diff --git a/sign.bat b/sign.bat
index 853cc79..67e3dc2 100644
--- a/sign.bat
+++ b/sign.bat
@@ -9,8 +9,8 @@
set cert_name=windows7_drivers
if [%1] == [] (
- echo Usage: %0 SYS_PATH
- exit /b 1
+ echo Usage: %0 SYS_PATH
+ exit /b 1
)
set sys_path=%~f1
@@ -22,9 +22,9 @@ echo.
echo ============================= SIGNING =============================
call check_ddk.bat || goto :signing_failure
echo signtool.exe sign /s root /n "%cert_name%" "%sys_path%"
-signtool.exe sign /s root /n "%cert_name%" "%sys_path%" >nul || goto :signing_failure
+ signtool.exe sign /s root /n "%cert_name%" "%sys_path%" >nul || goto :signing_failure
echo signtool.exe verify /pa "%sys_path%"
-signtool.exe verify /pa "%sys_path%" >nul || goto :signing_failure
+ signtool.exe verify /pa "%sys_path%" >nul || goto :signing_failure
echo ========================= SIGNING SUCCESS =========================
exit /b 0