ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everybody,
can someone explain me why we need a makefile.When i create small c or c++ pgm am not worrying about this makefiles.What significance does it have ?
Makefiles are made so you dont have to compile everyyything by hand. Compile gcc and see all the flags going by. Imagine doing that by hand? and adding the right objects and so on....Hours of pointless labor around the world. So a guy takes the job for himself and does a makefile and make your life easier!!!
Also, I didnt understand your post past the first word makefile. What did you want to know?
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398
Rep:
Quote:
Originally posted by loke137 Makefiles are made so you dont have to compile everyyything by hand. Compile gcc and see all the flags going by. Imagine doing that by hand? and adding the right objects and so on....Hours of pointless labor around the world. So a guy takes the job for himself and does a makefile and make your life easier!!!
Also, I didnt understand your post past the first word makefile. What did you want to know?
thats right and also they check for avaible liblarys and their places on disk so you do not have to tell them
Makefiles are nice to have because if you're writing long and complicated programs that require several different files/libraries to compile, you don't have to compile every updated file individually. Instead, the makefile can contain the command to do that with an individual file or a series of them and all you need to do is specify which command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.