Working on app data auto linking.
This commit is contained in:
parent
2c08dbfecb
commit
1943a50d0d
7 changed files with 62 additions and 18 deletions
17
user/Makefile
Normal file
17
user/Makefile
Normal file
|
@ -0,0 +1,17 @@
|
|||
TARGET := riscv64gc-unknown-none-elf
|
||||
MODE := release
|
||||
APP_DIR := src/bin
|
||||
TARGET_DIR := target/$(TARGET)/$(MODE)
|
||||
ELFS := $(patsubst $(APP_DIR)/*.rs, $(TARGET_DIR)/*, $(wildcard $(APP_DIR)/*.rs))
|
||||
BINS := $(patsubst $(APP_DIR)/*.rs, $(TARGET_DIR)/*.bin, $(wildcard $(APP_DIR)/*.rs))
|
||||
|
||||
OBJDUMP := rust-objdump --arch-name=riscv64
|
||||
OBJCOPY := rust-objcopy --binary-architecture=riscv64
|
||||
|
||||
elf:
|
||||
@cargo build --release
|
||||
|
||||
binary: elf
|
||||
$(foreach elf, $(ELFS), $(OBJCOPY) $(elf) --strip-all -O binary $(patsubst $(TARGET_DIR)/*, $(TARGET_DIR)/*.bin, $(elf)))
|
||||
|
||||
build: binary
|
Loading…
Add table
Add a link
Reference in a new issue