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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A build, as Makefile understands it, consists of a lot of targets. For example, to build a project you might need
If you implemented this workflow with makefile, you could make each of the targets separately. For example, if you wrote
it would only build that file, if necessary.
The name of
allis not fixed. It’s just a conventional name;alltarget denotes that if you invoke it, make will build all what’s needed to make a complete build. This is usually a dummy target, which doesn’t create any files, but merely depends on the other files. For the example above, building all necessary is building executables, the other files being pulled in as dependencies. So in the makefile it looks like this:alltarget is usually the first in the makefile, since if you just writemakein command line, without specifying the target, it will build the first target. And you expect it to beall.allis usually also a.PHONYtarget. Learn more here.