Click here to Skip to main content
15,888,283 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
I'm trying to understand and do a simple project on makefile.

I couldn't understand what a make file is and how it executes, can anyone help me to understand it.

I need to create a sample using C programming.
Posted
Updated 28-Oct-13 20:46pm
v2

You might start reading a tutorial, see, for instance: "Makefiles by examples"[^].
 
Share this answer
 
Comments
Yashwanth R 30-Oct-13 1:48am    
Can u tell me what is the advantage of using makefile.
It will compile the files only if any changes are occurred in the particular files right..??
how will a developer come to know the make file is executing.

sorry if question is wrong.
I'm trying to execute a simple sample in this http://mrbook.org/tutorials/make/ url.
even if i remove makefile and execute the o/p will be same and even if makefile exist o/p is same.
CPallini 30-Oct-13 3:11am    
"It will compile the files only if any changes are occurred in the particular files right..??"
Yes, and it can execute rather complex commands in order to compile big projects (issuing such commands by hand would be a hassle).
In very small, basic, projects you have no advantages in using make, however, as the projects get bigger, using it makes the difference (pardon the pun).
Yashwanth R 30-Oct-13 7:41am    
thank u
CPallini 30-Oct-13 8:35am    
You are welcome.
 
Share this answer
 
Comments
Yashwanth R 30-Oct-13 1:48am    
Can u tell me what is the advantage of using makefile.
It will compile the files only if any changes are occurred in the particular files right..??
how will a developer come to know the make file is executing.

sorry if question is wrong. I'm trying to execute a simple sample in this http://mrbook.org/tutorials/make/ url.
even if i remove make file and execute the o/p will be same and even if makefile exist o/p is same.
fkassaie 30-Oct-13 7:14am    
Makefile is a script file for the make language .A unix tool that allows building complicated projects like operating systems easier .It works by writing rules and the requirements to it ..on how process a file ..It then call the apropriate tool to process that file
Is then easy to build pieces of software made of thouthands of files..On top of that the tool make checks if the file is UP TO DATE ..it means that if your project is made of 1000 files and you make a change only in one ..it doesn't need to rebuild 999 other files..but just one ..the others are ok ..up to date !
yes. if you remove the makefile, the execute of the o/p will be the same. this file is just for help in big project.
Yashwanth R 30-Oct-13 7:41am    
thank you.
fkassaie 30-Oct-13 8:06am    
was it helpful for you?
if you have some question, i can ask from my boss.
Yashwanth R 30-Oct-13 8:29am    
we are starting a product on ERP concept so studying abt MAKEFILE.. so asked the above mentioned question, if i get any doubt further I'll ask u.. thanks for the concern..
Here is a nice example of a Makefile and its explanation line by line.

You execute makefiles from the CLI (mostly in Unix-like systems, as far I know) using the make command, and they are normally written for automating tasks during a program's compilation-time.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900