- 11
- 0
- 约5.45千字
- 约 7页
- 2019-06-08 发布于山东
- 举报
实验七 make命令以及makefile编写
实验目的:
了解makefile的编写规则;通过make命令和makefile文件实现自动化编译。
实验要求
编写多个相互调用源文件,编写对应的makefile文件,用make命令自动编译。
编写相对复杂的makefile文件,实现复杂自动编译任务。
实验内容:
简单实验任务
1)、在自己主目录下创建目录,目录名:testmakefile,
2)在testmakefile下创建目录test1,在其中创建文件:
main.c文件
#include “mytool1.h”
#include “mytool2.h”
int main()
{
mytool1_print(“hello”);
mytool2_print(“hello”);
}
mytool1.h
#ifndef_MYTOOL_1_H
#define_MYTOOL_1_H
void mytool1_print(char *print_str);
#endif
mytool1.c
#include “mytool1.h”
void mytool1_print(char *print_str)
{
printf(“This is mytool1 print %s\n”
原创力文档

文档评论(0)