diff options
| author | Bad Diode <[email protected]> | 2023-09-08 13:14:10 +0200 |
|---|---|---|
| committer | Bad Diode <[email protected]> | 2023-09-08 13:14:10 +0200 |
| commit | c9a2f4a3cb84f1f16a9a300454f52c072bd5f779 (patch) | |
| tree | c3e67263b7ced3ee6d474259f4016bd308137c96 | |
| parent | 7862310f04f40a9eb5aba0903c472b6656ec2a8f (diff) | |
| download | uxngba-main.tar.gz uxngba-main.zip | |
| -rw-r--r-- | Makefile | 15 | ||||
| -rw-r--r-- | README.md | 3 |
2 files changed, 9 insertions, 9 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. |
| @@ -37,9 +37,6 @@ parameter: | |||
| 37 | make run UXN_ROM=roms/noodle.rom | 37 | make run UXN_ROM=roms/noodle.rom |
| 38 | ``` | 38 | ``` |
| 39 | 39 | ||
| 40 | If you have compiled a rom already and want to change it, you probably want to | ||
| 41 | use `make clean` beforehand. | ||
| 42 | |||
| 43 | [devkitpro]: https://devkitpro.org/ | 40 | [devkitpro]: https://devkitpro.org/ |
| 44 | 41 | ||
| 45 | ## Configuration | 42 | ## Configuration |
