All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>, LKML <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: single target builds are broken
Date: Tue, 31 Mar 2020 18:49:19 +0900	[thread overview]
Message-ID: <CAK7LNAQ8LZMPxrjVkuLizHjVZyBtSmLFZ=EvDCCAPb-XGfJLHA@mail.gmail.com> (raw)
In-Reply-To: <a5ce79eb-be9d-df97-0b58-5aee5a48f4d3@oracle.com>

On Tue, Mar 31, 2020 at 6:16 PM Vegard Nossum <vegard.nossum@oracle.com> wrote:
>
>
> Hi,
>
> I often run 'make foo/bar.o' as part of my workflow, even when bar.o is
> not specified in any kernel makefile, and this has worked just fine for
> years.
>
> This is broken after commit 394053f4a4b3e3eeeaa67b67fc886a9a75bd9e4d
> (kbuild: make single targets work more correctly) and just gives an error:
>
> $ make kernel/test.o
>    CALL    scripts/checksyscalls.sh
>    CALL    scripts/atomic/check-atomics.sh
>    DESCEND  objtool
> make[2]: *** No rule to make target 'kernel/test.o'.  Stop.
> scripts/Makefile.build:502: recipe for target '__build' failed
> make[1]: *** [__build] Error 2
> Makefile:1670: recipe for target 'kernel' failed
> make: *** [kernel] Error 2


This is intentional to make the single target builds
work in the same manner as the normal builds.


The necessary CONFIG dependency must be met.

obj-$(CONFIG_FOO) += foo.o

foo.o can be built only when CONFIG_FOO is y/m.



> For top-level objects (e.g. 'make bar.o') the situation is even worse,
> since make exits with status 0 without building anything :-/


There is no .c or .S file at the top-level of the kernel source tree.

'make bar.o' never happens.



> Is there any chance we can get this back? It was super useful for me.


What you want is "Let's build whatever", right?

No, please add 'obj-y += test.o' if you want to
test your local file.


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2020-03-31  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31  9:16 single target builds are broken Vegard Nossum
2020-03-31  9:49 ` Masahiro Yamada [this message]
2020-03-31 11:01   ` Vegard Nossum
2020-03-31 16:03     ` Masahiro Yamada
2020-03-31 17:56       ` Joe Perches

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='CAK7LNAQ8LZMPxrjVkuLizHjVZyBtSmLFZ=EvDCCAPb-XGfJLHA@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.