当前位置: 技术问答>linux和unix
一个基于SDK的测试程序,没有成功,各位能看出哪里出错了吗?
来源: 互联网 发布时间:2017-01-14
本文导语: 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) $(LD...
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 worldn");
}
(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这个可执行程序,求大家看看,问题出在哪,谢谢了
(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 worldn");
}
(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这个可执行程序,求大家看看,问题出在哪,谢谢了
|
楼主出了什么问题呢?