diff options
author | Bad Diode <bd@badd10de.dev> | 2023-08-30 11:09:34 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-08-30 11:09:34 +0200 |
commit | 6a01445ef315c60a5f40b842d24e1e0d34a5d070 (patch) | |
tree | 8c279272574cfe487392eceef43108b75776a36b /Makefile | |
parent | 033b0d78a5081e86fdfb70ca23fab627f8cf2ce0 (diff) | |
download | uxngba-6a01445ef315c60a5f40b842d24e1e0d34a5d070.tar.gz uxngba-6a01445ef315c60a5f40b842d24e1e0d34a5d070.zip |
Fix k mode instructions
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -15,8 +15,9 @@ LIBGBA += $(LIBGBA_DIR)/lib/libmm.a | |||
15 | SRC_DIR := src | 15 | SRC_DIR := src |
16 | BUILD_DIR := build | 16 | BUILD_DIR := build |
17 | SRC_MAIN := $(SRC_DIR)/main.c | 17 | SRC_MAIN := $(SRC_DIR)/main.c |
18 | ROM := $(BUILD_DIR)/rom.c | 18 | UXN_ROM := roms/dvd.rom |
19 | ROM_SRC := roms/dvd.rom | 19 | ROM_FILE := $(BUILD_DIR)/uxn.rom |
20 | ROM_OBJ := $(BUILD_DIR)/rom.o | ||
20 | ASM_FILES := $(wildcard $(SRC_DIR)/*.s) | 21 | ASM_FILES := $(wildcard $(SRC_DIR)/*.s) |
21 | WATCH_SRC := $(shell find $(SRC_DIR) -name *.c -or -name *.s -or -name *.h) | 22 | WATCH_SRC := $(shell find $(SRC_DIR) -name *.c -or -name *.s -or -name *.h) |
22 | INC_DIRS := $(shell find $(SRC_DIR) -type d) | 23 | INC_DIRS := $(shell find $(SRC_DIR) -type d) |
@@ -29,9 +30,6 @@ TARGET := uxngba | |||
29 | ELF := $(BUILD_DIR)/$(TARGET).elf | 30 | ELF := $(BUILD_DIR)/$(TARGET).elf |
30 | BIN := $(BUILD_DIR)/$(TARGET).gba | 31 | BIN := $(BUILD_DIR)/$(TARGET).gba |
31 | 32 | ||
32 | # Target tools. | ||
33 | TOOLS_BIN2CARR := tools/bin2carr/build/bin2carr | ||
34 | |||
35 | # Compiler and linker configuration. | 33 | # Compiler and linker configuration. |
36 | CC := $(DEVKITBIN)/arm-none-eabi-gcc | 34 | CC := $(DEVKITBIN)/arm-none-eabi-gcc |
37 | OBJCOPY := $(DEVKITBIN)/arm-none-eabi-objcopy | 35 | OBJCOPY := $(DEVKITBIN)/arm-none-eabi-objcopy |
@@ -63,7 +61,7 @@ endif | |||
63 | main: $(BUILD_DIR) $(ROM) $(BIN) | 61 | main: $(BUILD_DIR) $(ROM) $(BIN) |
64 | 62 | ||
65 | $(ROM): $(TOOLS_BIN2CARR) | 63 | $(ROM): $(TOOLS_BIN2CARR) |
66 | ./tools/bin2carr/build/bin2carr -n uxn_rom -e u8 -o $(ROM) $(ROM_SRC) | 64 | ./tools/bin2carr/build/bin2carr -n uxn_rom -e u8 -o $(ROM) $(UXN_ROM) |
67 | 65 | ||
68 | # Strip and fix header to create final .gba file. | 66 | # Strip and fix header to create final .gba file. |
69 | $(BIN): $(ELF) | 67 | $(BIN): $(ELF) |
@@ -71,8 +69,11 @@ $(BIN): $(ELF) | |||
71 | $(DEVKITTOOLS)/gbafix $(BIN) | 69 | $(DEVKITTOOLS)/gbafix $(BIN) |
72 | 70 | ||
73 | # Link files. | 71 | # Link files. |
74 | $(ELF): $(SRC_MAIN) $(WATCH_SRC) | 72 | $(ELF): $(SRC_MAIN) $(WATCH_SRC) | $(BUILD_DIR) |
75 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(ELF) $(SRC_MAIN) $(ASM_FILES) $(LDLIBS) | 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) | ||
76 | 77 | ||
77 | # Create build directory if needed. | 78 | # Create build directory if needed. |
78 | $(BUILD_DIR): | 79 | $(BUILD_DIR): |
@@ -85,6 +86,3 @@ run: main | |||
85 | # Remove build directory. | 86 | # Remove build directory. |
86 | clean: | 87 | clean: |
87 | rm -rf $(BUILD_DIR) | 88 | rm -rf $(BUILD_DIR) |
88 | |||
89 | $(TOOLS_BIN2CARR): | ||
90 | make -C tools/bin2carr | ||