diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -60,19 +60,22 @@ endif | |||
60 | 60 | ||
61 | main: $(BUILD_DIR) $(ROM) $(BIN) | 61 | main: $(BUILD_DIR) $(ROM) $(BIN) |
62 | 62 | ||
63 | $(ROM): $(TOOLS_BIN2CARR) | 63 | # Creates the rom object file from the given UXN_ROM. |
64 | ./tools/bin2carr/build/bin2carr -n uxn_rom -e u8 -o $(ROM) $(UXN_ROM) | 64 | $(ROM_FILE): |
65 | cp $(UXN_ROM) $(ROM_FILE) | ||
66 | |||
67 | $(ROM_OBJ): $(ROM_FILE) | ||
68 | $(OBJCOPY) --rename-section .data=.rodata \ | ||
69 | -I binary -O elf32-littlearm $(ROM_FILE) $(ROM_OBJ) | ||
65 | 70 | ||
66 | # Strip and fix header to create final .gba file. | 71 | # Strip and fix header to create final .gba file. |
67 | $(BIN): $(ELF) | 72 | $(BIN): $(ELF) |
68 | $(OBJCOPY) -v -O binary $(ELF) $(BIN) | 73 | $(OBJCOPY) -v -O binary $(ELF) $(BIN) |
69 | $(DEVKITTOOLS)/gbafix $(BIN) | 74 | $(DEVKITTOOLS)/gbafix $(BIN) |
75 | rm $(ROM_FILE) | ||
70 | 76 | ||
71 | # Link files. | 77 | # Link files. |
72 | $(ELF): $(SRC_MAIN) $(WATCH_SRC) | $(BUILD_DIR) | 78 | $(ELF): $(SRC_MAIN) $(WATCH_SRC) $(ROM_OBJ) | $(BUILD_DIR) |
73 | cp $(UXN_ROM) $(ROM_FILE) | ||
74 | $(OBJCOPY) --rename-section .data=.rodata \ | ||
75 | -I binary -O elf32-littlearm $(ROM_FILE) $(ROM_OBJ) | ||
76 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(ELF) $(SRC_MAIN) $(ASM_FILES) $(LDLIBS) $(ROM_OBJ) | 79 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(ELF) $(SRC_MAIN) $(ASM_FILES) $(LDLIBS) $(ROM_OBJ) |
77 | 80 | ||
78 | # Create build directory if needed. | 81 | # Create build directory if needed. |