Skip to content

Commit 25a55d7

Browse files
committed
Merge 'Add C and ASM build actions' (OoTRandomizer#2469)
2 parents bcac35f + 708b9ee commit 25a55d7

4 files changed

Lines changed: 98 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ "Dev" ]
5+
pull_request:
6+
branches: [ "Dev" ]
7+
8+
jobs:
9+
test_assembly_build:
10+
name: Build - Assembly
11+
runs-on: ubuntu-latest
12+
container:
13+
image: practicerom/practicerom-dev
14+
strategy:
15+
matrix:
16+
python-version: ["3.x"]
17+
18+
steps:
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install armips dependencies
24+
run: sudo apt-get update && sudo apt-get install -y cmake g++
25+
- name: Checkout armips
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
repository: Kingcom/armips
30+
ref: master
31+
- name: Build armips
32+
run: mkdir build && cd build && cmake .. && cmake --build . --config Release && sudo mv armips /usr/local/bin/armips && cd ..
33+
- uses: actions/checkout@v4
34+
- name: Create fake base ROM
35+
run: dd if=/dev/zero of=ASM/roms/base.z64 bs=64M count=1
36+
- name: Run build scripts
37+
run: python ASM/build.py --no-compile-c --mips-binutils-prefix mips64-ultra-elf-
38+
test_C_build:
39+
name: Build - C
40+
runs-on: ubuntu-latest
41+
container:
42+
image: practicerom/practicerom-dev
43+
strategy:
44+
matrix:
45+
python-version: [ "3.x" ]
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Set up Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
- name: Create fake base ROM
54+
run: dd if=/dev/zero of=ASM/roms/base.z64 bs=64M count=1
55+
- name: Create fake patched ROM
56+
run: dd if=/dev/zero of=ASM/roms/patched.z64 bs=64M count=1
57+
- name: Run build scripts
58+
run: python ASM/build.py --diff-only --mips-binutils-prefix mips64-ultra-elf-
59+
test_full_build:
60+
name: Build - Full
61+
runs-on: ubuntu-latest
62+
container:
63+
image: practicerom/practicerom-dev
64+
strategy:
65+
matrix:
66+
python-version: [ "3.x" ]
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Set up Python ${{ matrix.python-version }}
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
- name: Install armips dependencies
75+
run: sudo apt-get update && sudo apt-get install -y cmake g++
76+
- name: Checkout armips
77+
uses: actions/checkout@v4
78+
with:
79+
submodules: recursive
80+
repository: Kingcom/armips
81+
ref: master
82+
- name: Build armips
83+
run: mkdir build && cd build && cmake .. && cmake --build . --config Release && sudo mv armips /usr/local/bin/armips && cd ..
84+
- uses: actions/checkout@v4
85+
- name: Create fake base ROM
86+
run: dd if=/dev/zero of=ASM/roms/base.z64 bs=64M count=1
87+
- name: Run build scripts
88+
run: python ASM/build.py --mips-binutils-prefix mips64-ultra-elf-
89+

ASM/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
CC = mips64-gcc
2-
LD = mips64-ld
3-
OBJDUMP = mips64-objdump
4-
OBJCOPY = mips64-objcopy
1+
MIPS_BINUTILS_PREFIX ?= mips64-
2+
CC = $(MIPS_BINUTILS_PREFIX)gcc
3+
LD = $(MIPS_BINUTILS_PREFIX)ld
4+
OBJDUMP = $(MIPS_BINUTILS_PREFIX)objdump
5+
OBJCOPY = $(MIPS_BINUTILS_PREFIX)objcopy
56

67
CFLAGS = -O1 -G0 -fno-reorder-blocks -march=vr4300 -mtune=vr4300 -mabi=32 -mno-gpopt -mdivide-breaks \
78
-mexplicit-relocs

ASM/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
parser.add_argument('--no-compile-c', action='store_true', help="Do not recompile C modules")
1818
parser.add_argument('--dump-obj', action='store_true', help="Dumps extra object info for debugging purposes. Does nothing with --no-compile-c")
1919
parser.add_argument('--diff-only', action='store_true', help="Creates diff output without running armips")
20+
parser.add_argument('--mips-binutils-prefix', type=str, default="mips64-", help="Use a different prefix for N64 toolchain")
2021

2122
args = parser.parse_args()
2223
pj64_sym_path = args.pj64sym
2324
compile_c = not args.no_compile_c
2425
dump_obj = args.dump_obj
2526
diff_only = args.diff_only
27+
mips_binutils_prefix = args.mips_binutils_prefix
2628

2729
root_dir = os.path.dirname(os.path.realpath(__file__))
2830
tools_dir = os.path.join(root_dir, 'tools')
@@ -44,6 +46,7 @@
4446

4547
if compile_c:
4648
clist = ['make']
49+
clist.append(f'MIPS_BINUTILS_PREFIX={mips_binutils_prefix}')
4750
if dump_obj:
4851
clist.append('RUN_OBJDUMP=1')
4952
call(clist)

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '8.3.47'
1+
__version__ = '8.3.48'
22

33
# This is a supplemental version number for branches based off of main dev.
44
supplementary_version = 0

0 commit comments

Comments
 (0)