mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-21 23:56:18 +04:00
uppercase arguments in Makefile
This commit is contained in:
parent
ab06b2cd55
commit
f66c8d29cd
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -58,4 +58,4 @@ jobs:
|
|||||||
- name: Download prebuilt user image
|
- name: Download prebuilt user image
|
||||||
run: cd user && make sfsimg arch=${{ matrix.arch }} prebuilt=1 && cd ..
|
run: cd user && make sfsimg arch=${{ matrix.arch }} prebuilt=1 && cd ..
|
||||||
- name: Build kernel
|
- name: Build kernel
|
||||||
run: cd kernel && make build arch=${{ matrix.arch }} && cd ..
|
run: cd kernel && make build ARCH=${{ matrix.arch }} && cd ..
|
||||||
|
@ -20,7 +20,6 @@ Supported architectures and boards:
|
|||||||
### Environment
|
### Environment
|
||||||
|
|
||||||
* [Rust](https://www.rust-lang.org) toolchain
|
* [Rust](https://www.rust-lang.org) toolchain
|
||||||
* Cargo tools: [cargo-binutils](https://github.com/rust-embedded/cargo-binutils)
|
|
||||||
* [QEMU](https://www.qemu.org) >= 4.1.0
|
* [QEMU](https://www.qemu.org) >= 4.1.0
|
||||||
* [musl-based GCC toolchains](https://musl.cc/) (only for building [user programs](https://github.com/rcore-os/rcore-user))
|
* [musl-based GCC toolchains](https://musl.cc/) (only for building [user programs](https://github.com/rcore-os/rcore-user))
|
||||||
|
|
||||||
@ -41,11 +40,13 @@ $ docker run -it -v $PWD:$PWD -w $PWD wangrunji0408/rcore
|
|||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/rcore-os/rCore.git --recursive
|
$ git clone https://github.com/rcore-os/rCore.git --recursive
|
||||||
$ cd rCore/user
|
$ cd rCore/user
|
||||||
$ make sfsimg prebuilt=1 arch={riscv32,riscv64,x86_64,aarch64,mipsel}
|
$ make sfsimg prebuilt=1 arch=x86_64
|
||||||
$ cd ../kernel
|
$ cd ../kernel
|
||||||
$ make run arch={riscv32,riscv64,x86_64,aarch64,mipsel}
|
$ make run ARCH=x86_64 LOG=info
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See [Makefile](kernel/Makefile) for more usages.
|
||||||
|
|
||||||
## Maintainers
|
## Maintainers
|
||||||
|
|
||||||
| Module | Maintainer |
|
| Module | Maintainer |
|
||||||
|
@ -20,6 +20,7 @@ authors = [
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
board_qemu = []
|
||||||
board_u540 = ["link_user"]
|
board_u540 = ["link_user"]
|
||||||
board_k210 = ["link_user"]
|
board_k210 = ["link_user"]
|
||||||
board_rocket_chip = ["link_user"]
|
board_rocket_chip = ["link_user"]
|
||||||
|
199
kernel/Makefile
199
kernel/Makefile
@ -11,37 +11,37 @@
|
|||||||
# make clean Clean
|
# make clean Clean
|
||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# arch = x86_64 | riscv32 | riscv64 | aarch64 | mipsel
|
# ARCH = x86_64 | riscv32 | riscv64 | aarch64 | mipsel
|
||||||
# d = int | in_asm | ... QEMU debug info
|
# D = int | in_asm | ... QEMU debug info
|
||||||
# mode = debug | release
|
# MODE = debug | release
|
||||||
# LOG = off | error | warn | info | debug | trace
|
# LOG = off | error | warn | info | debug | trace
|
||||||
# USER_IMG = <sfsimg> image path of user programs
|
# USER_IMG = <sfsimg> Image path of user programs
|
||||||
# smp = 1 | 2 | ... SMP core number
|
# SMP = 1 | 2 | ... SMP core number
|
||||||
# graphic = on | off | console Enable/disable qemu graphical output, or print console to graphic output
|
# GRAPHIC = on | off | console Enable/disable qemu graphical output, or print console to graphic output
|
||||||
# board = none Running on QEMU
|
# BOARD = qemu Run on QEMU
|
||||||
# | pc Only available on x86_64, run on real pc
|
# | pc [ x86_64 only] Run on real pc
|
||||||
# | u540 Only available on riscv64, run on HiFive U540, use Sv39
|
# | u540 [riscv64 only] Run on HiFive U540, use Sv39
|
||||||
# | k210 Only available on riscv64, run on K210, use Sv39
|
# | k210 [riscv64 only] Run on K210, use Sv39
|
||||||
# | rocket_chip Only available on riscv64, run on Rocket Chip, use Sv39
|
# | rocket_chip [riscv64 only] Run on Rocket Chip, use Sv39
|
||||||
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
|
# | raspi3 [aarch64 only] Run on Raspberry Pi 3 Model B/B+
|
||||||
# net = on | off Only available on x86_64, enable NIC
|
# NET = on | off [ x86_64 only] Enable NIC
|
||||||
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
|
# PCI_PASSTHRU = 0000:00:00.1 [ x86_64 only] Passthrough the specified PCI device
|
||||||
# init = /bin/ls Only available on riscv64, run specified program instead of user shell
|
# INIT = /bin/ls [riscv64 only] Run specified program instead of user shell
|
||||||
# extra_nic = on | off Only available on x86_64, add an additional e1000 nic
|
# EXTRA_NIC = on | off [ x86_64 only] Add an additional e1000 nic
|
||||||
# . extra_features = profile | ... Add additional features
|
# FEATURES = profile | ... Add additional features
|
||||||
|
|
||||||
arch ?= riscv64
|
ARCH ?= riscv64
|
||||||
mode ?= release
|
MODE ?= release
|
||||||
LOG ?=
|
LOG ?=
|
||||||
graphic ?= off
|
GRAPHIC ?= off
|
||||||
smp ?= 4
|
SMP ?= 4
|
||||||
pci_passthru ?=
|
PCI_PASSTHRU ?=
|
||||||
init ?=
|
INIT ?=
|
||||||
extra_nic ?= off
|
EXTRA_NIC ?= off
|
||||||
|
|
||||||
qemu := qemu-system-$(arch)
|
qemu := qemu-system-$(ARCH)
|
||||||
target := $(arch)
|
target := $(ARCH)
|
||||||
build_path := target/$(target)/$(mode)
|
build_path := target/$(target)/$(MODE)
|
||||||
kernel := $(build_path)/rcore
|
kernel := $(build_path)/rcore
|
||||||
kernel_img := $(build_path)/kernel.img
|
kernel_img := $(build_path)/kernel.img
|
||||||
ESP := $(build_path)/esp
|
ESP := $(build_path)/esp
|
||||||
@ -51,55 +51,49 @@ user_dir := ../user
|
|||||||
|
|
||||||
### export environments ###
|
### export environments ###
|
||||||
|
|
||||||
export USER_IMG = $(user_dir)/build/$(arch).img
|
export USER_IMG = $(user_dir)/build/$(ARCH).img
|
||||||
export USER_QCOW2 = $(user_dir)/build/$(arch).qcow2
|
export USER_QCOW2 = $(user_dir)/build/$(ARCH).qcow2
|
||||||
|
|
||||||
ifeq ($(arch), aarch64)
|
ifeq ($(ARCH), aarch64)
|
||||||
board ?= raspi3
|
BOARD ?= raspi3
|
||||||
else ifeq ($(arch), mipsel)
|
else ifeq ($(ARCH), mipsel)
|
||||||
board ?= malta
|
BOARD ?= malta
|
||||||
else
|
else
|
||||||
board ?= none
|
BOARD ?= qemu
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# currently only mipsel architecture and rocket-chip need DTB linked to the kernel
|
# currently only mipsel architecture and rocket-chip need DTB linked to the kernel
|
||||||
ifeq ($(arch), mipsel)
|
ifeq ($(ARCH), mipsel)
|
||||||
dtb := src/arch/$(arch)/board/$(board)/device.dtb
|
DTB := src/arch/$(ARCH)/board/$(BOARD)/device.dtb
|
||||||
endif
|
endif
|
||||||
ifeq ($(board), rocket_chip)
|
ifeq ($(BOARD), rocket_chip)
|
||||||
dtb := src/arch/riscv/board/$(board)/device.dtb
|
DTB := src/arch/riscv/board/$(BOARD)/device.dtb
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# mipssim does not support SMP
|
# mipssim does not support SMP
|
||||||
ifeq ($(board), mipssim)
|
ifeq ($(BOARD), mipssim)
|
||||||
smp := 1
|
SMP := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export ARCH = $(arch)
|
|
||||||
export BOARD = $(board)
|
|
||||||
export SMP = $(smp)
|
|
||||||
export DTB = $(dtb)
|
|
||||||
|
|
||||||
|
|
||||||
### qemu options ###
|
### qemu options ###
|
||||||
qemu_opts := \
|
qemu_opts := \
|
||||||
-smp cores=$(smp)
|
-smp cores=$(SMP)
|
||||||
qemu_net_opts :=
|
qemu_net_opts :=
|
||||||
|
|
||||||
ifeq ($(arch), x86_64)
|
ifeq ($(ARCH), x86_64)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-bios $(OVMF) \
|
-bios $(OVMF) \
|
||||||
-drive format=raw,file=fat:rw:$(ESP) \
|
-drive format=raw,file=fat:rw:$(ESP) \
|
||||||
-serial mon:stdio \
|
-serial mon:stdio \
|
||||||
-m 4G \
|
-m 4G \
|
||||||
-device isa-debug-exit
|
-device isa-debug-exit
|
||||||
ifeq ($(board), none)
|
ifeq ($(BOARD), qemu)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-drive format=qcow2,file=$(USER_QCOW2),media=disk,cache=writeback,id=sfsimg,if=none \
|
-drive format=qcow2,file=$(USER_QCOW2),media=disk,cache=writeback,id=sfsimg,if=none \
|
||||||
-device ahci,id=ahci0 \
|
-device ahci,id=ahci0 \
|
||||||
-device ide-drive,drive=sfsimg,bus=ahci0.0
|
-device ide-drive,drive=sfsimg,bus=ahci0.0
|
||||||
endif
|
endif
|
||||||
ifeq ($(pci_passthru), )
|
ifeq ($(PCI_PASSTHRU), )
|
||||||
qemu_net_opts += \
|
qemu_net_opts += \
|
||||||
-netdev type=tap,id=net0,script=no,downscript=no \
|
-netdev type=tap,id=net0,script=no,downscript=no \
|
||||||
-device e1000e,netdev=net0
|
-device e1000e,netdev=net0
|
||||||
@ -107,17 +101,17 @@ else
|
|||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine accel=kvm
|
-machine accel=kvm
|
||||||
qemu_net_opts += \
|
qemu_net_opts += \
|
||||||
-device vfio-pci,host=$(pci_passthru)
|
-device vfio-pci,host=$(PCI_PASSTHRU)
|
||||||
qemu_ui_opts += \
|
qemu_ui_opts += \
|
||||||
-vga std
|
-vga std
|
||||||
endif
|
endif
|
||||||
ifeq ($(extra_nic), on)
|
ifeq ($(EXTRA_NIC), on)
|
||||||
qemu_net_opts += \
|
qemu_net_opts += \
|
||||||
-netdev type=tap,id=net1,script=no,downscript=no \
|
-netdev type=tap,id=net1,script=no,downscript=no \
|
||||||
-device e1000e,netdev=net1
|
-device e1000e,netdev=net1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else ifeq ($(arch), riscv32)
|
else ifeq ($(ARCH), riscv32)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine virt \
|
-machine virt \
|
||||||
-serial mon:stdio \
|
-serial mon:stdio \
|
||||||
@ -131,8 +125,8 @@ qemu_net_opts += \
|
|||||||
-netdev type=tap,id=net0,script=no,downscript=no \
|
-netdev type=tap,id=net0,script=no,downscript=no \
|
||||||
-device virtio-net-device,netdev=net0
|
-device virtio-net-device,netdev=net0
|
||||||
|
|
||||||
else ifeq ($(arch), riscv64)
|
else ifeq ($(ARCH), riscv64)
|
||||||
ifeq ($(board), u540)
|
ifeq ($(BOARD), u540)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine virt \
|
-machine virt \
|
||||||
-serial mon:stdio \
|
-serial mon:stdio \
|
||||||
@ -153,79 +147,78 @@ qemu_net_opts += \
|
|||||||
-netdev type=tap,id=net0,script=no,downscript=no \
|
-netdev type=tap,id=net0,script=no,downscript=no \
|
||||||
-device virtio-net-device,netdev=net0
|
-device virtio-net-device,netdev=net0
|
||||||
|
|
||||||
else ifeq ($(arch), aarch64)
|
else ifeq ($(ARCH), aarch64)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine $(board) \
|
-machine $(BOARD) \
|
||||||
-smp 4 \
|
-smp 4 \
|
||||||
-serial null -serial mon:stdio \
|
-serial null -serial mon:stdio \
|
||||||
-kernel $(kernel_img) \
|
-kernel $(kernel_img) \
|
||||||
-drive file=$(USER_QCOW2),format=qcow2,id=sfs
|
-drive file=$(USER_QCOW2),format=qcow2,id=sfs
|
||||||
|
|
||||||
else ifeq ($(arch), mipsel)
|
else ifeq ($(ARCH), mipsel)
|
||||||
ifeq ($(board), malta)
|
ifeq ($(BOARD), malta)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine $(board) -device VGA \
|
-machine $(BOARD) -device VGA \
|
||||||
-serial null -serial null -serial mon:stdio \
|
-serial null -serial null -serial mon:stdio \
|
||||||
-kernel $(kernel_img)
|
-kernel $(kernel_img)
|
||||||
endif
|
endif
|
||||||
ifeq ($(board), mipssim)
|
ifeq ($(BOARD), mipssim)
|
||||||
qemu_opts += \
|
qemu_opts += \
|
||||||
-machine $(board) \
|
-machine $(BOARD) \
|
||||||
-serial mon:stdio \
|
-serial mon:stdio \
|
||||||
-kernel $(kernel_img)
|
-kernel $(kernel_img)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef d
|
ifdef D
|
||||||
qemu_opts += -d $(d)
|
qemu_opts += -d $(D)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(graphic), off)
|
ifeq ($(GRAPHIC), off)
|
||||||
qemu_opts += -nographic
|
qemu_opts += -nographic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(net), on)
|
ifeq ($(NET), on)
|
||||||
qemu_opts += $(qemu_net_opts)
|
qemu_opts += $(qemu_net_opts)
|
||||||
qemu := sudo $(qemu)
|
qemu := sudo $(qemu)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### build args ###
|
### build args ###
|
||||||
ifeq ($(graphic), off)
|
ifeq ($(GRAPHIC), off)
|
||||||
features += nographic
|
FEATURES += nographic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(graphic), console)
|
ifeq ($(GRAPHIC), console)
|
||||||
features += consolegraphic
|
FEATURES += consolegraphic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(init), )
|
ifneq ($(INIT), )
|
||||||
features += run_cmdline
|
FEATURES += run_cmdline
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(board), none)
|
FEATURES += board_$(BOARD)
|
||||||
features += board_$(board)
|
|
||||||
endif
|
|
||||||
|
|
||||||
features += $(extra_features)
|
build_args := \
|
||||||
|
-Z build-std=core,alloc \
|
||||||
|
--target targets/$(target).json \
|
||||||
|
--features "$(FEATURES)"
|
||||||
|
|
||||||
build_args := -Z build-std=core,alloc --target targets/$(target).json --features "$(features)"
|
ifeq ($(MODE), release)
|
||||||
|
|
||||||
ifeq ($(mode), release)
|
|
||||||
build_args += --release
|
build_args += --release
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### prefix ###
|
### prefix ###
|
||||||
ifeq ($(arch), x86_64)
|
ifeq ($(ARCH), x86_64)
|
||||||
ifeq ($(uname), Darwin)
|
ifeq ($(shell uname), Darwin)
|
||||||
prefix := x86_64-linux-musl-
|
prefix := x86_64-linux-musl-
|
||||||
endif
|
endif
|
||||||
else ifeq ($(arch), riscv32)
|
else ifeq ($(ARCH), riscv32)
|
||||||
prefix := riscv64-linux-musl-
|
prefix := riscv64-linux-musl-
|
||||||
else ifeq ($(arch), riscv64)
|
else ifeq ($(ARCH), riscv64)
|
||||||
prefix := riscv64-linux-musl-
|
prefix := riscv64-linux-musl-
|
||||||
else ifeq ($(arch), mipsel)
|
else ifeq ($(ARCH), mipsel)
|
||||||
prefix ?= mipsel-linux-musln32-
|
prefix ?= mipsel-linux-musln32-
|
||||||
else ifeq ($(arch), aarch64)
|
else ifeq ($(ARCH), aarch64)
|
||||||
prefix ?= aarch64-linux-musl-
|
prefix ?= aarch64-linux-musl-
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -256,7 +249,7 @@ justrun:
|
|||||||
|
|
||||||
justtest:
|
justtest:
|
||||||
# unavailable now
|
# unavailable now
|
||||||
@#$(qemu) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
|
@#$(qemu) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(INIT) -serial file:../tests/stdout -monitor null
|
||||||
|
|
||||||
debug: $(kernel) $(kernel_img)
|
debug: $(kernel) $(kernel_img)
|
||||||
@$(qemu) $(qemu_opts) -s -S &
|
@$(qemu) $(qemu_opts) -s -S &
|
||||||
@ -284,31 +277,31 @@ sym:
|
|||||||
### bootloader and kernel image ###
|
### bootloader and kernel image ###
|
||||||
|
|
||||||
bootloader: $(kernel)
|
bootloader: $(kernel)
|
||||||
ifeq ($(arch), x86_64)
|
ifeq ($(ARCH), x86_64)
|
||||||
@cd ../rboot && make build
|
@cd ../rboot && make build
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(kernel_img): kernel bootloader
|
$(kernel_img): kernel bootloader
|
||||||
ifeq ($(arch), x86_64)
|
ifeq ($(ARCH), x86_64)
|
||||||
@mkdir -p $(ESP)/EFI/rCore $(ESP)/EFI/Boot
|
@mkdir -p $(ESP)/EFI/rCore $(ESP)/EFI/Boot
|
||||||
@cp ../rboot/target/x86_64-unknown-uefi/release/rboot.efi $(ESP)/EFI/Boot/BootX64.efi
|
@cp ../rboot/target/x86_64-unknown-uefi/release/rboot.efi $(ESP)/EFI/Boot/BootX64.efi
|
||||||
@cp ../rboot/rboot.conf $(ESP)/EFI/Boot/rboot.conf
|
@cp ../rboot/rboot.conf $(ESP)/EFI/Boot/rboot.conf
|
||||||
@cp $(kernel) $(ESP)/EFI/rCore/kernel.elf
|
@cp $(kernel) $(ESP)/EFI/rCore/kernel.elf
|
||||||
else ifeq ($(arch), $(filter $(arch), riscv32 riscv64))
|
else ifeq ($(ARCH), $(filter $(ARCH), riscv32 riscv64))
|
||||||
@$(objcopy) $(kernel) --strip-all -O binary $@
|
@$(objcopy) $(kernel) --strip-all -O binary $@
|
||||||
else ifeq ($(arch), aarch64)
|
else ifeq ($(ARCH), aarch64)
|
||||||
@$(objcopy) $(kernel) --strip-all -O binary $@
|
@$(objcopy) $(kernel) --strip-all -O binary $@
|
||||||
else ifeq ($(arch), mipsel)
|
else ifeq ($(ARCH), mipsel)
|
||||||
# qemu-system-mipsel accepts ELF file only, so objcopy is not needed
|
# qemu-system-mipsel accepts ELF file only, so objcopy is not needed
|
||||||
@$(strip) $(kernel) -o $@
|
@$(strip) $(kernel) -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
kernel: $(dtb)
|
kernel: $(DTB)
|
||||||
@echo Building $(arch) kernel
|
@echo Building $(ARCH) kernel
|
||||||
ifeq ($(arch), $(filter $(arch), riscv32 riscv64))
|
ifeq ($(ARCH), $(filter $(ARCH), riscv32 riscv64))
|
||||||
ifeq ($(board), k210)
|
ifeq ($(BOARD), k210)
|
||||||
@cp src/arch/riscv/board/k210/linker.ld src/arch/riscv/boot/linker64.ld
|
@cp src/arch/riscv/board/k210/linker.ld src/arch/riscv/boot/linker64.ld
|
||||||
else ifeq ($(board), rocket_chip)
|
else ifeq ($(BOARD), rocket_chip)
|
||||||
@cp src/arch/riscv/board/rocket_chip/linker.ld src/arch/riscv/boot/linker64.ld
|
@cp src/arch/riscv/board/rocket_chip/linker.ld src/arch/riscv/boot/linker64.ld
|
||||||
else
|
else
|
||||||
@cp src/arch/riscv/board/u540/linker.ld src/arch/riscv/boot/linker64.ld
|
@cp src/arch/riscv/board/u540/linker.ld src/arch/riscv/boot/linker64.ld
|
||||||
@ -316,11 +309,11 @@ endif
|
|||||||
@-patch -p0 -N -b \
|
@-patch -p0 -N -b \
|
||||||
$(sysroot)/lib/rustlib/src/rust/src/libcore/sync/atomic.rs \
|
$(sysroot)/lib/rustlib/src/rust/src/libcore/sync/atomic.rs \
|
||||||
src/arch/riscv/atomic.patch
|
src/arch/riscv/atomic.patch
|
||||||
else ifeq ($(arch), mipsel)
|
else ifeq ($(ARCH), mipsel)
|
||||||
@for file in context entry trap ; do \
|
@for file in context entry trap ; do \
|
||||||
$(hostcc) -Dboard_$(board) -E src/arch/$(arch)/boot/$${file}.S -o src/arch/$(arch)/boot/$${file}.gen.s ; \
|
$(hostcc) -Dboard_$(BOARD) -E src/arch/$(ARCH)/boot/$${file}.S -o src/arch/$(ARCH)/boot/$${file}.gen.s ; \
|
||||||
done
|
done
|
||||||
$(hostcc) -Dboard_$(board) -E src/arch/$(arch)/boot/linker.ld.S -o src/arch/$(arch)/boot/linker.ld
|
$(hostcc) -Dboard_$(BOARD) -E src/arch/$(ARCH)/boot/linker.ld.S -o src/arch/$(ARCH)/boot/linker.ld
|
||||||
endif
|
endif
|
||||||
@cargo build $(build_args)
|
@cargo build $(build_args)
|
||||||
|
|
||||||
@ -331,7 +324,7 @@ sfsimg:
|
|||||||
|
|
||||||
|
|
||||||
### install ###
|
### install ###
|
||||||
ifeq ($(board), raspi3)
|
ifeq ($(BOARD), raspi3)
|
||||||
sd_card ?=
|
sd_card ?=
|
||||||
|
|
||||||
ifeq ($(shell uname), Darwin)
|
ifeq ($(shell uname), Darwin)
|
||||||
@ -349,7 +342,7 @@ endif
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(board), u540)
|
ifeq ($(BOARD), u540)
|
||||||
.PHONY:
|
.PHONY:
|
||||||
install: $(kernel_img)
|
install: $(kernel_img)
|
||||||
@$(objcopy) -S -O binary ../tools/opensbi/fu540.elf $(build_path)/bin
|
@$(objcopy) -S -O binary ../tools/opensbi/fu540.elf $(build_path)/bin
|
||||||
@ -357,7 +350,7 @@ install: $(kernel_img)
|
|||||||
@../tools/u540/mkimg.sh $(build_path)/bin $(build_path)/u540.img
|
@../tools/u540/mkimg.sh $(build_path)/bin $(build_path)/u540.img
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(board), k210)
|
ifeq ($(BOARD), k210)
|
||||||
.PHONY:
|
.PHONY:
|
||||||
install: $(kernel_img)
|
install: $(kernel_img)
|
||||||
@$(objcopy) -S -O binary ../tools/opensbi/k210.elf $(build_path)/k210.img
|
@$(objcopy) -S -O binary ../tools/opensbi/k210.elf $(build_path)/k210.img
|
||||||
@ -367,4 +360,4 @@ endif
|
|||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
addr2line:
|
addr2line:
|
||||||
@python3.7 ../tools/addr2line.py $(prefix)addr2line $(arch) $(mode)
|
@python3.7 ../tools/addr2line.py $(prefix)addr2line $(ARCH) $(MODE)
|
||||||
|
@ -10,7 +10,6 @@ fn main() {
|
|||||||
println!("cargo:rerun-if-env-changed=USER_IMG");
|
println!("cargo:rerun-if-env-changed=USER_IMG");
|
||||||
|
|
||||||
let arch: String = std::env::var("ARCH").unwrap();
|
let arch: String = std::env::var("ARCH").unwrap();
|
||||||
let _board: String = std::env::var("BOARD").unwrap();
|
|
||||||
if let Ok(user_img) = std::env::var("USER_IMG") {
|
if let Ok(user_img) = std::env::var("USER_IMG") {
|
||||||
println!("cargo:rerun-if-changed={}", user_img);
|
println!("cargo:rerun-if-changed={}", user_img);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user