使用automake,autoconf生成Makefile,dh-make发布deb包
这就是主要流程图,所必须安装的几个东西:automake dh-make devscripts
具体操作:
一:编写源代码
$ vim helloworld.c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("helloworld");
return 0;
}
二:编写Makefile.am文件
automake会根据configure.in所定义的宏,将Makefile.am转化为Makefile.in
我们需要编写这个Makefile.in文件,从而定义我们所需要产生的目标
$ vim Makefile.am
这里只有一个.c文件,所以需要添加依赖关系如下:、
bin_PROGRAMS=hello //所要产生的可执行文件名 这里将产生hello
hello_SOURCES=helloworld.c //所依赖的文件,有多个要写多个,用空格隔开
//对于每个可执行文件,都要定义相应的filename_SOURCES
三:执行autoscan
在当前文件夹执行autoscan之后,将产生一个configure.scan文件,将它改成configure.in
configure.in包含了GNU M4的宏,这些宏经过autoconf 处理之后将变成脚本,用于检查系统特性。
configu