Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Makefile: drop redundant shell call when deriving BASE_DIR
@ 2016-11-23  2:31 Danomi Manchego
  2016-11-27 22:16 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Danomi Manchego @ 2016-11-23  2:31 UTC (permalink / raw)
  To: buildroot

Commit 173135df5b69dfd5ae6fe6cf2de8833c6f74c143 ("core: re-enter make if
$(CURDIR) or $(O) are not canonical paths") introduced the CANONICAL_O
variable, defined as:

CANONICAL_O := $(shell mkdir -p $(O) >/dev/null 2>&1)$(realpath $(O))

This duplicates the definition of BASE_DIR, by different means:

BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)

So one of these shell calls is redundant. CANONICAL_O is defined first,
so this commit replaces the BASE_DIR derivation with $(CANONICAL_O).

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 37e4bd4..a4a6147 100644
--- a/Makefile
+++ b/Makefile
@@ -165,10 +165,10 @@ endif
 
 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
 # set, so unset it here to not cause problems. Notice that the export
-# line doesn't affect the environment of $(shell ..) calls, so
-# explictly throw away any output from 'cd' here.
+# line doesn't affect the environment of $(shell ..) calls.
 export CDPATH :=
-BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
+
+BASE_DIR := $(CANONICAL_O)
 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
 
 
-- 
1.9.1

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

* [Buildroot] [PATCH 1/1] Makefile: drop redundant shell call when deriving BASE_DIR
  2016-11-23  2:31 [Buildroot] [PATCH 1/1] Makefile: drop redundant shell call when deriving BASE_DIR Danomi Manchego
@ 2016-11-27 22:16 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-11-27 22:16 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 22 Nov 2016 21:31:31 -0500, Danomi Manchego wrote:
> Commit 173135df5b69dfd5ae6fe6cf2de8833c6f74c143 ("core: re-enter make if
> $(CURDIR) or $(O) are not canonical paths") introduced the CANONICAL_O
> variable, defined as:
> 
> CANONICAL_O := $(shell mkdir -p $(O) >/dev/null 2>&1)$(realpath $(O))
> 
> This duplicates the definition of BASE_DIR, by different means:
> 
> BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
> 
> So one of these shell calls is redundant. CANONICAL_O is defined first,
> so this commit replaces the BASE_DIR derivation with $(CANONICAL_O).
> 
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
> ---
>  Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to next, thanks.

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

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

end of thread, other threads:[~2016-11-27 22:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-23  2:31 [Buildroot] [PATCH 1/1] Makefile: drop redundant shell call when deriving BASE_DIR Danomi Manchego
2016-11-27 22:16 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox