博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
12年底的一个想法-->工作的编译小工具
阅读量:5263 次
发布时间:2019-06-14

本文共 14847 字,大约阅读时间需要 49 分钟。

View Code
//file function: easier to compile and module#include 
#include
#include
int main(){ int n,temp; int filedes; char a[50]; printf("1:Navi\n2:Multimedia\nNo.:"); scanf("%d",&n);// printf("input the filename:\n");// scanf("%s",a);// filedes = open(a,O_CREAT | O_RDWR); if(n==1){ //printf("input the filename:\n"); //scanf("%s",a); //filedes = open(a,O_CREAT | O_RDWR); printf("\n1:build_all\n2:buildASR\n3:buildEUR\n4:buildPRC\n5:buildRUS\n6:obj_delete\n"); printf("No.:"); scanf("%d",&n); printf("\nname of outfile:\n"); scanf("%s",a); filedes = open(a,O_CREAT | O_RDWR); temp=dup(2); dup2(filedes,2); switch(n){ case 1: system("./navi/buildall.sh"); break; case 2: system("./navi/buildASR.sh"); break; case 3: system("./navi/buildEUR.sh"); break; case 4: system("./navi/buildPRC.sh"); break; case 5: system("./navi/buildRUS.sh"); break; case 6: system("./navi/navi_obj_del.sh"); return 0; default: break; } system("ls -l /home/naviwork/dso | grep 'navi_hmi*'");#if 1 dup2(temp,2); system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/navi_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/navi/interface/libif/x86a/* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_navi.so /home/naviwork/work/Module_files/"); printf("navi_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmi_core.out | grep 'undefined symbol*'"); printf("\nnavi_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmicprt.out | grep 'undefined symbol*'");#endif } else if(n==2){ printf("\n1:build_all\n2:buildASR\n3:buildEUR\n4:buildPRC\n5:buildRUS\n6:obj_delete\n"); printf("No.:"); scanf("%d",&n); printf("\nname of outfile:\n"); scanf("%s",a); temp=dup(2); filedes = open(a,O_CREAT | O_RDWR); dup2(filedes,2); switch(n){ case 1: system("./mm/buildall.sh"); break; case 2: system("./mm/buildASR.sh"); break; case 3: system("./mm/buildEUR.sh"); break; case 4: system("./mm/buildPRC.sh"); break; case 5: system("./mm/buildRUS.sh"); break; case 6: system("./mm/mm_obj_del.sh"); return 0; default: break; } system("ls -l /home/naviwork/dso | grep 'multimedia_hmi*'");#if 1 dup2(temp,2); system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/multimedia_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/multimedia/interface/libif/x86a/multimedia* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_multimedia.so /home/naviwork/work/Module_files/"); printf("multimedia_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmi_core.out | grep 'undefined symbol*'"); printf("\nmultimedia_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmicprt.out | grep 'undefined symbol*'");#endif } return 0;}

 改进后的代码~界面稍微好了点,而且功能也有了修正..

View Code
//file function: easier to compile and module#include 
#include
#include
int main(){ int n,temp; int filedes; char a[50]; char for_3; printf("\n"); printf("1:Navi\n2:Multimedia\n3:ModuleWithNeuFiles\n4:EnviSet\nNo.:"); scanf("%d",&n);// printf("input the filename:\n");// scanf("%s",a);// filedes = open(a,O_CREAT | O_RDWR); if(n==1){ //printf("input the filename:\n"); //scanf("%s",a); //filedes = open(a,O_CREAT | O_RDWR); printf("\n1:build_all\n2:buildASR\n3:buildEUR\n4:buildPRC\n5:buildRUS\n6:boot_test\n7:obj_delete\n"); printf("No.:"); scanf("%d",&n); if(n==7){ system("sh ./navi/navi_obj_del.sh"); return 0; } else if(n==6){ system("sh ./navi/boot_test.sh"); return 0; } else if(n>7){ printf("input the correct number.\n"); return 0; } printf("\noutput filename:\n"); scanf("%s",a); filedes = open(a,O_CREAT | O_RDWR); temp=dup(2); dup2(filedes,2); switch(n){ case 1: system("sh ./navi/buildall.sh"); break; case 2: system("sh ./navi/buildASR.sh"); break; case 3: system("sh ./navi/buildEUR.sh"); break; case 4: system("sh ./navi/buildPRC.sh"); break; case 5: system("sh ./navi/buildRUS.sh"); break; //case 6: //system("./navi/navi_obj_del.sh"); //return 0; default: return 0; } system("ls -l /home/naviwork/dso | grep 'navi_hmi*'");#if 1 dup2(temp,2); system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/navi_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/navi/interface/libif/x86a/* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_navi.so /home/naviwork/work/Module_files/"); printf("navi_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmi_core.out | grep 'undefined symbol*'"); printf("\nnavi_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmicprt.out | grep 'undefined symbol*'");#endif } else if(n==2){ printf("\n1:build_all\n2:buildASR\n3:buildEUR\n4:buildPRC\n5:buildRUS\n6:boot_test\n7:obj_delete\n"); printf("No.:"); scanf("%d",&n); if(n==7){ system("sh ./mm/mm_obj_del.sh"); return 0; } else if(n==6){ system("sh ./mm/boot_test.sh"); return 0; } else if(n>7){ printf("input the correct number.\n"); return 0; } printf("\noutput filename:\n"); scanf("%s",a); temp=dup(2); filedes = open(a,O_CREAT | O_RDWR); dup2(filedes,2); switch(n){ case 1: system("sh ./mm/buildall.sh"); break; case 2: system("sh ./mm/buildASR.sh"); break; case 3: system("sh ./mm/buildEUR.sh"); break; case 4: system("sh ./mm/buildPRC.sh"); break; case 5: system("sh ./mm/buildRUS.sh"); break; //case 6: //system("./mm/mm_obj_del.sh"); //return 0; default: return 0; } system("ls -l /home/naviwork/dso | grep 'multimedia_hmi*'");#if 1 dup2(temp,2); system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/multimedia_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/multimedia/interface/libif/x86a/libmultimedia* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_multimedia.so /home/naviwork/work/Module_files/"); printf("multimedia_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmi_core.out | grep 'undefined symbol*'"); printf("\nmultimedia_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmicprt.out | grep 'undefined symbol*'");#endif } else if(n==3){ system("rm -f /home/naviwork/work/Module_files/*"); printf("\n1:Navi\n2:Multimedia\n"); printf("No.:"); scanf("%d",&n); if(n>2) printf("plz input the correct number\n"); else if(n==1){ //printf("1:NAM\n2:ASR\n3:EUR\n4:PRC\n5:RUS\nNo.:"); //scanf("%d",&n); system("rm -f /home/naviwork/work/Supported_files/*"); printf("\nplz copy files first..(Y/N)\n"); getchar(); scanf("%c",&for_3); while(for_3!='Y'){ printf("if copied,input 'Y':"); getchar(); scanf("%c",&for_3); } printf("\n1:NAM\n2:ASR\n3:EUR\n4:PRC\n5:RUS\nNo.:"); scanf("%d",&n); printf("\noutput filename:\n"); scanf("%s",a); filedes = open(a,O_CREAT | O_RDWR); temp=dup(2); dup2(filedes,2); switch(n){ case 1: system("sh ./navi/build_all"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./navi/navibuild_a.sh"); break; case 2: system("sh ./navi/build_ASR"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./navi/navibuildASR_a.sh"); break; case 3: system("sh ./navi/build_EUR"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./navi/navibuildEUR_a.sh"); break; case 4: system("sh ./navi/build_PRC"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./navi/navibuildPRC_a.sh"); break; case 5: system("sh ./navi/build_RUS"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./navi/navibuildRUS_a.sh"); break; default: return 0; } system("ls -l /home/naviwork/dso | grep 'navi_hmi*'"); dup2(temp,2); //system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/navi_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/navi/interface/libif/x86a/* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_navi.so /home/naviwork/work/Module_files/"); printf("navi_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmi_core.out | grep 'undefined symbol*'"); printf("\nnavi_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/navi_hmicprt.out | grep 'undefined symbol*'"); //system("cp /home/naviwork/work/Supported_files/*.a /home/naviwork/work/build_env/"); } else if(n==2){ system("rm -f /home/naviwork/work/Supported_files/*"); printf("\nplz copy files first...(Y/N)\n"); getchar(); scanf("%c",&for_3); while(for_3!='Y'){ printf("if copied,input 'Y':"); getchar(); scanf("%c",&for_3); } printf("\n1:NAM\n2:ASR\n3:EUR\n4:PRC\n5:RUS\nNo.:"); scanf("%d",&n); printf("\noutput filename:\n"); scanf("%s",a); filedes = open(a,O_CREAT | O_RDWR); temp=dup(2); dup2(filedes,2); switch(n){ case 1: system("sh ./mm/build_all"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./mm/multimediabuild_a.sh"); break; case 2: system("sh ./mm/build_ASR"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./mm/multimediabuildASR_a.sh"); break; case 3: system("sh ./mm/build_EUR"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./mm/multimediabuildEUR_a.sh"); break; case 4: system("sh ./mm/build_PRC"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./mm/multimediabuildPRC_a.sh"); break; case 5: system("sh ./mm/build_RUS"); system("cp /home/naviwork/work/Supported_files/*.so /home/naviwork/work/build_env/runtime/lib/x86a/"); system("sh ./mm/multimediabuildRUS_a.sh.sh"); break; default: return 0; } system("ls -l /home/naviwork/dso | grep 'multimedia_hmi*'"); dup2(temp,2); //system("rm /home/naviwork/work/Module_files/*"); system("cp /home/naviwork/dso/multimedia_hmi* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/work/build_env/multimedia/interface/libif/x86a/libmultimedia* /home/naviwork/work/Module_files/"); system("cp /home/naviwork/dso/libifin_multimedia.so /home/naviwork/work/Module_files/"); printf("multimedia_hmi_core.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmi_core.out | grep 'undefined symbol*'"); printf("\nmultimedia_hmicprt.out\n"); system("ldd -r /home/naviwork/work/Module_files/multimedia_hmicprt.out | grep 'undefined symbol*'"); } } else if(n==4){ system("mkdir /home/naviwork/work/Module_files"); system("mkdir /home/naviwork/work/Supported_files"); printf("Finished.\n"); } else{ printf("plz input the correct number.\n"); } return 0;}

哈哈,写完的时候,还是挺开心的...最近学linux的进程通信和TCPIP协议,努力加油吧!

转载于:https://www.cnblogs.com/chendi2012/archive/2013/03/01/2939272.html

你可能感兴趣的文章
UBoot添加命令的方法
查看>>
jsp中简易版本的图片上传程序
查看>>
C++STL源代码学习(之slist篇)
查看>>
Android发展Singleton模式
查看>>
cocos2d-x使用CCClippingNode实现跑马灯
查看>>
C++预编译头文件 – stdafx.h
查看>>
2015羊年,您好,在新的一年里祝大家:工作顺利,万事如意!
查看>>
git push之后回滚(撤销)代码
查看>>
Python学习【第2篇】:Python数据类型
查看>>
[转帖]译文:如何使用SocketAsyncEventArgs类(How to use the SocketAsyncEventArgs class)
查看>>
AWT事件处理机制
查看>>
学习Javascript和Jquery必备资料
查看>>
时间同步小工具(Python + Windows Service + NSIS)
查看>>
2.最佳调度问题
查看>>
Java安装与环境配置
查看>>
Recover Polygon (easy)
查看>>
hdu 4011 模拟题
查看>>
Git用法总结
查看>>
IOS 按钮(button)用法与属性实例
查看>>
威佐夫博弈模板
查看>>