-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-native-bluecove.cmd
85 lines (70 loc) · 2.09 KB
/
build-native-bluecove.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@rem $Id: build-native-bluecove.cmd 2486 2008-12-03 19:03:14Z skarzhevskyy $
@rem @echo off
@SETLOCAL
@echo Starting build at %TIME%, %DATE%
@rem %~dp0 is expanded pathname of the current script under NT
@set DEFAULT_BUILD_HOME=%~dp0
@rem get Parent Directory
@rem for /f %%i in ("%DEFAULT_BUILD_HOME%..") do @set DEFAULT_BUILD_HOME=%%~fi
@set CALLED_FROM_MAVEN=0
@if /I '%1' EQU '-maven' (
@set CALLED_FROM_MAVEN=1
@shift
)
@set CRUISECONTROL_BUILD=0
@set BUILD_ENV=manual
@if /I '%1' EQU '-buildEnv' (
@set BUILD_ENV=%2
@shift
@shift
)
@echo BUILD_ENV=%BUILD_ENV%
@if "%BUILD_ENV%" == "cruisecontrol" (
@set CRUISECONTROL_BUILD=1
)
@if exist %JAVA_HOME%/include/win32 goto java_found
@echo WARN: JAVA_HOME Not Found
:java_found
@rem %JAVA_HOME%\bin\javah -d src\main\c\intelbth -classpath target\classes com.intel.bluetooth.BluetoothPeer
@rem @if errorlevel 1 goto errormark
@set p=%ProgramFiles%\Microsoft Visual Studio\VC98\bin
@if exist "%p%\VCVARS32.BAT" goto vs_found
@echo Visual Studio 6 Not Found
@goto :errormark
:vs_found
@echo Found Visual Studio %p%
@set PATH=%p%;%PATH%
@rem PATH=%DEFAULT_BUILD_HOME%\bin;%PATH%
@echo [%p%\VCVARS32.BAT]
call "%p%\VCVARS32.BAT"
@rem WIDCOMM build by VC6
@set sdk_widcomm=%ProgramFiles%\Widcomm\BTW DK\SDK
@if NOT exist "%sdk_widcomm%" goto sdk_other_not_found
@echo Widcomm SDKs Found [%sdk_widcomm%]
@set INCLUDE=%INCLUDE%;%sdk_widcomm%\Inc
@set LIB=%LIB%;%sdk_widcomm%\Release
@echo Supported SDK found. Will use Release configuration
@goto DO_BUILD
:sdk_other_not_found
@echo ERROR: required SDK not found!
@goto errormark
:DO_BUILD
cd "%DEFAULT_BUILD_HOME%\src\main\c\intelbth"
nmake /A /F bluecove.mak
@if errorlevel 1 goto errormark
@echo [Build OK]
@cd "%DEFAULT_BUILD_HOME%"
copy src\main\resources\bluecove.dll target\classes\
@if errorlevel 1 goto errormark
@goto endmark
:errormark
@cd "%DEFAULT_BUILD_HOME%"
@echo Error in build
@if "%CALLED_FROM_MAVEN%" == "1" (
@ENDLOCAL
exit 1
)
@ENDLOCAL
pause
:endmark
@ENDLOCAL