Skip to content

Commit

Permalink
update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalgust committed Dec 14, 2020
1 parent 2822a05 commit 1923c8e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
17 changes: 11 additions & 6 deletions binary/build_jar.bat
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
@echo off
echo Requirement: jar javac

set JAR=jar
set JAVAC=javac

mkdir lib
mkdir libex

echo "build lib\minijvm_rt.jar"
echo build lib\minijvm_rt.jar
call :build_jar minijvm_rt.jar ..\minijvm\java\src\main lib

echo "build libex\glfw_gui.jar"
echo build libex\glfw_gui.jar
call :build_jar glfw_gui.jar ..\desktop\glfw_gui\java\src\main libex

echo "build libex\minijvm_test.jar"
echo build libex\minijvm_test.jar
call :build_jar minijvm_test.jar ..\test\minijvm_test\src\main libex
exit

echo completed.
pause
goto :eof


:build_jar
del /Q/S/F %3\%1
md classes
dir /S /B %2\java\*.java > source.txt
javac -cp lib\*;libex\* -encoding "utf-8" -d classes @source.txt
%JAVAC% -cp lib\*;libex\* -encoding "utf-8" -d classes @source.txt
xcopy /E %2\resource\* classes\
jar cf %1 -C classes .\
%JAR% cf %1 -C classes .\
del /Q/S source.txt
rd /Q/S classes\
move /Y %1 %3\
Expand Down
11 changes: 7 additions & 4 deletions binary/build_wini686.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ set GCCHOME=D:\msys64\mingw32
rem ==============================================================


echo [INFO]Build require tdm-gcc , setup gcc home : %GCCHOME%
echo [INFO]Build require MinGW-w64 , setup gcc home : %GCCHOME%
if exist %GCCHOME% (
echo [INFO]tdm-gcc found
echo [INFO]gcc found
) else (
echo [ERROR]tdm-gcc not found
echo [INFO]Please download tdm-gcc: https://jmeubank.github.io/tdm-gcc/
echo [ERROR]gcc not found
echo [INFO]Please download tdm-gcc: http://mingw-w64.org/
echo [INFO]Change GCCHOME with installed directory
goto :eof
)
Expand All @@ -28,6 +28,9 @@ call :jvm_compile mini_jvm.exe ..\minijvm\c %TARGETDIR%
echo [INFO]build libgui.dll
call :gui_compile libgui.dll ..\desktop\glfw_gui\c %TARGETDIR%

echo completed.
pause

goto :eof
rem ==============================================================
:jvm_compile
Expand Down
13 changes: 8 additions & 5 deletions binary/build_winx64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
set GLFWDIR=win_x64
set TARGETDIR=win_x64
set LIBDIR=x86_64-w64-mingw32
set GCCHOME=D:\TDM-GCC-64
set GCCHOME=D:\msys64\mingw64
rem ==============================================================


echo [INFO]Build require tdm-gcc , setup gcc home : %GCCHOME%
echo [INFO]Build require MinGW-w64 , setup gcc home : %GCCHOME%
if exist %GCCHOME% (
echo [INFO]tdm-gcc found
echo [INFO]gcc found
) else (
echo [ERROR]tdm-gcc not found
echo [INFO]Please download tdm-gcc: https://jmeubank.github.io/tdm-gcc/
echo [ERROR]gcc not found
echo [INFO]Please download tdm-gcc: http://mingw-w64.org/
echo [INFO]Change GCCHOME with installed directory
goto :eof
)
Expand All @@ -28,6 +28,9 @@ call :jvm_compile mini_jvm.exe ..\minijvm\c %TARGETDIR%
echo [INFO]build libgui.dll
call :gui_compile libgui.dll ..\desktop\glfw_gui\c %TARGETDIR%

echo completed.
pause

goto :eof
rem ==============================================================
:jvm_compile
Expand Down

0 comments on commit 1923c8e

Please sign in to comment.