Rationale
- Kconfig with the
--sync-depsflag creates a directory tree in the $(BINDIR) folder - This directory tree contains dummy header files for each Kconfig configuration symbol
fixdepis a tool from the linux kernel [1] to rewrite dependency files (*.d) to include the corresponding dummy header files- This way,
makeis able to draw correct dependencies between compilation units and configuration symbols - =>
--sync-depsandfixdepenable incremental compilations, i.e., only those compilation units are rebuilt, which are affected by configuration changes.
[1] 83bdc7275e/scripts/basic/fixdep.c
Changes to the original script
The patch file fixdep_riot.patch contains a few necessary changes
and enhancements to fixdep.c in order to make the generated *.d
dependency files compatible with our build system.
- The input parameters of
fixdepare changed to:./fixdep <dependency_file> <target> <sync_deps_dir> - The hardcoded
include/configfolder location infixdep.cis changed to be configurable (passed from the command line) - Our Kconfig integration does not use the
_MODULEsuffix for configurations. This is reflected in the parsing functionality offixdep.c