Skip to content

Commit 0172a87

Browse files
committed
使用debian系统内置交叉编译系统, 进行编译的脚本
1 parent d2ed9e6 commit 0172a87

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
#本脚本用于编译龙芯1C的pmon
3+
#本脚本在debian5-debian12, 使用debian的 交叉编译工具 进行pmon编译
4+
#在win10的ubuntu子系统编译,也是可以的
5+
6+
if ! [ "$1" ] ; then
7+
echo $0 zloader.xxx
8+
exit
9+
fi
10+
dir=$1
11+
if ! [ -x $1 ] ; then
12+
dir="zloader.$1"
13+
if ! [ -x $dir ] ; then
14+
echo not find $dir
15+
exit
16+
fi
17+
fi
18+
if ! [ "`which mipsel-linux-gnu-gcc`" ] || ! [ -e /var/log/pmon_install.txt ] ;then
19+
apt-get update
20+
apt-get -y install gcc-mipsel-linux-gnu
21+
if ! [ "`which mipsel-linux-gnu-gcc`" ] ;then
22+
echo 没有找到gcc-mipsel-linux-gnu包
23+
exit
24+
fi
25+
apt-get -y install zlib1g make bison flex xutils-dev ccache
26+
date > /var/log/pmon_install.txt
27+
fi
28+
PATH=`pwd`/ccache:`pwd`/tools/pmoncfg:$PATH
29+
30+
if ! [ "`which pmoncfg`" ] ; then
31+
cd tools/pmoncfg
32+
make CPPFLAGS=-fcommon
33+
cd ../..
34+
fi
35+
36+
37+
38+
cd $dir
39+
make cfg all tgt=rom CROSS_COMPILE=mipsel-linux-gnu- LANG=C
40+
cp gzrom.bin ..

0 commit comments

Comments
 (0)