kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: wbin00@gmail.com (Bin Wang)
To: kernelnewbies@lists.kernelnewbies.org
Subject: When does Makefile init the variables like KBUILD_OUTPUT
Date: Fri, 18 Jan 2013 10:42:51 +0800	[thread overview]
Message-ID: <50F8B6AB.4030709@gmail.com> (raw)
In-Reply-To: <50F76155.3000506@gmail.com>

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?

      reply	other threads:[~2013-01-18  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17  2:26 When does Makefile init the variables like KBUILD_OUTPUT Bin Wang
2013-01-18  2:42 ` Bin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F8B6AB.4030709@gmail.com \
    --to=wbin00@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).