diff mbox series

[2/4] kbuild: move "_all" target out of $(KBUILD_SRC) conditional

Message ID 1507089367-10402-2-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit ba634eceb535d95e87ef09caae7814b3687c6036
Headers show
Series [1/4] kbuild: replace $(hdr-arch) with $(SRCARCH) | expand

Commit Message

Masahiro Yamada Oct. 4, 2017, 3:56 a.m. UTC
The first "_all" occurrence around line 120 is only visible when
KBUILD_SRC is unset.

If O=... is specified, the working directory is relocated, then the
only second occurrence around line 193 is visible, that is not set
to PHONY.

Move the first one to an always visible place.  This clarifies "_all"
is our default target and it is always set to PHONY.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4

Comments

Doug Anderson Oct. 9, 2017, 10:02 p.m. UTC | #1
Hi,

On Tue, Oct 3, 2017 at 8:56 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The first "_all" occurrence around line 120 is only visible when

> KBUILD_SRC is unset.

>

> If O=... is specified, the working directory is relocated, then the

> only second occurrence around line 193 is visible, that is not set

> to PHONY.

>

> Move the first one to an always visible place.  This clarifies "_all"

> is our default target and it is always set to PHONY.

>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

>

>  Makefile | 8 ++++----

>  1 file changed, 4 insertions(+), 4 deletions(-)


I'm a professed non-expert on the kernel build so take my review FWIW...

I'd definitely agree that it looks like it was a bug (though not a
huge one) that it was possible for "_all" not to get marked PHONY.
Other than that this change just makes things a little more readable
since (if I followed all the Makefile code properly) prior to your
change "_all" always ended up being the default rule, just in a very
roundabout way.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Masahiro Yamada Oct. 10, 2017, 11:53 a.m. UTC | #2
2017-10-04 12:56 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> The first "_all" occurrence around line 120 is only visible when

> KBUILD_SRC is unset.

>

> If O=... is specified, the working directory is relocated, then the

> only second occurrence around line 193 is visible, that is not set

> to PHONY.

>

> Move the first one to an always visible place.  This clarifies "_all"

> is our default target and it is always set to PHONY.

>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>



Applied to linux-kbuild/kbuild.



-- 
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 8d900ba..39a7c03 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,10 @@  NAME = Fearless Coyote
 # Comments in this file are targeted only to the developer, do not
 # expect to learn how to build the kernel reading this file.
 
+# That's our default target when none is given on the command line
+PHONY := _all
+_all:
+
 # o Do not use make's built-in rules and variables
 #   (this increases performance and avoids hard-to-debug behaviour);
 # o Look for make include files relative to root of kernel src
@@ -116,10 +120,6 @@  ifeq ("$(origin O)", "command line")
   KBUILD_OUTPUT := $(O)
 endif
 
-# That's our default target when none is given on the command line
-PHONY := _all
-_all:
-
 # Cancel implicit rules on top Makefile
 $(CURDIR)/Makefile Makefile: ;