add build tools

This commit is contained in:
Vadim Rozenfeld 2013-12-30 22:59:42 +11:00
parent a3f72ee429
commit 51da605b0d
5 changed files with 115 additions and 0 deletions

31
qxldod/buildAll.bat Executable file
View File

@ -0,0 +1,31 @@
@echo off
call clean.bat
rem WIN8_64
setlocal
if exist Install\win8\amd64 rmdir Install\win8\amd64 /s /q
call callVisualStudio.bat 11 qxldod.vcxproj /Rebuild "Win8 Release|x64" /Out buildfre_win8_amd64.log
mkdir .\Install\Win8\x64
del /Q .\Install\Win8\x64\*
copy /Y objfre_win8_amd64\amd64\qxldod.sys .\Install\Win8\x64
copy /Y objfre_win8_amd64\amd64\qxldod.inf .\Install\Win8\x64
copy /Y objfre_win8_amd64\amd64\qxldod.cat .\Install\Win8\x64
copy /Y objfre_win8_amd64\amd64\qxldod.pdb .\Install\Win8\x64
endlocal
if %ERRORLEVEL% NEQ 0 goto :eof
rem WIN8_32
setlocal
if exist Install\win8\x86 rmdir Install\win8\x86 /s /q
call callVisualStudio.bat 11 qxldod.vcxproj /Rebuild "Win8 Release|Win32" /Out buildfre_win8_x86.log
mkdir .\Install\Win8\x86
del /Q .\Install\Win8\x86\*
copy /Y objfre_win8_x86\i386\qxldod.sys .\Install\Win8\x86
copy /Y objfre_win8_x86\i386\qxldod.inf .\Install\Win8\x86
copy /Y objfre_win8_x86\i386\qxldod.cat .\Install\Win8\x86
copy /Y objfre_win8_x86\i386\qxldod.pdb .\Install\Win8\x86
endlocal
if %ERRORLEVEL% NEQ 0 goto :eof
:eof

28
qxldod/callVisualStudio.bat Executable file
View File

@ -0,0 +1,28 @@
@echo off
call %~dp0\checkWin8Tools.bat
for /f "tokens=*" %%a in (
'cscript.exe /nologo "%~dp0\getVisualStudioCmdLine.vbs" %*'
) do (
set vs_cmd=%%a
)
IF NOT DEFINED vs_cmd (
echo Visual Studio not found
EXIT /b 1
)
SET vs_cmd_no_quotes="%vs_cmd:"=%"
IF "vs_cmd_no_quotes" == "" (
echo Visual Studio not found
EXIT /b 2
)
call %vs_cmd%
if %ERRORLEVEL% GEQ 1 (
echo Build with Visual Studio FAILED
exit /b %ERRORLEVEL%
)
exit /b 0

16
qxldod/checkWin8Tools.bat Executable file
View File

@ -0,0 +1,16 @@
@echo off
reg query "HKLM\Software\Microsoft\Windows Kits\WDK" /v WDKProductVersion >nul 2>nul
if %ERRORLEVEL% EQU 0 goto checkVS11
reg query "HKLM\Software\Wow6432Node\Microsoft\Windows Kits\WDK" /v WDKProductVersion > nul 2>nul
if %ERRORLEVEL% EQU 0 goto checkVS11
echo ERROR building Win8 drivers: Win8 WDK is not installed
exit /b 1
:checkVS11
reg query HKLM\Software\Microsoft\VisualStudio\11.0 /v InstallDir > nul 2>nul
if %ERRORLEVEL% EQU 0 exit /b 0
reg query HKLM\Software\Wow6432Node\Microsoft\VisualStudio\11.0 /v InstallDir > nul 2>nul
if %ERRORLEVEL% EQU 0 exit /b 0
echo ERROR building Win8 drivers: VS11 is not installed
exit /b 2

12
qxldod/clean.bat Executable file
View File

@ -0,0 +1,12 @@
@echo on
rmdir /S /Q .\Install
rmdir /S /Q objfre_win8_x86
rmdir /S /Q objfre_win8_amd64
rmdir /S /Q objchk_win8_x86
rmdir /S /Q objchk_win8_amd64
del /F *.log *.wrn *.err

View File

@ -0,0 +1,28 @@
' $1 - Visual studio version to run (10 or 11)
' $2 ... Parameters to pass
Dim strCmdLine, strTemp
Set WshShell = Wscript.CreateObject("Wscript.Shell")
On Error Resume Next
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir")
' In case of error assume WoW64 case
If Err <> 0 Then
On Error Goto 0
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir")
End If
On Error Goto 0
strCmdLine = chr(34) + strCmdLine + "devenv.com" + chr(34)
For i = 0 to (Wscript.Arguments.Count - 1)
If i > 0 Then
strTemp = Wscript.Arguments(i)
If InStr(strTemp, " ") Or InStr(strTemp, "|") Then
strCmdLine = strCmdLine + " " + chr(34) + strTemp + chr(34)
Else
strCmdLine = strCmdLine + " " + strTemp
End If
End If
Next
WScript.Echo strCmdLine + vbCrLf