Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

Rep: Reputation: 31
doubt in make file

i am new to i have one doubt in makefile.i found that the makefileis used to compile more than one program 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, 04:45 AM   #2
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, 04:51 AM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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.


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 03:13 AM
doubt with "make check" of gcc in chapter 6 lfs_rocks Linux From Scratch 1 02-13-2008 01:15 AM
Doubt regarding PROC File novicehacker Linux - Kernel 6 12-13-2006 04:51 PM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 12:21 PM
file execution doubt pongsu Linux - General 2 09-25-2003 02:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:56 PM.

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