第 25 章 Build tool

简介:


目录

25.1. make - GNU make utility to maintain groups of programs
25.1.1. autoconf - Generate configuration scripts
25.2. CMake
25.2.1. helloworld
25.2.2. cmake_minimum_required
25.2.3. SET
25.2.4. ADD_SUBDIRECTORY
25.2.5. INCLUDE_DIRECTORIES
25.2.6. 编译文件
25.2.6.1. ADD_EXECUTABLE 编译可执行
25.2.6.2. ADD_LIBRARY 编译库文件
25.2.7. EXECUTABLE_OUTPUT_PATH / LIBRARY_OUTPUT_PATH
25.2.8. TARGET_LINK_LIBRARIES
25.2.9. INSTALL
25.3. scons - a software construction tool
25.4. Phing

25.1. make - GNU make utility to maintain groups of programs

Makefile

$ sudo apt-get install make
		

使用make命令测试

25.1.1. autoconf - Generate configuration scripts

autoconf

$ sudo apt-get install autoconf
			

automake

$ sudo apt-get install automake
			

example

过程 25.1. autoconf and automake step by step

  1. create directory

    % mkdir devel
    % cd devel
    % mkdir hello
    % cd hello
    					

    create a file

    vim hello.c
    
      #include
      int main(int argc, char** argv)
      {
      printf(``Hello, GNU!\n'');
      return 0;
      }
    					
  2. autoscan

    neo@debian:~/workspace/devel/hello$ autoscan
    neo@debian:~/workspace/devel/hello$ ls
    autoscan.log  configure.scan  hello.c
    					
  3. configure.in

    cp configure.scan configure.in
    
    neo@debian:~/workspace/devel/hello$ aclocal
    neo@debian:~/workspace/devel/hello$ autoconf
    neo@debian:~/workspace/devel/hello$ ls
    autom4te.cache  autoscan.log  configure  configure.in  configure.scan  hello.c
    					
  4. Makefile.am

    neo@debian:~/workspace/devel/hello$ vim Makefile.am
    neo@debian:~/workspace/devel/hello$ cat Makefile.am
    AUTOMAKE_OPTIONS= foreign
    bin_PROGRAMS= hello
    hello_SOURCES= hello.c
    neo@debian:~/workspace/devel/hello$
    					

    $ automake --add-missing
    configure.in: no proper invocation of AM_INIT_AUTOMAKE was found.
    configure.in: You should verify that configure.in invokes AM_INIT_AUTOMAKE,
    configure.in: that aclocal.m4 is present in the top-level directory,
    configure.in: and that aclocal.m4 was recently regenerated (using aclocal).
    automake: no `Makefile.am' found for any configure output
    automake: Did you forget AC_CONFIG_FILES([Makefile]) in configure.in?
    				




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
7月前
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
723 0
解决ERROR: Cannot uninstall ‘llvmlite‘. It is a distutils installed project and thus we cannot accurat
解决ERROR: Cannot uninstall ‘llvmlite‘. It is a distutils installed project and thus we cannot accurat
1010 0
解决ERROR: Cannot uninstall ‘llvmlite‘. It is a distutils installed project and thus we cannot accurat
【解决方案】成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
【解决方案】成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
|
开发工具
Failed to find Build Tools revision 25.0.2
Failed to find Build Tools revision 25.0.2
131 0
|
Android开发
Migrate Project to Gradle? This project does not use the Gradle build system
Migrate Project to Gradle? This project does not use the Gradle build system
107 0
|
Python
【解决方案】解决CMake must be installed to build the following extensions: pyltp
【解决方案】解决CMake must be installed to build the following extensions: pyltp
236 0
|
开发工具 Android开发
Failed to find Build Tools revision 28.0.3
Failed to find Build Tools revision 28.0.3
320 0
Failed to find Build Tools revision 28.0.3
dpkg-checkbuilddeps: error: Unmet build dependencies: build-essential:native
dpkg-checkbuilddeps: error: Unmet build dependencies: build-essential:native
759 0
|
机器人 Python 数据格式
Robot Framework's built-in tool:libdoc
Libdoc是Robot框架的内置工具之一,用于生成HTML和XML格式的测试库和资源文件的关键字文档,使用起来我感觉非常的灵活方便。 General Usage 语法使用 python -m robot.
1384 0