All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error
@ 2017-06-30 17:00 Arnout Vandecappelle
  2017-06-30 21:17 ` Luca Ceresoli
  2017-07-01  8:11 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2017-06-30 17:00 UTC (permalink / raw)
  To: buildroot

As reported by Alessandro Power on StackOverflow [1], the behaviour
of "make toolchain" in an unconfigured tree is misleading.

When .config doesn't exist, we don't read in the package .mk files, so
"make <package>" doesn't work:

    $ make busybox
    make: *** No rule to make target 'busybox'.  Stop.

However, for "linux" and "toolchain", the corresponding file (or
actually directory) already exists. So instead, we get:

    $ make linux
    make: Nothing to be done for 'linux'.

This is confusing, because it looks as if the build succeeded.

The obvious solution is to make linux and toolchain PHONY targets when
.config doesn't exist. However, that actually does the reverse, because
then a rule _does_ exist for them and since they don't have
dependencies, make will consider them to be ready.

Therefore, we also have to provide an explicit rule for them, and
explicitly error out. Thise behaviour is still different from other
packages, but at least it is much less confusing.

[1] https://stackoverflow.com/questions/44521150

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
---
v2: Simpler way of erroring out, don't try to make all packages
    behave the same (Luca)
---
 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index 88d98e0405..470aa837ce 100644
--- a/Makefile
+++ b/Makefile
@@ -813,6 +813,14 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+# Some subdirectories are also package names. To avoid that "make linux"
+# on an unconfigured tree produces "Nothing to be done", add an explicit
+# rule for it.
+.PHONY: linux toolchain
+linux toolchain:
+	$(error Please configure Buildroot first (e.g. "make menuconfig"))
+	@exit 1
+
 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 # configuration
-- 
2.13.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error
  2017-06-30 17:00 [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error Arnout Vandecappelle
@ 2017-06-30 21:17 ` Luca Ceresoli
  2017-06-30 21:59   ` Luca Ceresoli
  2017-07-01  8:11 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Luca Ceresoli @ 2017-06-30 21:17 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

I might be wrong, but the patch title sounds wrong to me:

> Makefile: unconfigured "make toolchain" should run report error

Shouldn't it be:

  Makefile: unconfigured "make toolchain" should report an error

?

On 30/06/2017 19:00, Arnout Vandecappelle (Essensium/Mind) wrote:
> As reported by Alessandro Power on StackOverflow [1], the behaviour
> of "make toolchain" in an unconfigured tree is misleading.
> 
> When .config doesn't exist, we don't read in the package .mk files, so
> "make <package>" doesn't work:
> 
>     $ make busybox
>     make: *** No rule to make target 'busybox'.  Stop.
> 
> However, for "linux" and "toolchain", the corresponding file (or
> actually directory) already exists. So instead, we get:
> 
>     $ make linux
>     make: Nothing to be done for 'linux'.
> 
> This is confusing, because it looks as if the build succeeded.
> 
> The obvious solution is to make linux and toolchain PHONY targets when
> .config doesn't exist. However, that actually does the reverse, because
> then a rule _does_ exist for them and since they don't have
> dependencies, make will consider them to be ready.
> 
> Therefore, we also have to provide an explicit rule for them, and
> explicitly error out. Thise behaviour is still different from other

s/Thise/This/

With the above fixed:
Tested by: Luca Ceresoli <luca@lucaceresoli.net>
Acked by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error
  2017-06-30 21:17 ` Luca Ceresoli
@ 2017-06-30 21:59   ` Luca Ceresoli
  0 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2017-06-30 21:59 UTC (permalink / raw)
  To: buildroot

Hi,

On 30/06/2017 23:17, Luca Ceresoli wrote:
[...]> With the above fixed:
> Tested by: Luca Ceresoli <luca@lucaceresoli.net>
> Acked by: Luca Ceresoli <luca@lucaceresoli.net>

Oops, wrong tag syntax, so patchwork doesn't catch them.

Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error
  2017-06-30 17:00 [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error Arnout Vandecappelle
  2017-06-30 21:17 ` Luca Ceresoli
@ 2017-07-01  8:11 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-07-01  8:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 30 Jun 2017 19:00:33 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> As reported by Alessandro Power on StackOverflow [1], the behaviour
> of "make toolchain" in an unconfigured tree is misleading.
> 
> When .config doesn't exist, we don't read in the package .mk files, so
> "make <package>" doesn't work:
> 
>     $ make busybox
>     make: *** No rule to make target 'busybox'.  Stop.
> 
> However, for "linux" and "toolchain", the corresponding file (or
> actually directory) already exists. So instead, we get:
> 
>     $ make linux
>     make: Nothing to be done for 'linux'.
> 
> This is confusing, because it looks as if the build succeeded.
> 
> The obvious solution is to make linux and toolchain PHONY targets when
> .config doesn't exist. However, that actually does the reverse, because
> then a rule _does_ exist for them and since they don't have
> dependencies, make will consider them to be ready.
> 
> Therefore, we also have to provide an explicit rule for them, and
> explicitly error out. Thise behaviour is still different from other
> packages, but at least it is much less confusing.
> 
> [1] https://stackoverflow.com/questions/44521150
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> v2: Simpler way of erroring out, don't try to make all packages
>     behave the same (Luca)
> ---
>  Makefile | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied to master, thanks. And yes, I forgot to fix the commit title
when applying. Sorry :-/

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-01  8:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 17:00 [Buildroot] [PATCH v2] Makefile: unconfigured "make toolchain" should run report error Arnout Vandecappelle
2017-06-30 21:17 ` Luca Ceresoli
2017-06-30 21:59   ` Luca Ceresoli
2017-07-01  8:11 ` Thomas Petazzoni

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.