Skip to contentSkip to conversation

When does Makefile init the variables like KBUILD_OUTPUT

DISCUSSION Bin Wang 1 participant 2 messages Jan 17, 2013 – Jan 18, 2013

lore
Share & tools
lore

Bin Wang

author
#0 lore raw

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.

Bin Wang

author
#1 lore raw
Quoted 6 lines · Bin Wang

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?