make and cmake

make/cmake/qmake 区别

GNU MakeMake - GNU Project - Free Software Foundation
GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program’s source files.

Make gets its knowledge of how to build your program from a file called the makefile, which lists each of the non-source files and how to compute it from other files. When you write a program, you should write a makefile for it, so that it is possible to use Make to build and install the program.

CMakeCMake
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles.
cmake是跨平台项目管理工具,它用比Makefile更友好的语法来组织项目,cmake 根据 CMakeLists.txt 来生成 makefile

qmakeqmake Manual
The qmake tool helps simplify the build process for development projects across different platforms. It automates the generation of Makefiles so that only a few lines of information are needed to create each Makefile. You can use qmake for any software project, whether it is written with Qt or not.

@ref: make makefile cmake qmake都是什么,有什么区别? - 知乎

make 命令常用参数

格式:make [ -f makefile ] [ options ] ... [ targets ] ...

  • -C DIR,--directory=DIR: 在读取 Makefile 之前,进入到目录 DIR,然后执行 make。当存在多个 “-C” 选项的时候,make 的最终工作目录是第一个目录的相对路径
  • -e,--enveronment-overrides: 使用环境变量定义覆盖 Makefile 中的同名变量定义。
  • -f=FILE,--file=FILE,-makefile=FILE: 指定文件 “FILE” 为 make 执行的 Makefile 文件

makefile文件解析

@todo