What does “all” stand for in a makefile?

前端 未结 4 1522
迷失自我
迷失自我 2020-12-22 17:20

I read some tutorials concerning Makefiles but for me it is still unclear for what the target \"all\" stands for and what it does.

Any ideas?

4条回答
  •  北海茫月
    2020-12-22 18:21

    The target "all" is an example of a dummy target - there is nothing on disk called "all". This means that when you do a "make all", make always thinks that it needs to build it, and so executes all the commands for that target. Those commands will typically be ones that build all the end-products that the makefile knows about, but it could do anything.

    Other examples of dummy targets are "clean" and "install", and they work in the same way.

    If you haven't read it yet, you should read the GNU Make Manual, which is also an excellent tutorial.

提交回复
热议问题