When does Makefile init the variables like KBUILD_OUTPUT
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
Quoted 6 lines · Bin Wang
Hi, all
The kernel
Makefileinit the variables likeKBUILD_OUTPUToutside any target's make process. But when I try to output theKBUILD_OUTPUTin 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?