-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.debug
More file actions
34 lines (24 loc) · 1.02 KB
/
Makefile.debug
File metadata and controls
34 lines (24 loc) · 1.02 KB
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
BUILD_DIR=build-debug
include $(N64_INST)/include/n64.mk
src = demo.c minilib.c main_debug.c
asm = rsp_u3d.S torus.S
N64_CFLAGS += -DDEBUG -Os
N64_CFLAGS += -DVIDEO_TYPE=1
all: small64_debug.z64
$(BUILD_DIR)/demo.o: $(BUILD_DIR)/rsp_u3d.inc
$(BUILD_DIR)/rsp_u3d.inc: rsp_u3d.S
@echo " [RSP] $<"
$(N64_CC) $(N64_RSPASFLAGS) -L$(N64_LIBDIR) -nostartfiles -Wl,-Trsp.ld -Wl,--gc-sections -Wl,-Map=$(BUILD_DIR)/$(notdir $(basename $@)).map -o $@.elf $<
$(N64_OBJCOPY) -O binary -j .text $@.elf $@.text.bin
$(N64_OBJCOPY) -O binary -j .data $@.elf $@.data.bin
$(N64_SIZE) -G $@.elf
./tools/ucode_to_inc.py $@.data.bin $@.text.bin $(BUILD_DIR)/rsp_u3d.inc
rm $@.elf $@.text.bin $@.data.bin
small64_debug.z64: N64_ROM_TITLE="Small64 (Debug)"
$(BUILD_DIR)/small64_debug.elf: $(src:%.c=$(BUILD_DIR)/%.o) $(asm:%.S=$(BUILD_DIR)/%.o)
run: small64_debug.z64
sc64deployer upload --direct small64_debug.z64 && sc64deployer debug
clean:
rm -rf $(BUILD_DIR) small64_debug.z64
-include $(wildcard $(BUILD_DIR)/*.d)
.PHONY: all clean run