Zelda64Recomp/patches/Makefile
Wiseguy 79fc56f1fd
Remove decomp elf dependency and automate patch relocations (#419)
* Changed patch recompilation to use new reference symbol functionality and removed all manual relocations

* Moved symbol tomls to submodule, switched from objcopy to recompiler output binary mechanism for patch recompilation

* Update N64Recomp commit in CI to symbol_reference_file branch

* Remove option in patches toml that doesn't exist

* Update N64Recomp to fix issue with pause screen cursor, fix some issues caused by patches and overlay function-local statics

* Disable unpaired lo16 warnings and update N64Recomp in CI

* Update build instructions to reflect that the decomp elf is no longer needed
2024-07-05 16:33:34 -04:00

28 lines
1018 B
Makefile

TARGET = patches.elf
CC ?= clang
LD ?= ld.lld
CFLAGS := -target mips -mips2 -mabi=32 -O2 -G0 -mno-abicalls -mno-odd-spreg -mno-check-zero-division \
-fomit-frame-pointer -ffast-math -fno-unsafe-math-optimizations -fno-builtin-memset \
-Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces -Wno-unsupported-floating-point-opt
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I dummy_headers -I ../lib/mm-decomp/include -I ../lib/mm-decomp/src -I ../lib/mm-decomp/assets -I../lib/rt64/include
LDFLAGS := -nostdlib -T patches.ld -T syms.ld -Map patches.map --unresolved-symbols=ignore-all --emit-relocs
C_SRCS := $(wildcard *.c)
C_OBJS := $(C_SRCS:.c=.o)
C_DEPS := $(C_SRCS:.c=.d)
$(TARGET): $(C_OBJS) patches.ld syms.ld
$(LD) $(C_OBJS) $(LDFLAGS) -o $@
$(C_OBJS): %.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@
clean:
rm -rf $(C_OBJS) $(TARGET) $(C_DEPS)
-include $(C_DEPS)
.PHONY: clean