LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2008, 03:18 AM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
doubt in make file


Hello
i am new to linux.so i have one doubt in makefile.i found that the makefileis used to compile more than one program simultaneously.....am right?...i am some douts in below example makefile command.
"make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules"

1.what for this "shell" is used before uname -r?

2.what is the use of "$" symbol?why it is used after kernel path?

3.what is " build M=$ modules"?

please help me to know the above things...
Thank you
 
Old 09-24-2008, 03:45 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
You are right that make can be used to compile more than one program simultaneously, but there is more to that: it handles dependancies in big projects. You tell it in the makefile that this and that object files must be compiled in order to compile that executable that is needed to install that stuff etc... and make will compile all the stuff in the right order.
Try 'man make' for more detailed information.
As for your command, are you using bash? I suppose 'shell' is a link to bash...
the $ symbol, in bash is for variables. Try man bash for more informations.
 
Old 09-24-2008, 03:51 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Your questions are about bash or sh and not make. The "uname -r" command returns the kernel version of the running kernel. The "$" symbol is how variables are referenced. The variable PWD is the present working directory. The shell maintains this variable.

You should read through the make info file or pick up a book on using make. The Makefile is used to automate the build process. If a file used to produce the target is newer than the target, then a rule is triggered, which runs the commands needed to update the target. The target might be a library, program or a pdf file. Your example has the target "modules" which isn't a file to produce. The rules will produce or update the kernel modules if the source files are newer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed for make file problem : make: *** No rule to make target `flash', needed rameshsatyavaram Linux - Newbie 3 09-11-2008 02:13 AM
doubt with "make check" of gcc in chapter 6 lfs_rocks Linux From Scratch 1 02-13-2008 12:15 AM
Doubt regarding PROC File novicehacker Linux - Kernel 6 12-13-2006 03:51 PM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 11:21 AM
file execution doubt pongsu Linux - General 2 09-25-2003 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration