forked from EXL/P2kElfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_ep2.bat
57 lines (43 loc) · 1.5 KB
/
make_ep2.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
:: This make_ep2.bat script was created by EXL, 26-Mar-2023.
:: Default platform is Motorola P2K, ElfPack v2.x, devkitARM release 26 (GCC 4.4.0) on Windows.
:: Uncomment it for disable verbose output.
:: @echo off
if /I "%1"=="clean" (
if exist *.o del *.o
if exist *.obj del *.obj
if exist *.elfp del *.elfp
if exist *.elf del *.elf
exit /b 0
)
:: Compiler path.
set ARM_PATH=C:\devkitARM
:: SDK path.
set SDK_PATH=%ARM_PATH%\SDK
:: Libraries path.
set LIB_PATH=%ARM_PATH%\lib
:: Main link library.
set LIB_MAIN=std.sa
:: Libc link library.
set LIB_LIBC=libc.a
:: Defines.
set DEFINES=-D__P2K__ -DEP2 -DROT_90 -DFPS_30
:: set DEFINES=-D__P2K__ -DEP2 -DJAVA_HEAP
:: Includes.
set INCLUDES=-I.
:: Optimization.
set OPTIM=-O2
:: Project/ELF name.
set ELF_NAME=Spout
set PCS_NAME=Piece
:: Compiling step.
%ARM_PATH%\bin\arm-eabi-gcc -c -Wall -mbig-endian -mthumb -mthumb-interwork -nostdlib ^
-fshort-wchar -fshort-enums -fpack-struct=4 -fno-builtin -fvisibility=hidden ^
-I%SDK_PATH% %INCLUDES% %DEFINES% %OPTIM% Piece.c -o Piece.o
%ARM_PATH%\bin\arm-eabi-gcc -c -Wall -mbig-endian -mthumb -mthumb-interwork -nostdlib ^
-fshort-wchar -fshort-enums -fpack-struct=4 -fno-builtin -fvisibility=hidden ^
-I%SDK_PATH% %INCLUDES% %DEFINES% %OPTIM% %ELF_NAME%.c -o %ELF_NAME%.o
:: Linking step.
%ARM_PATH%\bin\arm-eabi-ld -pie -EB %OPTIM% -nostdlib Piece.o %ELF_NAME%.o ^
%LIB_PATH%\%LIB_MAIN% %LIB_PATH%\%LIB_LIBC% -o %ELF_NAME%.elfp
:: Post linking step.
%ARM_PATH%\libgen\postlink.exe %ELF_NAME%.elfp -o %ELF_NAME%.elf