forked from lshw/loongson1-pmon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_ls1b_dev.sh
More file actions
executable file
·40 lines (33 loc) · 976 Bytes
/
build_ls1b_dev.sh
File metadata and controls
executable file
·40 lines (33 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#本脚本在debian5-debian9测试没有问题,i386和amd64都可以
if ! [ -x /opt/gcc-4.3-ls232 ] ; then
wget https://mirrors.ustc.edu.cn/loongson/loongson1c_bsp/gcc-4.3/gcc-4.3-ls232.tar.gz -c
tar zxvf gcc-4.3-ls232.tar.gz -C /opt
dpkg --add-architecture i386 #增加i386架构的libz.so.1 龙芯提供的交叉编译工具缺这个运行库
apt-get update
apt-get -y install zlib1g:i386
fi
PATH=/opt/gcc-4.3-ls232/bin:`pwd`/tools/pmoncfg:$PATH
#git pull
if ! [ "`which bison`" ] ;then
install=y
fi
if ! [ "`which make`" ] ;then
install=y
fi
if ! [ "`which flex`" ] ;then
install=y
fi
if ! [ "`which makedepend`" ] ;then
install=y
fi
if [ "$install" == "y" ] ; then
apt-get update
apt-get install -y make bison flex xutils-dev
fi
make pmontools
cd zloader.ls1b.dev
make cfg all tgt=rom CROSS_COMPILE=mipsel-linux- LANG=C
cp gzrom.bin ../pmon_ls1b_dev.bin
make cfg all tgt=ram CROSS_COMPILE=mipsel-linux- LANG=C
cp gzram ../gzram.ls1b_dev.bin