1、 新建一个文件夹hello,进入hello文件夹,新建hello.c文件。

Linux生产makefile
Linux生产makefile2、使用gcc -c hello.c命令检查hello.c是否有语法错误。
Linux生产makefile
3、安装autoscan命令,autoscan和autoheader都包含在autoconf工具中,所以只要安装autoconfig就可以了。

Linux生产makefile

4、安装aclocal和automake。其中aclocal包含在automake工具中。
Linux生产makefile
5、 执行autoscan,生成configure.scan.
Linux生产makefile
6、修改configure.scan并重命名为configure.in。因为aclocal需要名为configure.in或configure.ac的文件。
Linux生产makefile
Linux生产makefile
7、运行aclocal和autoconf生成aclocal.m4和configure两个文件。
Linux生产makefile
8、执行autoheader命令生成config.h.in
Linux生产makefile
9、编写Makefile.am文件。
Linux生产makefile
10、执行automake --add-missing命令。
Linux生产makefile
11、执行./configure生成Makefile。
Linux生产makefile
12、最后运行make命令进行编译生成可执行文件hello并运行。
Linux生产makefile
13、运行成功,大功告成!!!

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-08-11
  • 2022-12-23
  • 2021-10-28
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2021-11-04
  • 2021-11-06
  • 2021-06-21
  • 2021-10-06
相关资源
相似解决方案