summaryrefslogtreecommitdiff
path: root/script/trees
diff options
context:
space:
mode:
Diffstat (limited to 'script/trees')
-rwxr-xr-xscript/trees42
1 files changed, 17 insertions, 25 deletions
diff --git a/script/trees b/script/trees
index ab321869..8bcd798c 100755
--- a/script/trees
+++ b/script/trees
@@ -8,10 +8,15 @@ set -u -e
. "include/lib.sh"
. "include/git.sh"
+. "include/rom.sh"
+
+. "config/data/pico-serprog/mkhelper.cfg"
+. "config/data/coreboot/mkhelper.cfg"
eval `setvars "" xarch cdir defconfig cmakedir xlang mode makeargs elfdir cmd \
project target target_dir targets xtree _f target1 bootstrapargs mkhelper \
- autoconfargs listfile autogenargs btype tree rev tree_depend build_depend`
+ autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
+ premake release postmake`
main()
{
@@ -46,6 +51,7 @@ main()
datadir="config/data/$project"
cfgsdir="config/$project"
listfile="$datadir/build.list" # needed on multi, optional on single
+ [ -f "$listfile" ] || listfile="" # optional on all projects
remkdir "${tmpgit%/*}"
@@ -61,7 +67,6 @@ main()
build_project()
{
configure_project "$cfgsdir" || return 0
- [ -f "$listfile" ] || listfile="" # optional on single-tree
dest_dir="$elfdir"
[ ! -f "$listfile" ] || elfcheck || return 0
@@ -77,10 +82,7 @@ build_project()
build_targets()
{
- [ "$elfdir" = "elf/coreboot" ] && elfdir="$cbelfdir"
-
[ -d "$cfgsdir" ] || $err "directory, $cfgsdir, does not exist"
- [ -f "$listfile" ] || $err "list file, $listfile, does not exist"
# Build for all targets if no argument is given
[ $# -gt 0 ] && target1="$1"
@@ -94,12 +96,16 @@ build_targets()
handle_targets()
{
for x in $targets; do
+ [ "$x" = "list" ] && x_ ls -1 "config/$project" && \
+ listfile="" && break
target="$x"
printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target"
[ "$project" != "coreboot" ] || [ -n "$mode" ] || \
[ "$target1" = "utils" ] || x_ ./vendor download $target
x_ handle_defconfig
- done
+ [ -n "$mode" ] || [ -z "$postmake" ] || $postmake || \
+ $err "$project/$target: !postmake: $postmake"; continue
+ done; return 0
}
handle_defconfig()
@@ -141,8 +147,8 @@ handle_src_tree()
configure_project()
{
- eval `setvars "" xarch xlang bootstrapargs autoconfargs xtree \
- tree_depend makeargs btype mkhelper build_depend`
+ eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \
+ tree_depend makeargs btype mkhelper bootstrapargs premake release`
[ -f "$1/target.cfg" ] || btype="auto"
[ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"`
@@ -159,6 +165,7 @@ configure_project()
&& break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"
done
+ [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1
[ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1
[ -z "$mode" ] && for bd in $build_depend; do
@@ -244,6 +251,8 @@ handle_makefile()
run_make_command()
{
+ [ -z "$premake" ] || [ -n "$mode" ] || $premake || $err "!$premake"
+
check_cmake "$cdir" && [ -z "$mode" ] && check_autoconf "$cdir"
check_makefile "$cdir" || return 1
@@ -280,23 +289,6 @@ check_makefile()
[ -f "$1/GNUmakefile" ] || return 1; return 0
}
-mkpayload_grub()
-{
- eval `setvars "" grub_modules grub_install_modules`
- eval `setcfg "$grubdata/module/$tree"`
-
- x_ rm -f "$cdir/grub.elf"
-
- "${cdir}/grub-mkstandalone" --grub-mkimage="${cdir}/grub-mkimage" \
- -O i386-coreboot -o "${cdir}/grub.elf" -d "${cdir}/grub-core/" \
- --fonts= --themes= --locales= --modules="$grub_modules" \
- --install-modules="$grub_install_modules" \
- "/boot/grub/grub_default.cfg=${cdir}/.config" \
- "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" \
- "/background.png=$grubdata/background/background1280x800.png" || \
- $err "$tree: cannot build grub.elf"; return 0
-}
-
copy_elf()
{
[ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do