Skip to content

fix(config): fix config dep tracking and reorganise config build dir#343

Open
josecm wants to merge 3 commits into
mainfrom
fix/config-build
Open

fix(config): fix config dep tracking and reorganise config build dir#343
josecm wants to merge 3 commits into
mainfrom
fix/config-build

Conversation

@josecm

@josecm josecm commented Apr 3, 2026

Copy link
Copy Markdown
Member
  • Fix incbin dependency tracking: config objects are now routed directly
    into config_build_dir so the -MT target in the dep rule always matches
    the actual object location. Previously, changes to embedded guest
    binaries would not trigger a recompile.
  • Pin all: as the default make target before any -include directives,
    preventing targets from included makefiles (e.g. config.mk from an
    external CONFIG_REPO) from silently becoming the default.
  • Organise all config build artefacts under config_build_dir: relative
    config-objs-y mirror the config_dir layout, absolute-path entries go
    under external/, and config_defs_gen.h moves to inc/.

josecm added 3 commits April 2, 2026 21:08
The config dep rule used statically computed config_obj and config_dep
variables derived from config_build_dir, which did not match the actual
object path after the cur_dir/config_dir → build_dir remapping applied
to objs-y. As a result, .incbin extra dependencies were silently
tracking the wrong target and changes to embedded binary files would
not trigger a recompile of the config object.

Fix by routing all config-objs-y directly into config_build_dir after
the remapping step, so the actual object location is always known.
Replace the static config_obj/config_dep pair with a single config_dep
path derived from config_build_dir, and derive the -MT object target
dynamically from $@ so both always agree. Also add a dedicated dep
pattern rule for config_build_dir so out-of-tree config sources are
found correctly.

Absolute-path entries in config-objs-y are mapped under build_dir
preserving the full path, matching the previous behaviour.

Signed-off-by: Jose Martins <josemartins90@gmail.com>
Declare an empty all: rule before any -include directives so that the
default target is always all, regardless of targets defined in any
included makefile (e.g. config.mk from an external CONFIG_REPO).

Signed-off-by: Jose Martins <josemartins90@gmail.com>
Organise the config portion of the build tree:

- config_defs_gen.h moves to config_build_dir/inc/ and inc_dirs is
  updated accordingly.
- Absolute-path config-objs-y entries move from build_dir to
  config_build_dir/external/, preserving the full filesystem path for
  traceability. A dedicated dep rule is added for this location.

Signed-off-by: Jose Martins <josemartins90@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant