zoukankan      html  css  js  c++  java
  • Linux configure,make,make install

    https://www.cnblogs.com/tinywan/p/7230039.html

    https://www.sohu.com/a/191735643_505857

     https://blog.csdn.net/icycode/article/details/49340151

    ########################################################################

    这些都是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤

    一、基本信息

      1、./configure 是用来检测你的安装平台的目标特征的。比如它会检测你是不是有CC或GCC,并不是需要CC或GCC,它是个shell脚本。

      2、make 是用来编译的,它从Makefile中读取指令,然后编译。

      3、make install是用来安装的,它也从Makefile中读取指令,安装到指定的位置。

      注意:AUTOMAKE和AUTOCONF是非常有用的用来发布C程序的东西。

    二、详细解释

      1、configure命令

      这一步一般用来生成 Makefile,为下一步的编译做准备,你可以通过在 configure 后加上参数来对安装进行控制,比如代码:./configure –prefix=/usr 意思是将该软件安装在 /usr 下面,执行文件就会安装在 /usr/bin (而不是默认的 /usr/local/bin),资源文件就会安装在 /usr/share(而不是默认的/usr/local/share)。同时一些软件的配置文件你可以通过指定 –sys-config= 参数进行设定。有一些软件还可以加上 –with、–enable、–without、–disable 等等参数对编译加以控制,你可以通过允许 ./configure –help 察看详细的说明帮助

    2、make

      这一步就是编译,大多数的源代码包都经过这一步进行编译(当然有些perl或python编写的软件需要调用perl或python来进行编译)。如果 在 make 过程中出现 error ,你就要记下错误代码(注意不仅仅是最后一行),然后你可以向开发者提交 bugreport(一般在 INSTALL 里有提交地址),或者你的系统少了一些依赖库等,这些需要自己仔细研究错误代码。

      可能遇到的错误:make *** 没有指明目标并且找不到 makefile。 停止。问题很明了,没有Makefile,怎么办,原来是要先./configure 一下,再make。

      3、make insatll

      这条命令来进行安装(当然有些软件需要先运行 make check 或 make test 来进行一些测试),这一步一般需要你有 root 权限(因为要向系统写入文件)。

    三、扩展说明

      Linux的用户可能知道,在Linux下安装一个应用程序时,一般先运行脚本configure,然后用make来编译源程序,在运行make install,最后运行make clean删除一些临时文件。使用上述三个自动工具,就可以生成configure脚本。运行configure脚本,就可以生成Makefile文件,然后就可以运行make、make install和make clean。

      configure是一个shell脚本,它可以自动设定源程序以符合各种不同平台上Unix系统的特性,并且根据系统叁数及环境产生合适的Makefile文件或是C的头文件(header file),让源程序可以很方便地在这些不同的平台上被编译连接。

      这时,就可运行configure脚本了,运行configure脚本,就可产生出符合GNU规范的Makefile文件了: $ ./configure

    到此时,就可以运行make进行编译,在运行make install进行安装了,最后运行make clean删除临时文件。

    $ make
    $ make install           (注:运行这个要有足够的权限)
    $ make clean

      利用configure所产生的Makefile文件有几个预设的目标可供使用,其中几个重要的简述如下:

      make all:产生我们设定的目标,即此范例中的可执行文件。只打make也可以,此时会开始编译原始码,然后连结,并且产生可执行文件。

      make clean:清除编译产生的可执行文件及目标文件(object file,*.o)。

      make distclean:除了清除可执行文件和目标文件外,把configure所产生的Makefile也清除掉。

      make install:将程序安装至系统中。如果原始码编译无误,且执行结果正确,便可以把程序安装至系统预设的可执行文件存放路径。如果用bin_PROGRAMS宏的话,程序会被安装至/usr/local/bin这个目录。

      make dist:将程序和相关的档案包装成一个压缩文件以供发布。执行完在目录下会产生一个以PACKAGE-VERSION.tar.gz为名称的文件。 PACKAGE和VERSION这两个变数是根据configure.in文件中AM_INIT_AUTOMAKE(PACKAGE,VERSION)的定义。在此范例中会产生test-1.0.tar.gz的档案。

      make distcheck:和make dist类似,但是加入检查包装后的压缩文件是否正常。这个目标除了把程序和相关文件包装成tar.gz文件外,还会自动把这个压缩文件解开,执行 configure,并且进行make all 的动作,确认编译无误后,会显示这个tar.gz文件可供发布了。这个检查非常有用,检查过关的包,基本上可以给任何一个具备GNU开发环境-的人去重新编译。

     #######################################################################

    在Linux下经常要安装部署一些软件包或者工具,拿到安装包之后一看,简单,configure,make, make install即可搞定。

    有时候我就在想,这个configure,make ,make install是什么意思呢,configure是测试存在的特性,然后make开始编译,make install生成相应的可执行文件。但是一个工具只是记住了其中的拼写部分或是基本的概念,但是对于原理知之甚少,也是需要补补了。

    几个构建编译隐藏的命令

    要先说这个编译安装过程,使用命令aclocal会生成m4文件,aclocal本质上是一个perl脚本。先提提m4, m4是一种宏处理器,它是 POSIX 标准的一部分。为什么叫m4呢,全称是macro,m后面有4个字母,据说是这样的,哈哈。摘录一段对于m4的描述:从图灵的角度来看 m4,输入流与输出流可以衔接起来构成一条无限延伸的纸带,m4 是这条纸带的读写头,所以 m4 是一种图灵机。m4 的计算能力与任何一种编程语言等同,区别只体现在编程效率以及所编写的程序的运行效率方面。

    然后是autoconf,是生成configure文件的,configure是一个脚本,它能设置源程序来适应各种不同的操作系统平台,并且根据不同的系统来产生合适的Makefile,从而可以使你的源代码能在不同的操作系统平台上被编译出来。

    最后是automake用来生成Makefile.in文件

    简单总结一下,这个编译过程涉及几个命令工具,大体的功能点如下。

    aclocal # 产生 aclocal.m4

    autoconf # 根据 configure.in 生成configure

    automake --add-missing # 根据 Makefile.am生成Makefile.in

    网上找到一张总结的很牛的图,很全面。

    构建过程环境准备

    我们写个简单的Hello world来了解下整个过程吧。

    我写了一段非常简单的c程序,就凑合着编译着用吧。文件为main.c

    #include <stdio.h>

    int main(int argc, const char *argv[])

    {

    printf("Hello world ,a new testn");

    return 0;

    }

    可以看出,程序运行后的输出就是Hello world,a new test

    我们看看构建GNU程序中如何按照规范来模拟这个过程

    我们创建一个文件configure.ac,里面是一些宏,是接下俩的autoconf来处理的需要的,然后交给automake来处理,最终完成这个检查。

    AC_INIT([helloworld],[0.1],[xxx@xxx.com])

    AM_INIT_AUTOMAKE

    AC_PROG_CC

    AC_CONFIG_FILES([Makefile])

    AC_OUTPUT

    比如AC_INIT([helloworld],[0.1],[xxx@xxx.com])的含义是autoconf生成包的名字,版本(这个可以自己定义),反馈邮箱,

    AM_INIT_AUTOMAKE是检查automake尝试Makefile时的工具,AC_PROG_CC是编译器检测,AC_CONFIG_FILES是automake构建出类似.in的文件。

    然后就是Makefile的文件,我们设定名字为Makefile.am,这部分的内容和上面的配置是密切相关的。

    [root@oel64 tmp]# cat Makefile.am

    AUTOMAKE_OPTIONS=foreign

    bin_PROGRAMS = helloworld

    helloworld_SOURCES = main.c

    automake提供了3种软件等级:foreign、gnu和gnits。默认等级是gnu。此处AUTOMAKE_OPTIONS使用的是foreign,表示只检测必要的文件。

    bin_PROGRAMS定义了要产生的执行文件名,这里我们定义为helloworld

    file_SOURCES定义file这个执行程序的依赖文件,其中“file_SOURCES”中的前部分“file”要改写成可执行文件名,即与bin_PROGRAMS定义的名称一致,此处就是helloworld了。如果有多个可执行文件,那就要定义相应的file_SOURCES。

    构建过程实践

    到目前为止,我们创建了3个文件 main.c,configure.ac,Makefile.am

    [root@oel64 c]# ll

    -rwxr-xr-x. 1 root root 108 Sep 13 12:13 configure.ac

    -rw-r--r--. 1 root root 105 Sep 13 12:13 main.c

    -rw-r--r--. 1 root root 79 Sep 13 12:13 Makefile.am

    首先使用aclocal来得到m4文件。这里生成了2个文件,一个是aclocal.m4,另外一个是cache文件autom4te.cache

    [root@oel64 c]# aclocal

    [root@oel64 c]# ll

    total 56

    -rw-r--r--. 1 root root 34611 Sep 13 12:14 aclocal.m4

    drwxr-xr-x. 2 root root 4096 Sep 13 12:14 autom4te.cache

    -rwxr-xr-x. 1 root root 108 Sep 13 12:13 configure.ac

    -rw-r--r--. 1 root root 105 Sep 13 12:13 main.c

    -rw-r--r--. 1 root root 79 Sep 13 12:13 Makefile.am

    然后使用autoconf得到configure文件

    [root@oel64 c]# autoconf

    [root@oel64 c]# ll

    -rw-r--r--. 1 root root 34611 Sep 13 12:14 aclocal.m4

    drwxr-xr-x. 2 root root 4096 Sep 13 12:14 autom4te.cache

    -rwxr-xr-x. 1 root root 135288 Sep 13 12:14 configure

    -rwxr-xr-x. 1 root root 108 Sep 13 12:13 configure.ac

    -rw-r--r--. 1 root root 105 Sep 13 12:13 main.c

    -rw-r--r--. 1 root root 79 Sep 13 12:13 Makefile.am

    然后使用automake来构建模块

    [root@oel64 c]# automake --add-missing

    configure.ac:2: installing `./install-sh'

    configure.ac:2: installing `./missing'

    Makefile.am: installing `./depcomp'

    整个过程完成之后,就是我们平常执行的操作了。

    执行configure的结果如下:

    [root@oel64 c]# ./configure

    checking for a BSD-compatible install... /usr/bin/install -c

    checking whether build environment is sane... yes

    checking for a thread-safe mkdir -p... /bin/mkdir -p

    checking for gawk... gawk

    checking whether make sets $(MAKE)... yes

    checking for gcc... gcc

    checking for C compiler default output file name... a.out

    checking whether the C compiler works... yes

    checking whether we are cross compiling... no

    checking for suffix of executables...

    checking for suffix of object files... o

    checking whether we are using the GNU C compiler... yes

    checking whether gcc accepts -g... yes

    checking for gcc option to accept ISO C89... none needed

    checking for style of include used by make... GNU

    checking dependency style of gcc... gcc3

    configure: creating ./config.status

    config.status: creating Makefile

    config.status: executing depfiles commands

    [root@oel64 c]#

    然后是make,这个过程你可以清晰的看到gcc开始编译。

    [root@oel64 c]# make

    gcc -DPACKAGE_NAME="helloworld" -DPACKAGE_TARNAME="helloworld" -DPACKAGE_VERSION="0.1" -DPACKAGE_STRING="helloworld 0.1" -DPACKAGE_BUGREPORT="xxx@xxx.com" -DPACKAGE="helloworld" -DVERSION="0.1" -I. -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c

    mv -f .deps/main.Tpo .deps/main.Po

    gcc -g -O2 -o helloworld main.o

    最后是make install,有了可执行的程序文件。

    [root@oel64 c]# make install

    make[1]: Entering directory `/root/c'

    test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"

    /usr/bin/install -c helloworld '/usr/local/bin'

    make[1]: Nothing to be done for `install-data-am'.

    make[1]: Leaving directory `/root/c'

    比如编译后的main.o,如果使用strings来查看内容就是执行后的结果。

    [root@oel64 c]# strings main.o

    Hello world ,a new test

    如果查看可执行程序helloworld的内容,里面是有相应的堆栈的。

    [root@oel64 c]# strings helloworld

    /lib64/ld-linux-x86-64.so.2

    __gmon_start__

    libc.so.6

    puts

    __libc_start_main

    GLIBC_2.2.5

    fff.

    手工执行一下 。

    [root@oel64 c]# ./helloworld

    Hello world ,a new test

     ####################################################

    //以下部分的步骤似乎更符合上面图上的过程

    本文章简单介绍了linux下autoscan, aclocal, autoconf, automake以及Makefile.am, Configure.in等文件和工具的使用。

     

     

    autoscan 		# 根据路径下生成configure.scan 和 autoscan.log
    aclocal 		# 产生 aclocal.m4
    autoconf 		# 根据 configure.in 生成configure 
    automake --add-missing 	# 根据 Makefile.am生成Makefile.in



     

    例子:在/hello/目录下创建一个hello.c文件,并编译运行它:

    #cd /hello/

    (1) 编写源文件hello.c:

     

    1. #include <stdio.h>
    2. int main(int argc, char** argv)
    3. {
    4. printf("Hello, GNU!n");
    5. return 0;
    6. }


    (2) #autoscan 

    ->生成 configure.scan 和 autoscan.log

     

    (3) 将configure.scan 修改为 configure.in:

    并修改configure.in内容如下

     

    # Process this file with autoconf to produce a configure script.
    AC_INIT(hello.c)
    AM_INIT_AUTOMAKE(hello, 1.0)
    # Checks for programs.
    AC_PROG_CC
    # Checks for library functions.
    AC_OUTPUT(Makefile)


    (4) #aclocal

    ->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)

    (5) #autoconf
    ->生成 configure (根据 configure.in, 和 aclocal.m4)

    (6) 编写Makefile.am:

     

    AUTOMAKE_OPTIONS= foreign
    bin_PROGRAMS= hello
    hello_SOURCES= hello.c

     

    (7) #automake --add-missing
    ->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)

    (8) #./configure
    ->生成 Makefile, config.log, 和 config.status

    (9) 在configure时指定需要链接的外部头文件和库
         注意export
    	export LDFLAGS="-L/home/songwei/double-conversion/" CPPFLAGS="-I/home/songwei/double-conversion/src/" CFLAGS="-I/home/songwei/double-conversion/src/" LIBS="-ldouble_conversion -ldouble_conversion_pic"
    	./configure --prefix=/usr/local/folly

    ##########################################################

    下面这篇更清晰

    一、生成Makefile流程图

    二、具体实例

      执行命令顺序:autoscan; aclocal; autoconf; autoheader; automake --add-missing; ./configure; make; ./helloworld;

    1、建目录

      在你的工作目录下建一个helloworld目录,用来存放helloworld程序及相关文件,如在/home/my/build下:

    $ mkdir helloword
    $ cd helloworld

    2、 helloworld.c

      编辑文件,完成后保存退出。现在在helloworld目录下就应该有一个你自己写的helloworld.c了。

      int main(int argc, char** argv)
      {
              printf("Hello, Linux World! ");
              return 0;
      } 

    3、生成configure

      $ autoscan
      $ ls
      configure.scan helloworld.c 

    执行后在hellowrold目录下会生成一个文件:configure.scan,可以拿它作为configure.ac的蓝本。

     

    4、生成configure.ac

       现在将configure.scan改名为configure.ac,并且编辑它,按下面的内容修改,去掉无关的语句:
    复制代码
       #                                               -*- Autoconf -*-
       # Process this file with autoconf to produce a configure script.
      
       AC_PREREQ([2.69])
       #AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
       AC_INIT(HelloWorld, 1.0, jiangtengfei007@163.com)
       AM_INIT_AUTOMAKE(HelloWorld, 1.0)  #这句话很重要,否则下面aclocal出错
       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
    复制代码

    5、执行aclocal和autoconf

      然后执行命令aclocal和autoconf,分别会产生aclocal.m4及configure两个文件:

      $ aclocal
      $ls
      aclocal.m4 configure.ac helloworld.c
      $ autoconf
      $ ls
      aclocal.m4 autom4te.cache configure configure.ac helloworld.c 

      可以看到configure.ac内容是一些宏定义,这些宏经autoconf处理后会变成检查系统特性、环境变量、软件必须的参数的shell脚本。

      autoconf 是用来生成自动配置软件源代码脚本(configure)的工具。configure脚本能独立于autoconf运行,且在运行的过程中,不需要用户的干预。

      要生成configure文件,你必须告诉autoconf如何找到你所用的宏。方式是使用aclocal程序来生成你的aclocal.m4。

      aclocal根据configure.ac文件的内容,自动生成aclocal.m4文件。aclocal是一个perl 脚本程序,它的定义是:“aclocal - create aclocal.m4 by scanning configure.ac”。

      autoconf从configure.ac这个列举编译软件时所需要各种参数的模板文件中创建configure。

      autoconf需要GNU m4宏处理器来处理aclocal.m4,生成configure脚本。

      m4是一个宏处理器。将输入拷贝到输出,同时将宏展开。宏可以是内嵌的,也可以是用户定义的。除了可以展开宏,m4还有一些内建的函数,用来引用文件,执行命令,整数运算,文本操作,循环等。m4既可以作为编译器的前端,也可以单独作为一个宏处理器.

     
     

    6、执行autoheader

      在执行automake --add-missing之前执行autoheade, 生成config.h.in
     
     

    7、新建Makefile.am

    AUTOMAKE_OPTIONS=foreign
    
    bin_PROGRAMS=helloworld
    
    helloworld_SOURCES=helloworld.c 

      automake会根据你写的Makefile.am来自动生成Makefile.in。Makefile.am中定义的宏和目标,会指导automake生成指定的代码。例如,宏bin_PROGRAMS将导致编译和连接的目标被生成。

     

    8、运行automake

    复制代码
    ➜  AutoConf_ automake --add-missing
    configure.ac:7: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
    configure.ac:7: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
    configure.ac:12: installing './compile'
    configure.ac:7: installing './install-sh'
    configure.ac:7: installing './missing'
    Makefile.am: installing './depcomp'
    复制代码

      automake会根据Makefile.am文件产生一些文件,包含最重要的Makefile.in。

    9、执行configure生成Makefile

    复制代码
    ➜  ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... ./install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating config.h
    config.status: executing depfiles commands
    ➜  ls -l Makefile
    -rw-rw-r-- 1 yutao yutao 15035 Oct 15 10:40 Makefile 
    复制代码

    你可以看到,此时Makefile已经产生出来了。

    10、使用Makefile编译代码

    ➜  make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
    gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT helloworld.o -MD -MP -MF .deps/helloworld.Tpo -c -o helloworld.o helloworld.c
    mv -f .deps/helloworld.Tpo .deps/helloworld.Po
    gcc  -g -O2   -o helloworld helloworld.o

    11、运行helloworld

    ➜  ./helloworld
    Hello World!!!!

      这样helloworld就编译出来了,你如果按上面的步骤来做的话,应该也会很容易地编译出正确的helloworld文件。你还可以试着使用一些其他的make命令,如make clean,make install,make dist,看看它们会给你什么样的效果。感觉如何?自己也能写出这么专业的Makefile,老板一定会对你刮目相看。

    三、命令详解 

    1、 autoscan

      autoscan是用来扫描源代码目录生成configure.scan文件的。autoscan可以用目录名做为参数,但如果你不使用参数的话,那么autoscan将认为使用的是当前目录。autoscan将扫描你所指定目录中的源文件,并创建configure.scan文件。

    2、 configure.scan

      configure.scan包含了系统配置的基本选项,里面都是一些宏定义。我们需要将它改名为configure.ac

    3、 aclocal

      aclocal是一个perl 脚本程序。aclocal根据configure.ac文件的内容,自动生成aclocal.m4文件。aclocal的定义是:“aclocal - create aclocal.m4 by scanning configure.ac”。

     

    4、 autoconf

      使用autoconf,根据configure.in和aclocal.m4来产生configure文件。configure是一个脚本,它能设置源程序来适应各种不同的操作系统平台,并且根据不同的系统来产生合适的Makefile,从而可以使你的源代码能在不同的操作系统平台上被编译出来。

      configure.ac文件的内容是一些宏,这些宏经过autoconf 处理后会变成检查系统特性、环境变量、软件必须的参数的shell脚本。configure.ac文件中的宏的顺序并没有规定,但是你必须在所有宏的最前面和最后面分别加上AC_INIT宏和AC_OUTPUT宏。

      在configure.ini中:

    复制代码
      #号表示注释,这个宏后面的内容将被忽略。
    
      AC_INIT(FILE) //这个宏用来检查源代码所在的路径。
      AM_INIT_AUTOMAKE(PACKAGE, VERSION) //这个宏是必须的,它描述了我们将要生成的软件包的名字及其版本号:PACKAGE是软件包的名字,VERSION是版本号。当你使用make dist命令时,它会给你生成一个类似helloworld-1.0.tar.gz的软件发行包,其中就有对应的软件包的名字和版本号。
      AC_PROG_CC  //这个宏将检查系统所用的C编译器。
      AC_OUTPUT(FILE)  //这个宏是我们要输出的Makefile的名字。
    复制代码

      我们在使用automake时,实际上还需要用到其他的一些宏,但我们可以用aclocal 来帮我们自动产生。执行aclocal后我们会得到aclocal.m4文件。   产生了configure.ac和aclocal.m4 两个宏文件后,我们就可以使用autoconf来产生configure文件了。

    5、 Makefile.am

      Makefile.am是用来生成Makefile.in的,需要你手工书写。Makefile.am中定义了一些内容:

      AUTOMAKE_OPTIONS  //在执行automake时,它会检查目录下是否存在标准GNU软件包中应具备的各种文件,例如AUTHORS、ChangeLog、NEWS等文件。我们将其设置成foreign时,automake会改用一般软件包的标准来检查。
      bin_PROGRAMS  //这个是指定我们所要产生的可执行文件的文件名。如果你要产生多个可执行文件,那么在各个名字间用空格隔开。
      helloworld_SOURCES  //这个是指定产生“helloworld”时所需要的源代码。如果它用到了多个源文件,那么请使用空格符号将它们隔开。比如需要helloworld.h,helloworld.c那么请写成helloworld_SOURCES= helloworld.h helloworld.c。

      如果你在bin_PROGRAMS定义了多个可执行文件,则对应每个可执行文件都要定义相对的filename_SOURCES。

    6、 automake

      使用automake,根据configure.in和Makefile.am来产生Makefile.in。

      --add-missing  //定义是“add missing standard files to package”,它会让automake加入一个标准的软件包所必须的一些文件。

      用automake产生出来的Makefile.in文件是符合GNU Makefile惯例的,接下来我们只要执行configure这个shell 脚本就可以产生合适的 Makefile 文件了。

      

    7、 Makefile

      在符合GNU Makefiel惯例的Makefile中,包含了一些基本的预先定义的操作:

    复制代码
      make      //根据Makefile编译源代码,连接,生成目标文件,可执行文件。
      make clean  //清除上次的make命令所产生的object文件(后缀为“.o”的文件)及可执行文件。
      make install  //将编译成功的可执行文件安装到系统目录中,一般为/usr/local/bin目录。
      make list  //产生发布软件包文件(即distribution package)。这个命令会将可执行文件及相关文件打包成一个tar.gz压缩的文件用来作为发布软件的软件包。它会在当前目录下生成一个名字类似“PACKAGE-VERSION.tar.gz”的文件。PACKAGE和VERSION,是我们在configure.ac中定义的AM_INIT_AUTOMAKE(PACKAGE, VERSION)。
      make distcheck  //生成发布软件包并对其进行测试检查,以确定发布包的正确性。这个操作将自动把压缩包文件解开,然后执行configure命令,并且执行make,来确认编译不出现错误,最后提示你软件包已经准备好,可以发布了。
      make distclean  //类似make clean,但同时也将configure生成的文件全部删除掉,包括Makefile。
     
  • 相关阅读:
    转: SSH框架总结(框架分析+环境搭建+实例源码下载)
    转:ClickOnce部署Winform程序的方方面面
    转:在决定使用ClickOnce发布你的软件前,应该知道的一些事情(一些常见问题解决方法)
    转: c#.net利用RNGCryptoServiceProvider产生任意范围强随机数的办法
    转:winform 安装包(很详细)
    转:c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
    转:C# WinForm窗体及其控件的自适应
    转:c# 安装包制作
    转:socket
    MyEclipse 智能提示设置
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10638004.html
Copyright © 2011-2022 走看看