diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-20 22:35:20 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-20 22:35:20 +0100 |
| commit | 4f562fd273e9039d5f8d6f00ade829d47fe809f8 (patch) | |
| tree | 7af32a3a388e69fbd033bcc7f6ef600a37d024d1 /mk | |
| parent | fd6f52700ff7fbe877cfa17312fccd48e4cfd13e (diff) | |
mk: skip *coreboot* same target/tree builds
this implements the previous reverted fix, but
only for coreboot.
it's done tree-wide, but individual projects must
handle it in their mkhelpers, via if_not_skip_build
if_not_skip_build *does* universally control whether
make is executed, but not make-clean.
now we can do:
./mk -b coreboot default
this will effectively do the same thing as -d,
because no config is available there. otherwise,
we try to do -b with a config, where none exists.
if noconfig is set, then we ignore this, because
no config will ever be used.
when noconfig isn't set, it is assumed that we must
always have a config for building.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'mk')
| -rwxr-xr-x | mk | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -88,7 +88,8 @@ eval "`newvar if_not_make_config if_not_build if_not_dry_build if_not_fetch`" # these variables will also be initialised in configure_target cfgvars="autogenargs cmakedir configureargs badhash badtghash bootstrapargs \ build_depend cleanargs fetch_depend makeargs mkhelper noconfig postmake \ - premake release rev tree xarch xgcctree xlang cfgname defscan" + premake release rev tree xarch xgcctree xlang cfgname defscan \ + if_not_skip_build" eval "`newvar buildcfg dest_dir elfdir flag forcepull listfile mdir \ mkhelpercfg mode project srcdir target target_dir _tcfg \ @@ -234,6 +235,13 @@ configure_target() # filename in srcdir when copying e.g. coreboot defconfig -> .config [ -z "$cfgname" ] && cfgname="$cfgname_default" # e.g. $srcdir/.config + # if noconfig isn't set, there needs to be a config dir in xbmk. + # coreboot needs a .config or it will behave unpredictably. we will + # use the do_build macro to disable builds in this situation. this + # does not disable mkhelpers or dry builds. + [ ! -d "$target_dir/config" ] && [ "$noconfig" != "y" ] && \ + if_not_skip_build=":" # skip make on e.g. ./mk -b coreboot default + [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && \ return 1 @@ -300,7 +308,7 @@ handle_buildcfg() handle_makefile # also supports non-build operations - $if_build $if_not_dry_build \ + $if_build $if_not_dry_build $if_not_skip_build \ copy_elf; : done; : } @@ -359,7 +367,7 @@ handle_makefile() $if_build \ x_ $premake - $if_not_dry_build \ + $if_not_skip_build $if_not_dry_build \ run_make_command $if_build \ x_ $mkhelper; : @@ -368,7 +376,7 @@ handle_makefile() [ "$mode" = "savedefconfig" ] && \ _copy="defconfig" - $if_make_config \ + $if_make_config $if_not_skip_build \ x_ cp "$srcdir/$_copy" "$buildcfg"; : } |
