编译Magenta

参考文档地址

https://github.com/fuchsia-mirror/magenta/blob/master/docs/getting_started.md



编译环境选择Ubuntu14.04

sudo apt-get update

sudo apt-get upgrade


安装必要的工具

sudo apt-get install texinfo libglib2.0-dev autoconf libtool libsdl-dev build-essential

sudo apt-get install git


建立一个代码的根目录使用$SRC代指

进入$SRC目录

下载代码

git clone https://fuchsia.googlesource.com/magenta

或者git clone https://github.com/fuchsia-mirror/magenta.git


进入magenta目录

执行脚本./scripts/download-toolchain下载google编好的工具链

下载需要保持网络畅通

Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/arm-eabi/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 41.6M  100 41.6M    0     0   240k      0  0:02:57  0:02:57 --:--:--  324k
Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/arm-eabi-Linux-x86_64.tar.bz2
Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/x86_64-elf/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 39.0M  100 39.0M    0     0   169k      0  0:03:56  0:03:56 --:--:--  176k
Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/x86_64-elf-Linux-x86_64.tar.bz2
Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/aarch64-elf/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 36.8M  100 36.8M    0     0   279k      0  0:02:14  0:02:14 --:--:--  372k
Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/aarch64-elf-Linux-x86_64.tar.bz2

看下脚本的说明

# This script is expected to be executed by Jiri as a runhook, or by individual
# developers who want to grab the latest prebuilts.  It takes no arguments, will
# download the latest version of the Magenta toolchain, install it in the
# prebuilt/downloads directory, and update prebuilt/config.mk with the toolchain
# prefix (so you shouldn't have to set PATH or anything yourself).

工具链安装在prebuild/downloads/目录下面

并且会配置在prebuilt/config.mk中


在magenta目录下执行make命令

编译的目标文件和镜像在build-magenta-pc-x86-64目录下

~/fuchsia/magenta/build-magenta-pc-x86-64$ ls
app   bootfs.img       config-buildid.h  config-kernel.h  dev     lib          magenta.elf         platform  rodso-stamp  target  top   ulib
arch  bootfs.manifest  config-global.h   config-user.h    kernel  magenta.bin  magenta.elf-gdb.py  rodso.ld  system       tools   uapp  utest



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值