mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Luotao Fu <l.fu@pengutronix.de>
To: sha@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: [PATCH 1/2] Makefile: fix detection of absolute environment path
Date: Fri, 16 Apr 2010 09:08:49 +0200	[thread overview]
Message-ID: <1271401730-30665-2-git-send-email-l.fu@pengutronix.de> (raw)
In-Reply-To: <1271401730-30665-1-git-send-email-l.fu@pengutronix.de>

From: Marc Kleine-Budde <mkl@pengutronix.de>

string-type config symbols als wrapped in quotes ("), remove them before
trying to detect an absolute path.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 Makefile |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c92c5dd..ec7fb10 100644
--- a/Makefile
+++ b/Makefile
@@ -1293,12 +1293,21 @@ Makefile: ;
 #
 ifdef CONFIG_DEFAULT_ENVIRONMENT
 
-ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_PATH),"")
+quote :="#"
+
+define remove_quotes
+$(strip $(subst $(quote),,$(1)))
+endef
+
+CONFIG_DEFAULT_ENVIRONMENT_PATH := $(call remove_quotes, $(CONFIG_DEFAULT_ENVIRONMENT_PATH))
+
+ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_PATH),)
 $(error default environment path empty))
 endif
 
 saved-env_path := $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
-CONFIG_DEFAULT_ENVIRONMENT_PATH := $(shell cd $(if $(filter /%,$(CONFIG_DEFAULT_ENVIRONMENT_PATH)),,$(srctree)/)$(CONFIG_DEFAULT_ENVIRONMENT_PATH) && /bin/pwd)
+CONFIG_DEFAULT_ENVIRONMENT_PATH := \
+	$(shell cd "$(if $(filter /%,$(CONFIG_DEFAULT_ENVIRONMENT_PATH)),,$(srctree)/)$(CONFIG_DEFAULT_ENVIRONMENT_PATH)" 2> /dev/null && /bin/pwd)
 $(if $(CONFIG_DEFAULT_ENVIRONMENT_PATH),, \
 	$(error default environment path $(saved-env_path) does not exist))
 
-- 
1.7.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-04-16  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16  7:08 Patches for default environment path handling Luotao Fu
2010-04-16  7:08 ` Luotao Fu [this message]
2010-04-16  7:08 ` [PATCH 2/2] move parsing and check for default env into common makefile Luotao Fu

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=1271401730-30665-2-git-send-email-l.fu@pengutronix.de \
    --to=l.fu@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /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