From mboxrd@z Thu Jan 1 00:00:00 1970 From: wbin00@gmail.com (Bin Wang) Date: Fri, 18 Jan 2013 10:42:51 +0800 Subject: When does Makefile init the variables like KBUILD_OUTPUT In-Reply-To: <50F76155.3000506@gmail.com> References: <50F76155.3000506@gmail.com> Message-ID: <50F8B6AB.4030709@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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?