Merge pull request #2518 from MilhouseVH/le90_save_build_config

buildsystem: save/load build config, simplify clean and build --all
This commit is contained in:
Christian Hewitt 2018-02-25 14:13:37 +04:00 committed by GitHub
commit 15c3e9e90c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View File

@ -765,6 +765,22 @@ check_path() {
fi
}
load_build_config() {
if [ -d "${1}" -a -f ${1}/.build.conf ]; then
source ${1}/.build.conf
return 0
fi
return 1
}
save_build_config() {
local var
rm -f ${BUILD}/.build.conf
for var in PROJECT DEVICE ARCH DEBUG BUILD_SUFFIX; do
echo "export ${var}=\"${!var}\"" >> ${BUILD}/.build.conf
done
}
check_config() {
dashes="==========================="
if [ ! -d $PROJECT_DIR/$PROJECT ]; then

View File

@ -20,6 +20,15 @@
. config/options $1
if [ "$1" = "--all" ]; then
if [ ! -z "$2" ]; then
for build_dir in $(ls -1d ${ROOT}/build.*); do
load_build_config ${build_dir} && ./scripts/build $2
done
fi
exit 0
fi
if [ -z "$1" ]; then
echo "usage: $0 package_name[:<host|target|init|bootstrap>]"
exit 1

View File

@ -48,14 +48,8 @@ clean_package() {
if [ "$1" = "--all" ]; then
if [ ! -z "$2" ]; then
for PROJECT in $(ls -1 projects); do
for archfile in projects/$PROJECT/linux/linux.*.conf; do
if [ ! -f "$archfile" ]; then
archfile="$(ls -1 projects/$PROJECT/linux/*/linux.*.conf | head -1)"
fi
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
PROJECT=$PROJECT ARCH=$ARCH ./scripts/clean $2
done
for build_dir in $(ls -1d ${ROOT}/build.*); do
load_build_config "${build_dir}" && ./scripts/clean $2
done
fi
else

View File

@ -25,6 +25,8 @@ unset _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL _DEBUG_DEPENDS_LIST _DEBUG_PACK
. config/show_config
show_config
save_build_config
setup_toolchain target
$SCRIPTS/checkdeps