[riot-commits] [RIOT-OS/RIOT] 3628db: Makefile.features: Allow "one out of" dependencies

Leandro Lanzieri noreply at github.com
Thu Apr 2 10:40:48 CEST 2020


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 3628db19fd330c245b9049bfc084263399444bec
      https://github.com/RIOT-OS/RIOT/commit/3628db19fd330c245b9049bfc084263399444bec
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M Makefile.features
    M doc/doxygen/src/build-system-basics.md
    M makefiles/info.inc.mk

  Log Message:
  -----------
  Makefile.features: Allow "one out of" dependencies

An application/test/module that requires one feature out of a set of
alternatives (let's say either periph_uart, periph_spi, or periph_i2c) can
request this now using:

    FEATURES_REQUIRED_ANY += periph_uart|periph_spi|periph_i2c


  Commit: 007ac492ff2ccd135022aab569d8b2f1a7896b6f
      https://github.com/RIOT-OS/RIOT/commit/007ac492ff2ccd135022aab569d8b2f1a7896b6f
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M drivers/Makefile.dep
    M tests/driver_ws281x/Makefile

  Log Message:
  -----------
  drivers/ws281x: Use FEATURES_REQUIRED_ANY


  Commit: 7bc15acee25447b1102c1b3e70067995833ef5c3
      https://github.com/RIOT-OS/RIOT/commit/7bc15acee25447b1102c1b3e70067995833ef5c3
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M Makefile.dep
    M Makefile.features
    M Makefile.include
    A makefiles/dependency_resolution.inc.mk
    A makefiles/features_check.inc.mk
    A makefiles/features_modules.inc.mk
    M makefiles/info-global.inc.mk

  Log Message:
  -----------
  build system: Restructure dependency resolution

Goals:
- Untangle dependency resolution and feature checking for better maintainability
- Improve performance of "make info-boards-supported"

Changes:
- Makefile.dep
    - Dropped handling of default modules and recursion
    - Now only dependencies of the current set of used modules and pkgs are
      added
  ==> External recursion is needed to catch transient dependencies
- Changed Makefile.features:
    - Dropped checking of provided features
    - Dropped populating FEATURES_USED with provided features that are required
      or optional
    - Dropped populating FEATURES_MISSING with required but not provided
      features
    - Dropped adding modules implementing used features to USE_MODULE
  ==> This now only populates FEATURES_PROVIDED, nothing more
- Added makefiles/features_check.inc.mk:
    - This performs the population of FEATURES_USED and FEATURES_MISSING now
- Added makefiles/features_modules.inc.mk:
    - This performs now the addition of modules implementing used features
- Added makefiles/dependency_resolution.inc.mk:
    - This now performs the recursion required to catch transient dependencies
    - Also the feature check is performed recursively to handle also required
      and optional features of the transient dependencies
    - DEFAULT_MODULES are added repeatedly to allow it to be extended based on
      used features and modules
      ==> This allows modules to have optional dependencies, as these
          dependencies can be blacklisted
- Use simply expanded variables instead of recursively expended variables
  (`foo := $(bar)` instead `foo = $(bar)`) for internal variables during feature
  resolution. This improves performance significantly for
  `make info-boards-supported`.
- Reduce dependency resolution steps in `make info-boards-supported`
    - Globally resolve dependencies without any features (including arch)
      provided
      ==> This results in the common subset of feature requirements and modules
          used
        - But for individual boards additional modules might be used on top due
          to architecture specific dependencies or optional features
    - Boards not supporting this subset of commonly required features are not
      supported, so no additional dependency resolution is needed for them
    - For each board supporting the common set of requirements a complete
      dependency resolution is still needed to also catch architecture specific
      hacks
         - But this resolution is seeded with the common set of dependencies to
           speed this up


  Commit: af21f15b02909d3525e19a9a4a79b5e92e4d7c91
      https://github.com/RIOT-OS/RIOT/commit/af21f15b02909d3525e19a9a4a79b5e92e4d7c91
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M bootloaders/riotboot/Makefile
    M makefiles/dependencies_debug.inc.mk
    M makefiles/features_check.inc.mk
    M tests/minimal/Makefile
    M tests/unittests/Makefile

  Log Message:
  -----------
  makefiles: Minor clean ups

- Add FEATURES_REQUIRED_ANY to dependency-debug:
  Now `make dependency-debug` by default also stores the contents of
  `FEATURES_REQUIRED_ANY`.
- makefiles/features_check.inc.mk: Break long lines
- {tests/minimal,tests/unittests,bootloaders/riotboot}:
  Disable auto_init_% in addition to auto_init.

This works around weird behavior due to the USEMODULE being recursively expended
in the first iteration of dependency resolution: Modules added to DEFAULT_MODULE
get automatically added to USEMODULE during the first run, but not for
subsequent. This should be iron out later on.


  Commit: c74544c9ec519bde244e04944f93bef8ce981113
      https://github.com/RIOT-OS/RIOT/commit/c74544c9ec519bde244e04944f93bef8ce981113
  Author: Leandro Lanzieri <leandro.lanzieri at haw-hamburg.de>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M Makefile.dep
    M Makefile.features
    M Makefile.include
    M bootloaders/riotboot/Makefile
    M doc/doxygen/src/build-system-basics.md
    M drivers/Makefile.dep
    M makefiles/dependencies_debug.inc.mk
    A makefiles/dependency_resolution.inc.mk
    A makefiles/features_check.inc.mk
    A makefiles/features_modules.inc.mk
    M makefiles/info-global.inc.mk
    M makefiles/info.inc.mk
    M tests/driver_ws281x/Makefile
    M tests/minimal/Makefile
    M tests/unittests/Makefile

  Log Message:
  -----------
  Merge pull request #13349 from maribu/dependency-or

build system: Restructure dependency resolution


Compare: https://github.com/RIOT-OS/RIOT/compare/cd0b7653460b...c74544c9ec51


More information about the commits mailing list