yiffer的个人空间 https://blog.eetop.cn/edesign [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

添加uClinux用户应用程序

已有 515 次阅读| 2009-4-5 21:52 |个人分类:Linux移植

1. uClinux-dist/user/Makefile
dir_$(CONFIG_USER_HELLO_WORLD)        += hello

2. uClinux-dist/config/Configure.help
CONFIG_USER_HELLO_WORLD
  A simple hello world program

3. uClinux-dist/config/config.in
找到下面两行
mainmenu_option next_comment
comment 'Miscellaneous Applications'
添加如下一行
bool 'hello'    CONFIG_USER_HELLO_WORLD

4.1. uClinux-dist/user/hello/Makefile
EXEC = hello
OBJS = hello.o

all: $(EXEC)

$(EXEC): $(OBJS)
    $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)

romfs:
    $(ROMFSINST)    /bin/$(EXEC)

clean:
    -rm -f $(EXEC) *.elf *.gdb *.o

4.2. uClinux-dist/user/hello/hello.c
#include <stdio.h>

int main()
{
    printf("Hello, World\n");
    return 0;
}

5. 将用户程序编译进romfs
# cd ~/uClinux-dist
# make menuconfig
# make dep
# make romfs

参考资料:
uClinux-dist/Documentation/Adding-User-Apps-HOWTO

资料来源:http://blog.chinaunix.net/u/23177/showart_313928.html


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 3

    粉丝
  • 0

    好友
  • 20

    获赞
  • 69

    评论
  • 3705

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-27 07:29 , Processed in 0.016569 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部