When does Makefile init the variables like KBUILD_OUTPUT

Bin Wang wbin00 at gmail.com
Thu Jan 17 21:42:51 EST 2013


On 2013/01/17/ 10:26, Bin Wang wrote:
> Hi, all
>
> The kernel Makefile init the variables like KBUILD_OUTPUT outside any 
> target's make process. But when I try to output the KBUILD_OUTPUT in 
> the target's make process, for example, the target "help", I find it 
> is not defined. I want to know when will it init? Thanks a lot

However, when I just write a Makefile with this:

|ifeq ("$(origin O)", "command line")
   KBUILD_OUTPUT := $(O)
endif

help:
     @echo 'KBUILD_OUTPUT: ${KBUILD_OUTPUT}'
|

Then I run|make O=../build help|, I will see|KBUILD_OUTPUT: ../build|.

Is there anything special in kernel's Makefile?





More information about the Kernelnewbies mailing list