-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (31 loc) · 781 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
32
33
34
35
36
37
38
39
40
41
42
CARGO_FLAGS :=
ifeq ($(RELEASE),)
TYPE := debug
IMG := little-os-debug.img
else
TYPE := release
CARGO_FLAGS += "--release"
IMG := little-os.img
endif
ifneq ($(VERBOSE),)
CARGO_FLAGS += "-vv"
endif
ELF := ~/.cargo_target/aarch64-unknown-none-softfloat/$(TYPE)/kernel
run: $(IMG)
qemu-system-aarch64 -kernel $(IMG) -machine raspi3ap \
-serial stdio 2> /dev/null
debug: $(IMG)
qemu-system-aarch64 -kernel $(IMG) -machine raspi3ap \
-display none -serial stdio -s -S
monitor: $(IMG)
qemu-system-aarch64 -kernel $(IMG) -machine raspi3ap \
-display none -serial none -serial none -monitor stdio
$(IMG): $(ELF)
rust-objcopy -O binary --strip-all $(ELF) $(IMG)
$(ELF): FORCE
cargo build $(CARGO_FLAGS)
FORCE:
clean:
cargo clean
rm -f *.iso
.PHONY: run clean