| 论坛注册| 加入收藏 | 设为首页| RSS
Google
您当前的位置:首页 > Linux频道 > Linux开发区 > 嵌入应用

添加uClinux用户应用程序

时间:2007-06-04 12:07:28  来源: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
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
    无相关信息
栏目更新
栏目热门