forked from unsound/hfsexplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildllio.bat
75 lines (58 loc) · 1.96 KB
/
buildllio.bat
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
@echo off
setlocal
:vars
set CV_JAVA_BUILD_DIR=%~dp0.antbuild~
set COMPILER=%1
set ARCHITECTURE=%2
set LLIO_SOURCEDIR=%~dp0\src\win32\llio
:start
if "%COMPILER%" == "gcc" goto check_gcc_arch
if "%COMPILER%" == "vc" goto check_vc_arch
echo You must specify which compiler to use ("gcc" or "vc")...
goto end
:check_vc_arch
if "%ARCHITECTURE%" == "x86" goto build
if "%ARCHITECTURE%" == "x64" goto build
if "%ARCHITECTURE%" == "ia64" goto build
if "%ARCHITECTURE%" == "" (
echo You must specify which architecture to build ("x86", "x64" or "ia64"^).
) else (
echo Invalid architecture "%ARCHITECTURE%" for vc build ("x86", "x64" and "ia64" are valid^).
)
goto end
:check_gcc_arch
if "%ARCHITECTURE%"=="" goto build
if "%ARCHITECTURE%"=="x86" goto build
echo Invalid architecture "%ARCHITECTURE%" for gcc build (only "x86" is valid).
goto end
:build
echo Building all classes to make sure all is well...
call "%~dp0\buildall.bat"
if not "%ERRORLEVEL%"=="0" goto error
echo Creating header file for org.catacombae.storage.io.win32.ReadableWin32FileStream...
javah -jni -classpath "%CV_JAVA_BUILD_DIR%" -d "%LLIO_SOURCEDIR%" org.catacombae.storage.io.win32.ReadableWin32FileStream
if not "%ERRORLEVEL%"=="0" goto error
echo Creating header file for org.catacombae.storage.io.win32.Win32FileStream...
javah -jni -classpath "%CV_JAVA_BUILD_DIR%" -d "%LLIO_SOURCEDIR%" org.catacombae.storage.io.win32.Win32FileStream
if not "%ERRORLEVEL%"=="0" goto error
if "%COMPILER%"=="gcc" goto gcc_compile
if "%COMPILER%"=="vc" goto vc_compile
goto error
:gcc_compile
echo Compiling with GCC...
call "%~dp0\buildllio_compile.bat" gcc
if not "%ERRORLEVEL%"=="0" goto error
goto completed
:vc_compile
echo Compiling with Visual C++...
call "%~dp0\buildllio_compile.bat" vc %ARCHITECTURE%
if not "%ERRORLEVEL%"=="0" goto error
goto completed
:error
echo There were errors!
goto end
:completed
echo Done!
goto end
:end
endlocal