automake创建c项目,python项目的makefile

目录

1. 修改configure.ac文件 4

2. 之后步骤省略,同上 5

3. 增加Makefile.am文件 5

4. 将dist-hook后面跟shell指令,直接打出bin包 5

 


入门教程(c/c++)

环境:centos7.5

  1. 安装automake

automake创建c项目,python项目的makefile

  1. 创建hello word程序

automake创建c项目,python项目的makefile

  1. 执行autoscan

automake创建c项目,python项目的makefile

  1. mv configure.scan configure.ac

automake创建c项目,python项目的makefile

  1. 修改configure.ac内容

添加AM_INIT_AUTOMAKE(这里修改,因为automake的版本不同,会出现如下报错)

automake创建c项目,python项目的makefile

修改方法参照:http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

修改AC_INIT,将其中的三个参数修改

修改AC_OUTPUT

修改结果如下:

automake创建c项目,python项目的makefile

 

  1. libtoolize -f -c
  2. aclocal
  3. autoheader
  4. autoconf

automake创建c项目,python项目的makefile

  1. 创建Makefile.am

automake创建c项目,python项目的makefile

  1. 执行automake命令会报错,需要执行automake --add-missing

automake创建c项目,python项目的makefile

  1. 执行automake --add-missing报错

automake创建c项目,python项目的makefile

需要执行下面命令解决:

libtoolize --automake --copy --debug --force

 

  1. automake正确执行后,便可以./configure了(这其中还有几个步骤,包含在下图中了)

automake创建c项目,python项目的makefile

  1. 生成了Makefile,执行一下,会有可执行文件生成

automake创建c项目,python项目的makefile

至此,automake的入门教程结束。

 

进阶教程(python):

 

  1. 修改configure.ac文件

automake创建c项目,python项目的makefile

增加AM_PATH_PYTHON([2.7],,[2.7])

  1. 之后步骤省略,同上
  2. 增加Makefile.am文件

automake创建c项目,python项目的makefile

  1. 将dist-hook后面跟shell指令,直接打出bin包

pyinstaller -F autoCheck.py -n autoCheck.bin

结束。

 

多编程语言使用automake教程:

 

  1.  
  2.  
  3.  
  4.