打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux下Makefile的automake生成
http://andylin02.iteye.com/blog/854049
/******************helloworld.c*********************************/
#include <stdio.h>

int main(void)
{
   printf("hello kenter!\n");
   return 0;
}
***************************************************************/


1.首先运行autoscan扫描源代码,生成configure.scan文件
2.重命名configure.scan文件位configure.in文件,并修改

/******************configure.in*********************************/
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.64])
AC_INIT([hello], [1.0], [kenter1643@gmail.com])
AM_INIT_AUTOMAKE(hello,1.0)
AC_CONFIG_SRCDIR([helloworld.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile])

AC_OUTPUT
/****************************************************************/

3.运行aclocal生存aclocal.m4文件
4.运行autoconf
5.运行autoheader
6.新建Makefile.am文件,编辑

/******************configure.in*********************************/
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=helloworld.c
/***************************************************************/

7.运行automake --add-missing生存configure文件
8.运行./configure
9.运行make
10.运行make install
11.测试输入hello输出hello kenter!表示成功
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Autoconf/automake step by step
autoconf、automake工具组使用简单介绍
Linux中的configure,make,make install到底在做些什么
autotools工具自动生成Makefile
Linux下automake软件编译与发布之多级目录结构的处理
自动生成Makefile的详细过程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服