# 编译脚本说明

1、编译的原则

```bash
   正对当前或指定目录下.bb文件编译
```

2、编译脚本名称及用法

```bash
名称：runbitbake.sh
参数: runbitbake.sh  <路径>  <开始序号>
<路径>: 默认当前路劲那个(.)
<开始序号> :默认1
```
3、编译产出结果说明

1)  result_YYYYMMDD_hh-mm-ss_report.txt (编译结果)
2)  bitbake_YYYYMMDD_hh-mm-ss_log.txt   (编译过程LOG)
生成的路径在<路径>下
 
`result_YYYYMMDD_hh-mm-ss_report.txt`内容如下：
```
#   软件包名						结果			deb数量		bb文件的路劲                       
1  	grub-bootconf                 	OK          	3         	meta/recipes-bsp/grub/grub-bootconf_1.00.bb
2  	grub-efi                      	NG          	0         	meta/recipes-bsp/grub/grub-efi_2.04.bb
3  	grub                          	NG          	0         	meta/recipes-bsp/grub/grub_2.04.bb
4  	acpid                         	OK          	5         	meta/recipes-bsp/acpid/acpid_2.0.32.bb
5  	usbutils                      	OK          	6         	meta/recipes-bsp/usbutils/usbutils_013.bb
......
```

`bitbake_YYYYMMDD_hh-mm-ss_log.txt`内容如下：
```
Build time:Thu Apr 29 12:39:28 CST 2021
Total number of files:[788]
Working directory:[/home/lqg/al_yocto/riscv_yocto/openembedded-core/meta/]
[1/788] = meta/recipes-bsp/grub/grub-bootconf_1.00.bb
[bitbake grub-bootconf]
#### make completed successfully
========= [grub-bootconf] deb file(3) =======
grub-bootconf-dev_1.00-r0_csky.deb
grub-bootconf_1.00-r0_csky.deb
grub-bootconf-dbg_1.00-r0_csky.deb
========= output end ==================
......

#############bitbake result:################
Total number of files:[788]
OK number of files:[623]
NG number of files:[165]
#############bitbake end####################
Detailed report results are as follows:
############################################
meta//result_20210429_12-39-28_report.txt
############################################
```

4.  编译例程(以oe-core为例)
1). /riscv_yocto/openembedded-core$ ./runbitbake.sh meta/
2). 通过以下命令实时观看编译过程
```bash
tail -f bitbake_YYYYMMDD_hh-mm-ss_log.txt
tail -f result_YYYYMMDD_hh-mm-ss_report.txt
```

