What is the difference between make and gcc?

前端 未结 11 1343
小鲜肉
小鲜肉 2021-01-31 02:39

The last sentence in the article caught my eye

[F]or C/C++ developers and students interested in learning to program in C/C++ rather than users of L

11条回答
  •  佛祖请我去吃肉
    2021-01-31 03:37

    make uses a Makefile in the current directory to apply a set of rules to its input arguments. Make also knows some default rules so that it executes even if it doesn't find a Makefile (or similar) file in the current directory. The rule to execute for cpp files so happens to call gcc on many systems.

    Notice that you don't call make with the input file names but rather with rule names which reflect the output. So calling make xyz will strive to execute rule xyz which by default builds a file xyz (for example based on a source code file xyz.cpp.

提交回复
热议问题