前言,昨天在奕力科技调试触摸屏。找不到人家的驱动文件。一问原来是隐藏了。
具体步骤
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 ,别人照样可以编译,但是不能看其内容或者修改了
- quiet_cmd_u-boot__ ?= LD $@
- cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@
- -T u-boot.lds $(u-boot-init)
- --start-group $(u-boot-main) --end-group
- $(PLATFORM_LIBS) -L ./ -ljiangdou -Map u-boot.map
- quiet_cmd_smap = GEN common/system_map.o
- 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
- #include <jiangdou.h>//add by jiangdou for SD
- unsigned char Display_Param[1024];
- int update_env(void)//common/board_r.c
- {
- unsigned char buf[32]="";
- int ret;
- unsigned int i;
- //printf("update jiang_dou param file ........... ");
- Display_cfg_Init();
- memset(Display_Param, 0, sizeof(Display_Param));
- //printf("%d ",sizeof(cfg));
- //Display_cfg_init(cfg);
- i = 0;
- if(Disp_cfg == 1)
- {
- //printf("===file==== ");
- //printf("%s ",display_param);//display_param = 屏参文件内容
- //printf("===file==== ");
- //setenv("display_param", display_param);
- //saveenv();
- //GetProfileString(display_param, "display_param", "clock-frequency", dou);
- for(i =0; i < 17; i++){
- ret = GetProfileString(display_param, "display_param", cfg[i].Name, buf);
- if(ret < 0){
- return ;
- }
- else{