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, Luotao Fu <l.fu@pengutronix.de>
Subject: [PATCH 2/2] move parsing and check for default env into common makefile
Date: Fri, 16 Apr 2010 09:08:50 +0200	[thread overview]
Message-ID: <1271401730-30665-3-git-send-email-l.fu@pengutronix.de> (raw)
In-Reply-To: <1271401730-30665-1-git-send-email-l.fu@pengutronix.de>

The CONFIG_DEFAULT_ENVRIONMENT_PATH is used only while building common stuffs.
Hence Having parsing and sanity check for CONFIG_DEFAULT_ENVRIONMENT_PATH in the
main Makefile does not make a lot sense. Move these stuffs into to
common/Makefile to fix this. This also fixes the issue, that the barebox could
not deal with absolute path in CONFIG_DEFAULT_ENVRIONMENT_PATH.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
---
 Makefile        |   24 ------------------------
 common/Makefile |   28 +++++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/Makefile b/Makefile
index ec7fb10..282e6c6 100644
--- a/Makefile
+++ b/Makefile
@@ -1288,27 +1288,3 @@ Makefile: ;
 # information in a variable se we can use it in if_changed and friends.
 .PHONY: $(PHONY)
 
-#
-# sanity checks for check default environemnt
-#
-ifdef CONFIG_DEFAULT_ENVIRONMENT
-
-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)" 2> /dev/null && /bin/pwd)
-$(if $(CONFIG_DEFAULT_ENVIRONMENT_PATH),, \
-	$(error default environment path $(saved-env_path) does not exist))
-
-endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
diff --git a/common/Makefile b/common/Makefile
index 0c075a9..a928f5c 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -19,12 +19,34 @@ obj-$(CONFIG_MODULES) += module.o
 extra-$(CONFIG_MODULES) += module.lds
 
 ifdef CONFIG_DEFAULT_ENVIRONMENT
+#
+# sanity checks for check default environemnt
+#
+
+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)" 2> /dev/null && /bin/pwd)
+$(if $(CONFIG_DEFAULT_ENVIRONMENT_PATH),, \
+	$(error default environment path $(saved-env_path) does not exist))
+
 $(obj)/startup.o: include/barebox_default_env.h
 $(obj)/env.o: include/barebox_default_env.h
 
-ENV_FILES := $(shell find $(srctree)/$(CONFIG_DEFAULT_ENVIRONMENT_PATH))
-endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
+ENV_FILES := $(shell find $(CONFIG_DEFAULT_ENVIRONMENT_PATH))
 
 include/barebox_default_env.h: $(ENV_FILES)
-	$(Q)scripts/bareboxenv -s $(srctree)/$(CONFIG_DEFAULT_ENVIRONMENT_PATH) barebox_default_env
+	$(Q)scripts/bareboxenv -s $(CONFIG_DEFAULT_ENVIRONMENT_PATH) barebox_default_env
 	$(Q)cat barebox_default_env | scripts/bin2c default_environment > $@
+endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
-- 
1.7.0


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

      parent 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 ` [PATCH 1/2] Makefile: fix detection of absolute environment path Luotao Fu
2010-04-16  7:08 ` Luotao Fu [this message]

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-3-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