* Patches for default environment path handling
@ 2010-04-16 7:08 Luotao Fu
2010-04-16 7:08 ` [PATCH 1/2] Makefile: fix detection of absolute environment path Luotao Fu
2010-04-16 7:08 ` [PATCH 2/2] move parsing and check for default env into common makefile Luotao Fu
0 siblings, 2 replies; 3+ messages in thread
From: Luotao Fu @ 2010-04-16 7:08 UTC (permalink / raw)
To: sha; +Cc: barebox
Hi Sascha,
following patches fix handling of default environment path in barebox makefiles.
With them we can now finally use absolute paths for
CONFIG_DEFAULT_ENVRIONMENT_PATH. \o/. Tested with both normal and out-of-tree
building.
cheers
Fu
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] Makefile: fix detection of absolute environment path
2010-04-16 7:08 Patches for default environment path handling Luotao Fu
@ 2010-04-16 7:08 ` Luotao Fu
2010-04-16 7:08 ` [PATCH 2/2] move parsing and check for default env into common makefile Luotao Fu
1 sibling, 0 replies; 3+ messages in thread
From: Luotao Fu @ 2010-04-16 7:08 UTC (permalink / raw)
To: sha; +Cc: barebox
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] move parsing and check for default env into common makefile
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
1 sibling, 0 replies; 3+ messages in thread
From: Luotao Fu @ 2010-04-16 7:08 UTC (permalink / raw)
To: sha; +Cc: barebox, Luotao Fu
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-16 7:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] move parsing and check for default env into common makefile Luotao Fu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox