Fix extra endif in Makefile

Signed-off-by: Harry Chen <i@harrychen.xyz>
master
Harry Chen 6 years ago
parent 34c3d139a1
commit c496dd5778

@ -42,17 +42,11 @@ 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
bootimage := $(build_path)/bootimage.bin bootimage := $(build_path)/bootimage.bin
dtb := src/arch/$(arch)/boot/dts/$(board).dtb
bootloader_dir = ../bootloader bootloader_dir = ../bootloader
bootloader := $(bootloader_dir)/target/$(target)/$(mode)/rcore-bootloader bootloader := $(bootloader_dir)/target/$(target)/$(mode)/rcore-bootloader
bbl_path := $(PWD)/../riscv-pk bbl_path := $(PWD)/../riscv-pk
user_dir := ../user user_dir := ../user
ifeq ($(arch), aarch64)
board := raspi3
ifeq ($(arch), mipsel)
board := malta
### export environments ### ### export environments ###
export ARCH = $(arch) export ARCH = $(arch)
@ -60,9 +54,17 @@ export BOARD = $(board)
export SMP = $(smp) export SMP = $(smp)
export DTB = $(dtb) export DTB = $(dtb)
export SFSIMG = $(user_dir)/build/$(arch).qcow2 export SFSIMG = $(user_dir)/build/$(arch).qcow2
ifeq ($(arch), aarch64)
board := raspi3
export SFSIMG = $(user_dir)/build/$(arch).img export SFSIMG = $(user_dir)/build/$(arch).img
else ifeq ($(arch), mipsel)
board := malta
endif endif
dtb := src/arch/$(arch)/boot/dts/$(board).dtb
### qemu options ### ### qemu options ###
qemu_opts := \ qemu_opts := \
-smp cores=$(smp) -smp cores=$(smp)
@ -108,7 +110,6 @@ qemu_opts += \
-machine $(board) \ -machine $(board) \
-serial null -serial mon:stdio \ -serial null -serial mon:stdio \
-kernel $(kernel_img) -kernel $(kernel_img)
endif
else ifeq ($(arch), mipsel) else ifeq ($(arch), mipsel)
qemu_opts += \ qemu_opts += \

@ -2,6 +2,7 @@ extern crate cc;
use std::fs::File; use std::fs::File;
use std::io::{Result, Write}; use std::io::{Result, Write};
use std::path::Path;
fn main() { fn main() {
println!("cargo:rerun-if-env-changed=LOG"); println!("cargo:rerun-if-env-changed=LOG");
@ -19,7 +20,7 @@ fn main() {
"riscv64" => { "riscv64" => {
} }
"mipsel" => { "mipsel" => {
gen_dtb_asm().unwrap(); gen_dtb_asm(&arch, &board).unwrap();
} }
"aarch64" => { "aarch64" => {
} }
@ -52,10 +53,8 @@ fn gen_vector_asm() -> Result<()> {
} }
fn gen_dtb_asm() -> Result<()> { fn gen_dtb_asm(arch: &String, board: &String) -> Result<()> {
let arch = std::env::var("ARCH").unwrap();
let dtb = std::env::var("DTB").unwrap(); let dtb = std::env::var("DTB").unwrap();
let board = std::env::var("BOARD").unwrap();
if !Path::new(&dtb).is_file() { if !Path::new(&dtb).is_file() {
panic!("DTB `{}` not found", dtb) panic!("DTB `{}` not found", dtb)

Loading…
Cancel
Save