Skip to content

Commit 63e3fbc

Browse files
authored
Add macos instructions and helpers (#7)
* fix(macos): add macos instructions and helpers * Add comment to the ifeq
1 parent 0780bc8 commit 63e3fbc

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
BUILD_DIR := build
22

3-
CC := clang
4-
LD := ld.lld
3+
# Allow the user to specify the compiler and linker on macOS
4+
# as Apple Clang does not support MIPS architecture
5+
ifeq ($(shell uname),Darwin)
6+
CC ?= clang
7+
LD ?= ld.lld
8+
else
9+
CC := clang
10+
LD := ld.lld
11+
endif
12+
513
TARGET := $(BUILD_DIR)/mod.elf
614

715
LDSCRIPT := mod.ld

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ You'll also need to build [N64Recomp](https://github.com/N64Recomp/N64Recomp) fo
2020
* First, run `make` (with an optional job count) to build the mod code itself.
2121
* Next, run the `RecompModTool` utility with `mod.toml` as the first argument and the build dir (`build` in the case of this template) as the second argument.
2222
* This will produce your mod's `.nrm` file in the build folder.
23+
* If you're on MacOS, you may need to specify the path to the `clang` and `ld.lld` binaries using the `CC` and `LD` environment variables, respectively.
2324

2425
### Updating the Majora's Mask Decompilation Submodule
2526
Mods can also be made with newer versions of the Majora's Mask decompilation instead of the commit targeted by this repo's submodule.
@@ -35,4 +36,4 @@ To update the commit of the decompilation that you're targeting, follow these st
3536
* If it fails due to a missing header, create an empty header file in the `include/dummy_headers` folder, with the same path.
3637
* For example, if it complains that `assets/objects/object_cow/object_cow.h` is missing, create an empty `include/dummy_headers/objects/object_cow.h` file.
3738
* If RecompModTool fails due to a function "being marked as a patch but not existing in the original ROM", it's likely that function you're patching was renamed in the Majora's Mask decompilation.
38-
* Find the relevant function in the map file for the old decomp commit, then go to that address in the new map file, and update the reference to this function in your code with the new name.
39+
* Find the relevant function in the map file for the old decomp commit, then go to that address in the new map file, and update the reference to this function in your code with the new name.

0 commit comments

Comments
 (0)