• 把代码做成库文件,防止修改或者查看。


    前言,昨天在奕力科技调试触摸屏。找不到人家的驱动文件。一问原来是隐藏了。

    具体步骤

    1,make   xx.c   xx.o

    2,  $ ar  -r   libxxx.a   xxx.o

    3,modify  Makefile    //for ex    u-boot/common/cmd_jiangdou.c  ,,make  cmd_jiangdou.o

      $ ar  -r  libjiangdou.a  common/cmd_jiangdou.o

      $ rm  common/cmd_jiangdou.c   //这样删掉cmd_jiangdou.c  ,别人照样可以编译,但是不能看其内容或者修改了

    [csharp] view plain copy
     
    1. quiet_cmd_u-boot__ ?= LD      $@  
    2.       cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@   
    3.       -T u-boot.lds $(u-boot-init)                               
    4.       --start-group $(u-boot-main) --end-group      
    5.       $(PLATFORM_LIBS) -L ./ -ljiangdou -Map u-boot.map  
    6.   
    7. quiet_cmd_smap = GEN     common/system_map.o  
    8. cmd_smap =    

    4,  dou@ubtu:/work/u-boot$ ar -t libjiangdou.a 
    cmd_jiangdou.o
    dou@ubtu:/work//u-boot$

    5  file  ->  cmd_jiangdou.c 

    [csharp] view plain copy
     
    1. #include <jiangdou.h>//add by jiangdou for SD  
    2.   
    3. unsigned char Display_Param[1024];  
    4.   
    5. int update_env(void)//common/board_r.c  
    6. {  
    7.       
    8.     unsigned char buf[32]="";  
    9.     int ret;  
    10.     unsigned int i;  
    11.       
    12.     //printf("update jiang_dou param file ........... ");  
    13.       
    14.     Display_cfg_Init();  
    15.     memset(Display_Param, 0, sizeof(Display_Param));  
    16.     //printf("%d ",sizeof(cfg));  
    17.       
    18.     //Display_cfg_init(cfg);  
    19.     i = 0;  
    20.     if(Disp_cfg == 1)  
    21.     {     
    22.         //printf("===file==== ");  
    23.         //printf("%s ",display_param);//display_param = 屏参文件内容  
    24.           
    25.         //printf("===file==== ");  
    26.         //setenv("display_param", display_param);  
    27.         //saveenv();  
    28.         //GetProfileString(display_param, "display_param", "clock-frequency", dou);  
    29.         for(i =0; i < 17; i++){  
    30.               
    31.               
    32.             ret = GetProfileString(display_param, "display_param", cfg[i].Name, buf);  
    33.             if(ret < 0){  
    34.                 return ;  
    35.                   
    36.             }  
    37.             else{  
     

     

  • 相关阅读:
    [POI2014]FarmCraft
    [POI2014]Solar Panels
    Luogu P2824 [HEOI2016/TJOI2016]排序
    CF903G Yet Another Maxflow Problem
    CF901C Bipartite Segments
    CF749E Inversions After Shuffle
    ARC068C Snuke Line
    BZOJ3747 [POI2015]Kinoman
    SA-IS
    简单字符串
  • 原文地址:https://www.cnblogs.com/huangbaobaoi/p/6178117.html
Copyright © 2020-2023  润新知