ngswfx

ngswfx

2个粉丝

55

问答

1

专栏

40

资料

ngswfx  发布于  2017-12-12 06:29:56
采纳率 0%
55个问答
5228

愚昧之重大发现-嵌入式Eclipse项目命令行整体编译

 
本帖最后由 ngswfx 于 2017-12-12 21:33 编辑

先说我遇到的问题,由于习惯了IDE编程,所以介入嵌入式编程以来,一直是使用eclipse c++,以前使用vc6编程时,整个项目很大,有几十个工程文件,vc6也支持批处理,常见的打包程序,都支持批处理动作,可以很好的输入一个命令就去上厕所或者休息了,等回来,就可以直接测试打包好的最终程序了,而且我这边当时做的是直接产生光盘目录

到了eclipse这里,以及QT这里遇到麻烦了,网上搜索了快一年了,都没有找到解决方法,说的不明不白。

其实我要干的事情,就是代码修改完成,简单测试某个库后,一个动作命令,产生最后的U盘升级包,或者flash镜像文件,由于系统牵扯好几个海思芯片,例如3520D,3535,3536,3536c,3798M,编译器不同,为此,如果自己折腾makefile,自己没掌握,牵扯的东西太多,项目也很庞大,也没时间学习具体细节了,再来折腾了

为此每次都需要将近期修改了代码的某个.so工程,或者执行程序工程,在eclipse里面,点击项目编译,然后由于有编译后批处理install.sh协助,会自动编译出so文件,并且拷贝到相应目录,如果界面有修改,就到QTCreator当中去编译界面的工程,这些动作做完了,我写过一个打包各个板卡芯片的批处理,最后可以自动产生升级程序。但毕竟中间还需要跑到eclipse中编译项目,而且麻烦的是由于芯片很多,有时候为了防止漏编译,每个芯片都要进行一次,避免某个芯片没有编译,程序不匹配,导致最后板卡烧写测试才能发现问题。

今天突然发现eclipse里面编译时,就是个make -j4 clean 以及make -j4 all,我就到Release目录下试了一下,先clean再make all,还真有动作,现在想想,eclipse其实产生的这个makefile就是标准的,可以直接用的,害得我,这么久都是手动动作。


////////////////批处理内容简单如下

#!/bin/sh

export PATH=PATH:/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/target/bin:/opt/hisi-linux-nptl/arm-hisiv100-linux/target/bin:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/lib:/opt/hisi-linux/x86-arm/arm-hisiv100-linux/target/bin:/opt/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin:/opt/hisi-linux-nptl/arm-hisiv300-linux/bin:/opt/hisi-linux-nptl/arm-hisiv400-linux/bin:/opt/hisi-linux/x86-arm/arm-hisiv400-linux/target/bin:/usr/lib/x86_64-linux-gnu:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/arm-hisiv300-linux-uclibcgnueabi/lib:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/arm-hisiv300-linux-uclibcgnueabi/lib/a9_soft:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/lib:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/target/lib:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/lib:/opt/hisi-linux/x86-arm/arm-hisiv400-linux/target/bin:/opt/hisi-linux/x86-arm/arm-hisiv400-linux/lib:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/arm-hisiv300-linux-uclibcgnueabi/lib:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/arm-hisiv300-linux-uclibcgnueabi/bin:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/arm-hisiv300-linux-uclibcgnueabi/lib:/opt/hisi-linux/x86-arm/arm-hisiv500-linux/arm-hisiv500-linux-uclibcgnueabi/bin:/opt/hisi-linux/x86-arm/arm-hisiv500-linux/arm-hisiv500-linux-uclibcgnueabi/lib:/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/bin


cd /home/ngs
sudo chmod -R 777 /home/ngs/workspace

#####################################HIRtc
###注意这里,虽然是一个工程HIRtc,但有好几个配置,每种配置都会有一个目录,如果你也是用的eclipse,打开目录一看就清楚了,只要eclipse里面编译各个项目正常,这里就是正常的
cd /home/ngs/workspace/HIRtc/Release
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HIRtc/release_3516A
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HIRtc/release_3535
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HIRtc/release_3536C
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HIRtc/releaseV200
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HIRtc/releaseV300
make -j4 clean
make -j4 all

#############################################IVHISetIP

cd /home/ngs/workspace/IVHISetIP/Release
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHISetIP/release_3516A
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHISetIP/release_3535
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHISetIP/release_3536
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHISetIP/release_3536C
make -j4 clean
make -j4 all

cd /home/ngs/workspace/IVHISetIP/releaseV200
make -j4 clean
make -j4 all


####################################IVComInfSDK
cd /home/ngs/workspace/IVComInfSDK/Release
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVComInfSDK/release_3516A
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVComInfSDK/release_3535
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVComInfSDK/release_3536
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVComInfSDK/release_3536C
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVComInfSDK/release_3798M
make -j4 clean
make -j4 all

#############################################IVHIComDataSDK
cd /home/ngs/workspace/IVHIComDataSDK/Release
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHIComDataSDK/release_3535
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHIComDataSDK/release_3536
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHIComDataSDK/release_3536C
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHIComDataSDK/release_3798M
make -j4 clean
make -j4 all
cd /home/ngs/workspace/IVHIComDataSDK/release_3516A
make -j4 clean
make -j4 all
#############################################HSMPISDK_3516D
cd /home/ngs/workspace/HSMPISDK_3516D/Release
make -j4 clean
make -j4 all
#############################################HSMPISDK_3520D
cd /home/ngs/workspace/HSMPISDK_3520D/Release
make -j4 clean
make -j4 all
cd /home/ngs/workspace/HSMPISDK_3520D/release_MINI
make -j4 clean
make -j4 all

#############################################HSMPISDK_3535
cd /home/ngs/workspace/HSMPISDK_3535/Release
make -j4 clean
make -j4 all



#############################################HSMPISDK_3536

cd /home/ngs/workspace/HSMPISDK_3536/Release
make -j4 clean
make -j4 all



#############################################HSMPISDK_3536C

cd /home/ngs/workspace/HSMPISDK_3536C/Release
make -j4 clean
make -j4 all


#############################################HSMPISDKEx_3798M

cd /home/ngs/workspace/HSMPISDKEx_3798M/Release
make -j4 clean
make -j4 all




/////////////////////////////////////////////////////////////////////////

//后面很多,省略

qt的工程也是一样:

#############################################IVHITvWallCtrl
cd /home/ngs/workspace/IVHITvWallCtrl
make -j4 clean
sudo /home/ngs/QT/QT4.86_3798M/bin/qmake /home/ngs/workspace/IVHITvWallCtrl/IVHITvWallCtrl.pro -r -spec qws/linux-hisi3798M-g++ CONFIG+=3798M
make -j4
sudo chmod -R 777 /home/ngs/workspace/IVHITvWallCtrl/IVHITvWallCtrl
echo "ngs" |sudo -S cp -p -r IVHITvWallCtrl /nfsroot/HI3798M
echo "ngs" |sudo -S rm IVHITvWallCtrl

#cd /home/ngs/workspace/build-IVHITvWallCtrl-3798M-Release
#make -j4 clean
#make -j4 all
#sudo ./install3798M


cd /home/ngs/workspace/IVHITvWallCtrl
make -j4 clean
sudo /home/ngs/QT/Qt4.8.6/bin/qmake /home/ngs/workspace/IVHITvWallCtrl/IVHITvWallCtrl.pro -r -spec qws/linux-3520d-g++ CONFIG+=HI3520D
make -j4
sudo chmod -R 777 /home/ngs/workspace/IVHITvWallCtrl/IVHITvWallCtrl

echo "ngs" |sudo -S cp -p -r IVHITvWallCtrl /nfsroot/HI3536C
echo "ngs" |sudo -S cp -p -r IVHITvWallCtrl /nfsroot/HI3536
echo "ngs" |sudo -S cp -p -r IVHITvWallCtrl /nfsroot/HI3520D
echo "ngs" |sudo -S cp -p -r IVHITvWallCtrl /nfsroot/HI3535
echo "ngs" |sudo -S rm IVHITvWallCtrl

#cd /home/ngs/workspace/build-IVHITvWallCtrl-3520D-Release
#make -j4 clean
#make -j4 all
#sudo ./install3520D


/////////////////////////然后再把我以前写的整体打包sh放到后面,这样就一个命令,直接产生升级包,就和大家平时用的一样了,唉,这么简单,怎么网上没有相关介绍呢,要么没搜到,要么就是太简单,所以称之为愚昧之重大发现,写出来,避免其他人遇到同样弱智的问题,折腾许久。



OK,输入sudo ./mkall.sh,升级包就自动放到网站或者发给客户了,每次改完程序,测试模块后,就是这个动作,就可以休息了


我来回答
回答3个
时间排序
认可量排序

hero

0个粉丝

1

问答

0

专栏

0

资料

hero 2017-12-12 09:56:09
认可0
学习受益了:victory::victory::victory::victory:

colorjun

0个粉丝

40

问答

0

专栏

1

资料

colorjun 2017-12-12 10:04:29
认可0
赶快收藏一下,虽然目前啥都不懂

david

39个粉丝

368

问答

253

专栏

229

资料

david 2017-12-12 17:44:32
认可0
可以发到自己社区的blog里面,排版会更漂亮一些
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区