LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compile using Makefile (https://www.linuxquestions.org/questions/linux-newbie-8/compile-using-makefile-883925/)

ganabot 06-01-2011 06:36 AM

compile using Makefile
 
hi
I am new to Linux. learn t basic command and how to compile single file in Linux environment using gcc. Now i dont know how to use make file to compile multiple file. please can any body help me........

MTK358 06-01-2011 09:04 AM

http://www.google.com/search?q=makef...UTF-8&oe=UTF-8

You might also want to check out something like CMake.

theNbomr 06-01-2011 10:12 AM

To compile a single file using make almost never even requires a Makefile. make has built-in knowledge of how to create object code from source code for most common compilers. If you have a C source file that can be compiled to an executable binary, you can most often use simply
Code:

make helloWorld
In the above example, make would look in the current working directory for a source code file that it knows how to compile and link to an executable. Since you refer to using gcc, if you had the C source file helloWorld.c in the current working directory, make would try to compile and link it using its built-in rules. Assuming your source file was compilable, it would result in a runnable binary, 'helloWorld'.
--- rod.

ganabot 06-03-2011 07:39 AM

could u please focus more light on Makefile use by giving an example how to use the makefile how to give the reference of all the files in a project

knudfl 06-03-2011 07:56 AM

Auto tools , Makefiles

http://www.gnu.org/software/autoconf/
http://www.gnu.org/software/automake/
http://sourceware.org/autobook/

http://www.freesoftwaremagazine.com/..._gnu_autotools
http://www.freesoftwaremagazine.com/...with_autotools
http://www.freesoftwaremagazine.com/..._with_autoconf

http://www.developingprogrammers.com...ools-tutorial/

http://www.wlug.org.nz/MakefileHowto
*** http://www.eng.hawaii.edu/Tutor/Make/
http://www.linuxplanet.com/linuxplan...orials/7093/1/
http://www.gnu.org/software/make/manual/make.html

..

Aquarius_Girl 06-03-2011 08:01 AM

Quote:

Originally Posted by ganabot (Post 4375059)
could u please focus more light on Makefile use by giving an example how to use the makefile how to give the reference of all the files in a project

Check out the 9th link in Knud's post above. That has the easiest explanations of them all.


All times are GMT -5. The time now is 06:19 AM.