LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   kernel toplevel makefile problem (https://www.linuxquestions.org/questions/linux-general-1/kernel-toplevel-makefile-problem-643642/)

leon.zcom 05-20-2008 09:01 PM

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

eggixyz 05-21-2008 11:09 PM

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

eggixyz 05-21-2008 11:11 PM

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


All times are GMT -5. The time now is 12:32 PM.