9
0
Fork 0

barebox_default_env: fix out of tree build

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2010-07-21 17:05:22 +02:00 committed by Sascha Hauer
parent 6ffe2ec8cd
commit d879de38e8
2 changed files with 10 additions and 6 deletions

View File

@ -26,6 +26,8 @@ ENV_FILES := $(shell cd $(srctree); for i in $(CONFIG_DEFAULT_ENVIRONMENT_PATH);
endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
include/barebox_default_env.h: $(ENV_FILES)
$(Q)scripts/genenv $(srctree) $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
$(Q)cat barebox_default_env | scripts/bin2c default_environment > $@
barebox_default_env: $(ENV_FILES)
$(Q)$(srctree)/scripts/genenv $(srctree) $(objtree) $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
include/barebox_default_env.h: barebox_default_env
$(Q)cat $< | $(objtree)/scripts/bin2c default_environment > $@

View File

@ -1,17 +1,19 @@
#!/bin/bash
# Generate the default environment file from a list of directories
# usage: genenv <basedir> <dir>...
# usage: genenv <basedir> <objdir> <dir>...
# where <basedir> is the base directory for relative pathes in <dir>
# where <objdir> is the base directory for relative pathes for result
objtree=$2
cd $1 || exit 1
shift
shift 2
tempdir=$(mktemp -d)
for i in $*; do
cp -r $i/* $tempdir
done
scripts/bareboxenv -s $tempdir barebox_default_env
$objtree/scripts/bareboxenv -s $tempdir $objtree/barebox_default_env
rm -r $tempdir