Advertisement

GNU make and automake generate makefile instances

阅读量:

摘要 :在构建自动化编译文件的过程中,存在两种主要途径,其一是手动编写makefile文件,其二是借助automake工具自动生成makefile内容。

对于规模较大的工程项目,推荐采用automake工具进行处理。

而对于规模较小的项目,则可以直接手动完成makefile的编写工作。

如需进一步了解automake的相关信息,请前往:automake自动生成makefile流程

**

一、手动编写makefile文件

1.helloworld小程序构建与文件结构

--main.c

复制代码
 #include "hello.h"

    
  
    
 void main()
    
 {
    
 	PrintfHello();
    
 }
    
    
    
    

--hello.c

复制代码
 #include <stdio.h>

    
 #include "hello.h"
    
  
    
 void PrintfHello()
    
 {
    
 	printf(" Hello World!\n");
    
 }
    
    
    
    

--hello.h

复制代码
 #ifndef _HELLO_H_

    
 #defi

全部评论 (0)

还没有任何评论哟~