-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (19 loc) · 661 Bytes
/
makefile
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
28
29
30
31
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
LINKER_FILE = src/pi/link.ld
KERNEL_ELF = target/$(TARGET)/release/myPiOs
COMPILER_ARGS = --target=$(TARGET)
RUSTFLAGS = -C link-arg=$(LINKER_FILE) -C debuginfo=2
RUSTC_CMD = cargo rustc $(COMPILER_ARGS) --release
OBJCOPY_CMD = rust-objcopy --strip-all -O binary
OBJDUMP_CMD = rust-objdump -d --print-imm-hex
.PHONY: all $(KERNEL_BIN) $(KERNEL_ELF)
all: $(KERNEL_BIN)
$(KERNEL_ELF):
@RUSTFLAGS="$(RUSTFLAGS)" $(RUSTC_CMD)
$(KERNEL_BIN): $(KERNEL_ELF)
@$(OBJCOPY_CMD) $(KERNEL_ELF) $(KERNEL_BIN)
objdump:
@$(OBJDUMP_CMD) $(KERNEL_ELF)
install:
ttywrite -i $(KERNEL_BIN) /dev/$(USB)