-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 1.05 KB
/
Makefile
File metadata and controls
39 lines (28 loc) · 1.05 KB
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
TOOLCHAIN_PREFIX = aarch64-linux-gnu-
CC = $(TOOLCHAIN_PREFIX)gcc
LD = $(TOOLCHAIN_PREFIX)ld
OBJCPY = $(TOOLCHAIN_PREFIX)objcopy
CFLAGS = -mcpu=cortex-a53+crc -Wall -c -ffreestanding -O0 -nostdinc -nostdlib -nostartfiles
CFLAGS += -g
CFLAGS += -I .
GIT_HOOKS := ./git/hooks/applied
include kernel/Makefile
.PHONY: all clean asm run debug directories
all: $(GIT_HOOKS) kernel8.img disk.img
disk.img:
zstd --decompress disk.img.zst
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
asm: all
qemu-system-aarch64 -M raspi3b -kernel kernel8.img -serial pty -drive if=sd,file=disk.img,format=raw,cache=writeback -monitor stdio -d in_asm
run: all
qemu-system-aarch64 -M raspi3b -kernel kernel8.img -serial pty -drive if=sd,file=disk.img,format=raw,cache=writeback -monitor stdio
debug: all
qemu-system-aarch64 -M raspi3b -kernel kernel8.img -serial pty -drive if=sd,file=disk.img,format=raw,cache=writeback -monitor stdio -S -s
clean:
rm -rf kernel8.*
rm -rf kernel/*.o kernel/*.elf
rm -rf lib/*.o
rm -rf user/*.o user/*.elf user/*.bin user/*.img
rm -rf *.img