如何对自己的代码做成库文件,防止修改或者查看
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 ...........\n");
Display_cfg_Init();
memset(Display_Param, 0, sizeof(Display_Param));
//printf("%d\n",sizeof(cfg));
//Display_cfg_init(cfg);
i = 0;
if(Disp_cfg == 1)
{
//printf("===file====\n");
//printf("%s\n",display_param);//display_param = 屏参文件内容
6,