asagiri/Makefile

36 lines
875 B
Makefile

include toolchain.mk
.PHONY: all
all: $(IMAGE_NAME).img
.PHONY: run
run: $(IMAGE_NAME).img
qemu-system-aarch64 -M raspi3b -kernel $(IMAGE_NAME).img -serial null -serial stdio
uboot:
git clone https://github.com/u-boot/u-boot.git --branch=v2023.10 --depth=1 2>/dev/null | true
$(MAKE) -C u-boot rpi_3_defconfig ARCH=arm CROSS_COMPILE=aarch64-none-elf-
$(MAKE) -C u-boot all ARCH=arm CROSS_COMPILE=aarch64-none-elf-
.PHONY: hal
hal:
$(MAKE) -C arch/$(ARCH)
.PHONY: yukari
yukari:
$(MAKE) -C yukari
$(IMAGE_NAME).img: uboot hal libc yukari
./u-boot/tools/mkimage -A arm64 -C none -O linux -T kernel -d yukari/bin/yukari -a 0x100000 -e 0x100000 yukari.uimg
cat ./u-boot/u-boot.bin yukari.uimg > $(IMAGE_NAME).img
.PHONY: clean
clean:
$(MAKE) -C yukari clean
$(MAKE) -C arch/$(ARCH) clean
$(MAKE) -C libc clean
.PHONY: distclean
distclean: clean
rm -rf u-boot