Chinaunix

标题: 一个基于SDK的测试程序,没有成功,各位能看出哪里出错了吗? [打印本页]

作者: sy20577036    时间: 2011-11-08 08:56
标题: 一个基于SDK的测试程序,没有成功,各位能看出哪里出错了吗?
Example: Add hello application to /bin
(a)
Create hello directory in RT288x_SDK/source/user
#mkdir RT288x_SDK/source/use/hello
(b) Add Makefile to RT288x_SDK/source/user/hello

EXEC = hello  
OBJS = hello.o  
CFLAGS +=

all: $(EXEC)
$(EXEC): $(OBJS)  
$(CC) $(LDFLAGS) -o $@ $(OBJS)
romfs:  
$(ROMFSINST) /bin/$(EXEC)
clean: -rm -f $(EXEC) *.elf *.gdb *.o

(c) Add hello.c to RT288x_SDK/source/user/hello
main()  
{ printf("hello world\n");
}

(d) Edit RT288x_SDK/source/config/config.in
mainmenu_option next_comment comment  
'XXX Add-on Applications'  
bool 'hello_world' CONFIG_USER_HELLO_WORLD  
endmenu

(e) Edit RT288x_SDK/source/user/Makefile
dir_$(CONFIG_USER_HELLO_WORLD) += hello

(f) Turn on hello application
#make menuconfig
[*] hello_world (NEW)
(g) Build new image
#make dep  
#make
(h) check file is correct
#cd RT288x_SDK/source/romfs/bin #file hello #hello: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), stripped
(i) Testing
BusyBox v1.4.2 (2007-05-04 11:15:35 CST) Built-in shell (ash) Enter 'help' for a list of built-in commands.
/ #  
/ # hello  
hello world  
/ #  

以上便是根据SDK来生成一个能在板子上运行输出hello的简单的应用程序,但是按照以上的做法并没有生成hello这个可执行程序,求大家看看,问题出在哪,谢谢了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2