-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 758 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 758 Bytes
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
emulator = mgba-qt -l 255
TARGET = $(shell cargo metadata --format-version=1 | sed -n 's/.*"target_directory":"\([^"]*\)".*/\1/p')
build_flags =
.DEFAULT_GOAL: check
.PHONY: check
check:
cargo clippy
# Force running cargo build (and waiting until completion)
# when executing the rule to produce release/gssa-rust.
# Otherwise, the next rule in pracitce does nothing
FORCE: ;
$(TARGET)/thumbv4t-none-eabi/release/gssa-rust: FORCE
cargo build --release $(build_flags)
build/gssa-rust.gba: $(TARGET)/thumbv4t-none-eabi/release/gssa-rust
mkdir build || true
arm-none-eabi-objcopy -O binary \
$(TARGET)/thumbv4t-none-eabi/release/gssa-rust \
build/gssa-rust.gba
gbafix build/gssa-rust.gba
run: build/gssa-rust.gba
$(emulator) build/gssa-rust.gba