From 77464858614f8e8929a1e2449ad5f7453ed4675e Mon Sep 17 00:00:00 2001 From: equation314 Date: Mon, 29 Oct 2018 19:14:54 +0800 Subject: [PATCH] aarch64: add target 'install' to Makefile --- kernel/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kernel/Makefile b/kernel/Makefile index 62dde62..de0ab82 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -153,3 +153,24 @@ endif $(user_obj): $(user_bins) @cd $(user_bin_path) && \ $(ld) -o $(abspath $@) $(patsubst %, -b binary %, $(notdir $(user_bins))) + + + +### install ### +ifeq ($(board), raspi3) +sd_card ?= + +ifeq ($(shell uname), Darwin) +sd_card := /Volumes/boot +else ifeq ($(shell uname), Linux) +sd_card := /media/$(shell whoami)/boot +endif + +ifdef sd_card +.PHONY: +install: $(bin) + cp $(bin) $(sd_card)/kernel8.img + sudo umount $(sd_card) +endif + +endif