当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > uClinux中添加用户应用程序的详细方法

Unix/Linux
HP工程师经验分享(15)
HP工程师经验分享(14)
HP工程师经验分享(13)
HP工程师经验分享(12)
HP工程师经验分享(11)
HP工程师经验分享(10)
HP工程师经验分享(9)
HP工程师经验分享(8)
HP工程师经验分享(7)
HP工程师经验分享(6)
HP工程师经验分享(5)
HP工程师经验分享(4)
HP工程师经验分享(3)
HP工程师经验分享(1)
HP-UX常见问题解答(28)
HP-UX常见问题解答(27)
HP-UX常见问题解答(26)
HP-UX常见问题解答(25)
HP-UX常见问题解答(24)
HP-UX常见问题解答(23)

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 208 ::
收藏到网摘: n/a

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 = helloOBJS = hello.oall: $(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