This repository has been archived by the owner on Jan 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBuildCode.bat
51 lines (39 loc) · 1.53 KB
/
BuildCode.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
SETLOCAL EnableDelayedExpansion
@echo off
cls
del build\*.o
SET "debug="
SET "cwDWARF="
if "%1" equ "-d" SET "debug=-debug -map=^"%appdata%\Dolphin Emulator\Maps\RMCP01.map^" -readelf=^"C:\MinGW\bin\readelf.exe^""
if "%1" equ "-d" SET "cwDWARF=-g"
:: Destination (change as necessary)
SET "SOURCE=RetroRewind6"
SET "RIIVO=%appdata%\Dolphin Emulator\Load\Riivolution\RetroRewind6"
SET "ENGINE=..\Pulsar\KamekInclude"
echo %ENGINE%
:: CPP compilation settings
SET CC="../Pulsar/cw/mwcceppc.exe"
SET CFLAGS=-I- -i "../Pulsar/KamekInclude" -i "../Pulsar/GameSource" -i "../Pulsar/GameSource/game" -i "../Pulsar/GameSource/core" -i "../Pulsar/PulsarEngine" -i "../Pulsar" -i code^
-opt all -inline auto -enum int -proc gekko -fp hard -sdata 0 -sdata2 0 -maxerrors 1 -func_align 4 %cwDWARF%
SET DEFINE=
:: CPP Sources
SET CPPFILES=
for /R "../Pulsar/PulsarEngine" %%f in (*.cpp) do SET "CPPFILES=%%f !CPPFILES!"
for /R code %%f in (*.cpp) do SET "CPPFILES=%%f !CPPFILES!"
:: Compile CPP
%CC% %CFLAGS% -c -o "build/kamek.o" "%ENGINE%\kamek.cpp"
SET OBJECTS=
FOR %%H IN (%CPPFILES%) DO (
::echo "Compiling %%H..."
%CC% %CFLAGS% %DEFINE% -c -o "build/%%~nH.o" "%%H"
SET "OBJECTS=build/%%~nH.o !OBJECTS!"
)
:: Link
echo Linking... %time%
"../Pulsar/KamekLinker/kamek" "build/kamek.o" %OBJECTS% %debug% -dynamic -externals="../Pulsar/GameSource/symbols.txt" -versions="../Pulsar/GameSource/versions.txt" -output-combined=build\Code.pul
if %ErrorLevel% equ 0 (
xcopy /Y build\*.pul "%RIIVO%\Binaries" >nul
echo Binaries copied
)
:end
ENDLOCAL