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
欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛https://bbs.txwb.com |
关注天下网吧微信,了解网吧网咖经营管理,安装维护:
本文来源:赛迪网 作者:佚名