Skip to content

Commit

Permalink
combining makefile target for riscv64 image
Browse files Browse the repository at this point in the history
  • Loading branch information
elliott10 committed Sep 16, 2022
1 parent b08d291 commit 7be9f36
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Makefile for top level of zCore

ARCH ?= x86_64
XTASK ?= 1

.PHONY: help zircon-init update rootfs libc-test other-test image check doc clean

Expand All @@ -18,7 +19,13 @@ update:

# put rootfs for linux mode
rootfs:
ifeq ($(XTASK), 1)
cargo rootfs --arch $(ARCH)
else ifeq ($(ARCH), riscv64)
@rm -rf rootfs/riscv && mkdir -p rootfs/riscv/bin
@wget https://github.com/rcore-os/busybox-prebuilts/raw/master/busybox-1.30.1-riscv64/busybox -O rootfs/riscv/bin/busybox
@ln -s busybox rootfs/riscv/bin/ls
endif

# put libc tests into rootfs
libc-test:
Expand All @@ -30,22 +37,18 @@ other-test:

# build image from rootfs
image:
ifeq ($(XTASK), 1)
cargo image --arch $(ARCH)
else ifeq ($(ARCH), riscv64)
@echo building riscv.img
@rcore-fs-fuse zCore/riscv64.img rootfs/riscv zip
@qemu-img resize -f raw zCore/riscv64.img +5M
endif

# check code style
check:
cargo check-style

riscv-rootfs:
@rm -rf rootfs/riscv && mkdir -p rootfs/riscv/bin
@wget https://github.com/rcore-os/busybox-prebuilts/raw/master/busybox-1.30.1-riscv64/busybox -O rootfs/riscv/bin/busybox
@ln -s busybox rootfs/riscv/bin/ls

riscv-image: riscv-rootfs
@echo building riscv.img
@rcore-fs-fuse zCore/riscv64.img rootfs/riscv zip
@qemu-img resize -f raw zCore/riscv64.img +5M

# build and open project document
doc:
cargo doc --open
Expand Down

0 comments on commit 7be9f36

Please sign in to comment.