-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeGPL.bat
More file actions
69 lines (53 loc) · 1.5 KB
/
MakeGPL.bat
File metadata and controls
69 lines (53 loc) · 1.5 KB
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
@echo off
rem Where the source files are located
set SRC=GPL
rem Where the compiled code will go
set DEST=Data
rem The name of the compiled GPL byte code.
set OUTPUTNAME=GoblinMod.bcd
rem The project file that defines what files will be compiled
set GPLPROJECTFILE=GoblinMod.gplproj
set GPLBCC=""
rem Is the compiler in the Quest's source directory?
if EXIST gplbcc.exe (
set GPLBCC="%CD%\gplbcc.exe"
goto foundCompiler
)
rem How about one up from where this file is?
if EXIST ..\gplbcc.exe (
set GPLBCC="%CD%\..\gplbcc.exe"
goto foundCompiler
)
rem Is the Majesty SDK installed?
if NOT "%MAJESTYSDK%"=="" (
set GPLBCC="%MAJESTYSDK%\gplbcc.exe"
)
rem Check to make sure the compiler is available
if NOT EXIST %GPLBCC% goto missingCompiler
:foundCompiler
if NOT EXIST "%DEST%" (
mkdir "%DEST%"
)
echo Using GPL compiler at %GPLBCC%
call :buildit %GPLPROJECTFILE% %OUTPUTNAME%
if NOT EXIST "%SRC%\%OUTPUTNAME%" goto buildFailed
echo Copying to %SRC%\%OUTPUTNAME% to %DEST%
copy /y "%SRC%\%OUTPUTNAME%" "%DEST%"
del "%SRC%\%OUTPUTNAME%"
goto :EOF
rem ************************************************
:buildit
pushd %SRC%
if EXIST %2 del %2
echo Building %1, output as %2
%GPLBCC% -in %1 -out %2 -stdout
popd
goto :EOF
rem ************************************************
:missingCompiler
echo ERROR: Unable to find the GPL compiler. Set the MAJESTYSDK environment variable to point to the SDK path.
goto :EOF
rem ************************************************
:buildFailed
echo ERROR: Compile failed.
goto :EOF