lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>9020vga
parent
0c1d08d8b1
commit
bc87b5f67e
|
@ -53,7 +53,6 @@ check_project()
|
||||||
p_="x_ printf \"%s\\n\" \"\$$p\" > $p"
|
p_="x_ printf \"%s\\n\" \"\$$p\" > $p"
|
||||||
eval "x$p_ || $p_"
|
eval "x$p_ || $p_"
|
||||||
done
|
done
|
||||||
|
|
||||||
export LOCALVERSION="-${projectname}-${version%%-*}"
|
export LOCALVERSION="-${projectname}-${version%%-*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,9 @@ scan_config()
|
||||||
set ${line} 1>/dev/null 2>/dev/null || :
|
set ${line} 1>/dev/null 2>/dev/null || :
|
||||||
if [ "${1%:}" = "depend" ]; then
|
if [ "${1%:}" = "depend" ]; then
|
||||||
depend="${depend} ${2}"
|
depend="${depend} ${2}"
|
||||||
continue
|
else
|
||||||
|
eval "${1%:}=\"${2}\""
|
||||||
fi
|
fi
|
||||||
eval "${1%:}=\"${2}\""
|
|
||||||
done << EOF
|
done << EOF
|
||||||
$(eval "awk '${awkstr}' \"${revfile}\"")
|
$(eval "awk '${awkstr}' \"${revfile}\"")
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -44,11 +44,7 @@ main()
|
||||||
build_projects()
|
build_projects()
|
||||||
{
|
{
|
||||||
[ $# -gt 0 ] && x_ ./update trees $_f $@
|
[ $# -gt 0 ] && x_ ./update trees $_f $@
|
||||||
|
[ "$mode" = "fetch" ] && eval "fetch_project_repo; return 0;"
|
||||||
if [ "${mode}" = "fetch" ]; then
|
|
||||||
fetch_project_repo
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
codedir="src/${project}"
|
codedir="src/${project}"
|
||||||
[ -d "$codedir" ] || x_ ./update trees -f "$project"
|
[ -d "$codedir" ] || x_ ./update trees -f "$project"
|
||||||
|
@ -86,7 +82,6 @@ build_targets()
|
||||||
[ $# -gt 0 ] && targets=$@
|
[ $# -gt 0 ] && targets=$@
|
||||||
|
|
||||||
[ -z "$mode" ] && x_ mkdir -p "$elfdir"
|
[ -z "$mode" ] && x_ mkdir -p "$elfdir"
|
||||||
|
|
||||||
handle_targets
|
handle_targets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,10 +106,8 @@ handle_defconfig()
|
||||||
{
|
{
|
||||||
handle_src_tree "$target" || return 0
|
handle_src_tree "$target" || return 0
|
||||||
|
|
||||||
if [ "$target1" = "utils" ] && [ "$project" = "coreboot" ]; then
|
[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && \
|
||||||
handle_coreboot_utils "$tree"
|
eval "handle_coreboot_utils \"$tree\"; return 0"
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for y in "${target_dir}/config"/*; do
|
for y in "${target_dir}/config"/*; do
|
||||||
[ -f "$y" ] || continue
|
[ -f "$y" ] || continue
|
||||||
|
@ -133,11 +126,7 @@ handle_defconfig()
|
||||||
handle_src_tree()
|
handle_src_tree()
|
||||||
{
|
{
|
||||||
target_dir="${cfgsdir}/${target}"
|
target_dir="${cfgsdir}/${target}"
|
||||||
|
[ "$mode" = "fetch" ] && eval "fetch_project_trees; return 1;"
|
||||||
if [ "$mode" = "fetch" ]; then
|
|
||||||
fetch_project_trees
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
x_ mkdir -p "${elfdir}/${target}"
|
x_ mkdir -p "${elfdir}/${target}"
|
||||||
eval "$(setvars "" xarch xlang tree)"
|
eval "$(setvars "" xarch xlang tree)"
|
||||||
|
@ -236,7 +225,6 @@ copy_elf()
|
||||||
[ ! -f "${codedir}/$f" ] || \
|
[ ! -f "${codedir}/$f" ] || \
|
||||||
x_ cp "${codedir}/${f}" "$dest_dir"
|
x_ cp "${codedir}/${f}" "$dest_dir"
|
||||||
done < "$listfile"
|
done < "$listfile"
|
||||||
|
|
||||||
x_ make clean -C "$codedir"
|
x_ make clean -C "$codedir"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue