mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-12-23 03:21:56 +01:00
33 lines
1.0 KiB
Makefile
33 lines
1.0 KiB
Makefile
TARGET = patches.elf
|
|
|
|
CC := clang
|
|
LD := ld.lld
|
|
OBJCOPY := llvm-objcopy
|
|
|
|
CFLAGS := -target mips -mips2 -mabi=32 -O2 -mno-abicalls -mno-odd-spreg -fomit-frame-pointer -mno-check-zero-division -G0 -Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces
|
|
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I ../../mm/include -I ../../mm/src -I ../../mm/build -I ../../mm/assets -I../lib/RT64-HLE/include
|
|
LDFLAGS := -nostdlib -T patches.ld -T syms.ld --just-symbols=../mm.us.rev1.elf --allow-multiple-definition
|
|
BINFLAGS := -O binary
|
|
|
|
C_SRCS := $(wildcard *.c)
|
|
C_OBJS := $(C_SRCS:.c=.o)
|
|
C_DEPS := $(C_SRCS:.c=.d)
|
|
|
|
DATABIN := $(TARGET:.elf=.bin)
|
|
|
|
$(DATABIN): $(TARGET)
|
|
$(OBJCOPY) $(BINFLAGS) $(TARGET) $@
|
|
|
|
$(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) $(DATABIN)
|
|
|
|
-include $(C_DEPS)
|
|
|
|
.PHONY: clean
|