首页服务器Linux服务器 uClinux中添加用户应用程序的详细方法

uClinux中添加用户应用程序的详细方法

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 prog…

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

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

5. 将用户程序编译进romfs


# cd ~/uClinux-dist
# make menuconfig
# make dep
# make romfs 

本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/fwq/Linux/8385.html
上一篇菜鸟乐园 Linux中常见文件系统格式介绍
下一篇 Linux下Socket连接超时的一种实现方法
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部