设为首页 加入收藏

TOP

向UBOOT中移植代码总结
2015-07-20 17:40:43 来源: 作者: 【 】 浏览:2
Tags:UBOOT 移植 代码 总结

1.首先,将要移植的代码目录(如bootpicsnd)整个拷贝到UBOOT工程中,最好放到对应的board目录下。

2.在bootpicsnd目录里,新建一个Makefile,参考如下:

#
# (C) Copyright 2000-2007
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#


include $(TOPDIR)/config.mk


LIB := $(obj)libbootpicsnd.a




COBJS = cdjpeg.o jaricom.o jcomapi.o jdapimin.o jdapistd.o jdarith.o jdatasrc.o jdcoefct.o jdcolor.o jddctmgr.o jdhuff.o jdinput.o jdmainct.o jdmarker.o jdmaster.o jdmerge.o jdpostct.o jdsample.o jdtrans.o jerror.o jidctflt.o jidctfst.o jidctint.o jmemmgr.o jmemnobs.o jquant1.o jquant2.o jutils.o wrbmp.o jpeg.o I2CMaster.o cmd_I2C.o bootpic.o bootsnd.o


SRCS := $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))


all: $(LIB)


$(LIB): $(obj).depend $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)


#########################################################################


# defines $(obj).depend target
include $(SRCTREE)/rules.mk


sinclude $(obj).depend


#########################################################################

注意:特殊颜色部分为对应的C文件,和这些原文生成的.o要ar成的库libbootpicsnd.a

3.在顶层的Makefile里,填加如下一句,使生成的uboot elf文件中,包含进libbootpicsnd.a

LIBS += board/hs3000/bootpicsnd/libbootpicsnd.a

4.make hs3000_config;make

5.此时一般都会报头文件的问题,想办法解决之。

6.编译成功后,会在相应的目录下(bootpicsnd)生成bootpicsnd.a,在u-boot.map中,能看到bootpicsnd.a相关的内容。

7.ok。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 1002-A + B Problem II(大数.. 下一篇Xcode Precompile Prefix Header..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·用 C 语言或者限制使 (2025-12-25 08:50:05)
·C++构造shared_ptr为 (2025-12-25 08:50:01)
·既然引用计数在做 GC (2025-12-25 08:49:59)
·Java 编程和 c 语言 (2025-12-25 08:19:48)
·. net内存管理宝典这 (2025-12-25 08:19:46)