加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 965 Bytes
一键复制 编辑 原始数据 按行查看 历史
richardchien 提交于 2022-02-28 03:52 . lab1
LAB := 1
V := @
PROJECT_DIR := .
BUILD_DIR := $(PROJECT_DIR)/build
KERNEL_IMG := $(BUILD_DIR)/kernel.img
QEMU := qemu-system-aarch64
_QEMU := $(PROJECT_DIR)/scripts/qemu/qemu_wrapper.sh $(QEMU)
QEMU_GDB_PORT := 1234
QEMU_OPTS := -machine raspi3b -nographic -serial null -serial mon:stdio -m size=1G -kernel $(KERNEL_IMG)
GDB := gdb-multiarch
CHBUILD := $(PROJECT_DIR)/chbuild
.PHONY: all
all: build
.PHONY: defconfig build clean distclean
defconfig:
$(V)$(CHBUILD) defconfig
build:
$(V)test -f $(PROJECT_DIR)/.config || $(CHBUILD) defconfig
$(V)$(CHBUILD) rebuild
clean:
$(V)$(CHBUILD) clean
distclean:
$(V)$(CHBUILD) distclean
.PHONY: qemu qemu-gdb gdb
qemu:
$(V)$(_QEMU) $(QEMU_OPTS)
qemu-gdb:
$(V)$(_QEMU) -S -gdb tcp::$(QEMU_GDB_PORT) $(QEMU_OPTS)
gdb:
$(V)gdb-multiarch -x $(PROJECT_DIR)/.gdbinit
.PHONY: grade
grade:
$(V)$(CHBUILD) distclean
$(V)$(CHBUILD) defconfig
$(V)$(CHBUILD) build
$(V)$(PROJECT_DIR)/scripts/grade/lab$(LAB).sh
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化