This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
make.sh.bat
149 lines (115 loc) · 5.14 KB
/
make.sh.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#/bin/bash 2>nul || goto :windows
# bash
echo [bash env]
# cd "$(dirname -- "$(readlink -fn -- "$0")")"
cd `dirname $0`
bin/builder/premake5.linux codelite
bin/builder/premake5.linux gmake
bin/builder/premake5.linux vs2013
bin/builder/premake5.linux xcode4
bin/builder/premake5.linux ninja
bin/builder/ninja.linux -C _project
bin/builder/premake5.osx codelite
bin/builder/premake5.osx gmake
bin/builder/premake5.osx vs2013
bin/builder/premake5.osx xcode4
bin/builder/premake5.osx ninja
bin/builder/ninja.osx -C _project
exit
:windows
@echo off
attrib +s editor 1> nul 2> nul
REM rebuild
if "%1"=="rebuild" (
call "%0" clean
call "%0"
exit /b
)
REM cleanup
if "%1"=="clean" (
if exist _debug rd /q /s _debug && if exist _debug echo "error cannot clean up _debug" && goto error
if exist _debugopt rd /q /s _debugopt && if exist _debugopt echo "error cannot clean up _debugopt" && goto error
if exist _release rd /q /s _release && if exist _release echo "error cannot clean up _release" && goto error
if exist _project rd /q /s _project && if exist _project echo "error cannot clean up _project" && goto error
echo Cleaning up. && exit /b
)
if "%1"=="fuse" (
REM bundle a game-redist.zip #framework\*.dll
REM bundle a output.zip * -x#* -x.*
REM copy /b ava.exe+output.zip game.exe
)
REM setup
REM MSVC
if not "%Platform%"=="x64" (
echo [win][msc]
if exist "%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsx86_amd64.bat" (
@call "%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
) else if exist "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsx86_amd64.bat" (
@call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
) else if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" (
@call "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
) else if exist "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" (
@call "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
) else if exist "%ProgramFiles(x86)%\microsoft visual studio\2017\community\VC\Auxiliary\Build\vcvarsx86_amd64.bat" (
@call "%ProgramFiles(x86)%\microsoft visual studio\2017\community\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
) else (
echo Error: Could not find x64 environment variables for Visual Studio 2017/2015/2013
goto error
)
set Platform=x64
)
REM Luajit, %AVAROOT%
if ""=="" (
echo [win][set]
REM set AVAROOT="%~dp0%\"
REM set path="%path%;%~dp0%\bin\;"
REM endlocal && && set AVAROOT=%AVAROOT%
)
REM build
call "%0" clean
pushd "%~dp0%\tools\builder"
REM project generation
REM premake5.exe codelite
REM premake5.exe gmake
..\colorizer\colorizer premake5.exe vs2013
REM premake5.exe vs2013
REM premake5.exe xcode4
..\colorizer\colorizer premake5.exe ninja
REM actual build
set NINJA_STATUS="[%%r/%%f] [%%e] "
if "%1"=="debugopt" ( ..\colorizer\colorizer ninja.exe -v -C ..\..\_project debugopt ) else ( ^
if "%1"=="release" ( ..\colorizer\colorizer ninja.exe -v -C ..\..\_project release ) else ( ^
..\colorizer\colorizer ninja.exe -v -C ..\..\_project ^
) )
set OK=%ERRORLEVEL%
popd
REM editor
pushd "%~dp0%"
if exist _debug\editor.exe copy /y engine\3rd\SDL2.dll _debug 1>2> nul
if exist _release\editor.exe copy /y engine\3rd\SDL2.dll _release 1>2> nul
if exist _debugopt\editor.exe copy /y engine\3rd\SDL2.dll _debugopt 1>2> nul
if "0"=="%OK%" (
rem color
echo ^>^> editor
if "%1"=="release" shift
if "%1"=="debugopt" shift
if "%1"=="debug" (
if exist _debug\editor.exe start "" devenv /Run "_debug\editor.exe" %*
if exist _release\editor.exe start "" devenv /Run "_release\editor.exe" %*
if exist _debugopt\editor.exe start "" devenv /Run "_debugopt\editor.exe" %*
) else (
if exist _debug\editor.exe pushd _debug && editor.exe %* && popd
if exist _release\editor.exe pushd _release && editor.exe %* && popd
if exist _debugopt\editor.exe pushd _debugopt && editor.exe %* && popd
)
echo ^<^< editor
) else (
:error
rem color 4f
rem echo && rem beep
)
popd
REM exit
echo Press any key to continue... && pause > nul
rem color
exit /b