LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-20-2008, 09:01 PM   #1
leon.zcom
LQ Newbie
 
Registered: Apr 2008
Posts: 15

Rep: Reputation: 0
kernel toplevel makefile problem


Recently I am studying kernel toplevel makefile, and I think the makefile is complicated, so could anyone tell me how to read the makefile, sequence or not? thank you!

another question is in the makefile, it has the sentence as follow:

srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))

Both KBUILD_SRC and CURDIR didn't defined. so the value srctree is NULL??

-------------------------------------------------
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 17
 
Old 05-21-2008, 11:09 PM   #2
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

The most basic way to look at a Makefile is

Quote:
tag : action
and they can be nested. So these lines

Quote:
all : binaries docs
binaries : touch binaries
docs: touch docs
If you called "Makefile all", it would do binaries and docs. If you called "Makefile binaries" or "Makefile docs", it would only use that one. You can set variables and a lot more in there, but that's basic part of it.

Hope that helps

Mike
 
Old 05-21-2008, 11:11 PM   #3
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Sorry,

For your first question, I'm guessing, but those variables might be set by the configure script, if you have to run one. Sometimes people define them in the Makefile, but you can reference variables out the actual file as long as they're exported in the subshell you're running in

Mike
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove all (dot) files without removing toplevel dir? mattengland Linux - Software 8 07-19-2011 02:57 PM
obj-y in kernel 2.6 makefile creating problem. raklo Linux - Kernel 0 02-08-2007 12:00 AM
makefile to compile kernel? RIgimp75 Slackware 7 07-19-2006 01:42 AM
kernel Makefile question feetyouwell Linux - Software 0 11-16-2004 11:36 AM
How to create a Kernel 2.6 Makefile 7.e.Q Programming 1 11-03-2004 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:08 AM.

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
Open Source Consulting | Domain Registration