码迷,mamicode.com
首页 > 其他好文 > 详细

configure, make, make install都做了什么

时间:2016-08-06 23:26:06      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

1. 我的理解
./configure:  确保接下来的make以及make install所依赖的文件没有问题
make:  build编译连接生成可执行程序
make install: 将编译好的可执行程序以及文档copy到对应的系统目录

2. 那么如何制作configure文件以及Makefile呢

1) Prepararation
main.c,

#include <stdio.h>
int main(int argc, const char *argv[])
{
    printf("Hello world\n");
    return 0;
}

configure.ac

AC_INIT([helloworld],[0.1],[xxx@163.com])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Makefile.in

AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS = helloworld
helloworld_SOURCES = main.c

2) Tools:

aclocal   ------------------> set up an m4 environment
autoconf  ------------------> generate configure from configue.ac
automake --add-mising ------> generate Makefile.in from Makefile.am
./configue -----------------> generate Makefile from Makefile.in
make distcheck -------------> use Makefile to build and test a tarball to distribute


3. Overview

./configure  # generate Makefile from Makefile.in
make         # use Makefile to build the program
make install # use Makefile to install the program


Refer to:
1. The magic behind configure, make, make install


configure, make, make install都做了什么

标签:

原文地址:http://www.cnblogs.com/xianzhon/p/5745079.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!