makefile to create .gba files
This commit is contained in:
parent
83f6ffab56
commit
eef96a70de
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -32,7 +32,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "gba-template"
|
||||
name = "lsdpack-player"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"build_const",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "gba-template"
|
||||
name = "lsdpack-player"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
|
37
Makefile
Normal file
37
Makefile
Normal file
|
@ -0,0 +1,37 @@
|
|||
export PATH := $(DEVKITARM)/bin:$(PATH)
|
||||
|
||||
PROJECT_NAME = lsdpack-player
|
||||
BUILD_TYPE := release
|
||||
# or debug
|
||||
|
||||
BUILD_ARG =
|
||||
ifeq ($(BUILD_TYPE),release)
|
||||
BUILD_ARG = --$(BUILD_TYPE)
|
||||
endif
|
||||
|
||||
CARGO_TARGET_PATH=target
|
||||
TARGET=armv4t-none-eabi
|
||||
ELF_OUTPUT=$(CARGO_TARGET_PATH)/$(TARGET)/$(BUILD_TYPE)/$(PROJECT_NAME)
|
||||
ROM_OUTPUT=$(CARGO_TARGET_PATH)/$(PROJECT_NAME)-$(BUILD_TYPE).gba
|
||||
EMU := mgba-qt -3 -C interframeBlending=1 --log-level 15
|
||||
|
||||
SOURCES=$(shell find src -name \*.rs)
|
||||
|
||||
all: $(ROM_OUTPUT)
|
||||
|
||||
test: $(ROM_OUTPUT)
|
||||
$(EMU) $(ROM_OUTPUT)
|
||||
|
||||
debug: $(ROM_OUTPUT)
|
||||
cp $(ELF_OUTPUT) $(ROM_OUTPUT).elf
|
||||
$(EMU) $(ROM_OUTPUT).elf
|
||||
|
||||
$(ELF_OUTPUT): $(SOURCES) Cargo.toml linker_scripts/mono_boot.ld
|
||||
cargo build $(BUILD_ARG)
|
||||
|
||||
$(ROM_OUTPUT): $(ELF_OUTPUT)
|
||||
arm-none-eabi-objcopy -O binary $(ELF_OUTPUT) $(ROM_OUTPUT)
|
||||
gbafix $(ROM_OUTPUT)
|
||||
|
||||
clean:
|
||||
cargo clean
|
Loading…
Reference in a new issue