当前位置:首页 > 2014嵌入式Linux试题库
组成,而这几个文件又分为包含了其他文件,如下图所示: 文件 包含文件
文件 main.c list.c symbol.c table.c table.h 包含文件 stdio.h, table.h list.h symbol.h table.h symbol.h, list.h
完成下列任务:
(1)编写makefile文件,最终的目标文件为hello(交叉编译器为arm-linux-gcc)
(2)给出程序编译执行步骤 1、答:
第一步:编写makefile文件 hello: main.o list.o symbol.o table.o
gcc -o prog main.o list.o symbol.o table.o main.o: main.c table.h symbol.h list.h gcc -c -o main.o main.c list.o: list.c list.h gcc -c -o list.o list.c symbol.o: symbol.c symbol.h gcc -c -o symbol.o symbol.c table.o: table.c table.h symbol.h list.h gcc -c -o table.o table.c
clean: rm hello *.o 第二步:#make
第三步:执行程序,检测结果。 ./hello
共分享92篇相关文档