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,升级包就自动放到网站或者发给客户了,每次改完程序,测试模块后,就是这个动作,就可以休息了
先说我遇到的问题,由于习惯了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个
时间排序
认可量排序
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2015-01-26 22:36:17
-
2017-01-04 15:52:50
-
2018-07-06 16:02:29
-
02016-06-22 23:45:46
-
2017-01-05 16:48:36
-
2017-05-02 15:40:23
-
2017-06-01 15:06:49
-
2020-10-14 10:29:25
-
2023-08-24 10:32:35
-
2023-07-18 09:27:38
-
2019-11-16 22:25:18
-
2019-03-26 15:04:10
-
02008-07-19 12:55:54
-
02013-11-18 15:31:11
-
2017-06-05 15:20:33
-
2015-11-26 22:05:17
-
02008-07-12 19:17:39
-
2012-12-04 13:52:20
-
342019-07-19 19:18:52
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
-
5有偿求HI3516DV500 + OV5647驱动
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认