Skip to content

Commit

Permalink
Merge pull request #21060 from mguetschow/make-random-prng-default
Browse files Browse the repository at this point in the history
makefiles: select default prng _after_ recursive dependency resolution
  • Loading branch information
maribu authored Dec 3, 2024
2 parents d6f4637 + 9f2755a commit 598d575
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
7 changes: 0 additions & 7 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ ifneq (,$(filter libfixmath-unittests,$(USEMODULE)))
USEMODULE += libfixmath
endif

ifneq (,$(filter random,$(USEMODULE)))
# select default prng if no prng is selected
ifeq (,$(filter prng_%,$(USEMODULE)))
USEMODULE += prng_musl_lcg
endif
endif

ifneq (,$(filter spiffs,$(USEMODULE)))
USEPKG += spiffs
USEMODULE += vfs
Expand Down
7 changes: 7 additions & 0 deletions makefiles/defaultmodules_deps.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ ifneq (,$(filter auto_init_libcose_crypt,$(USEMODULE)))
USEMODULE += libcose_crypt_init
endif

ifneq (,$(filter random,$(USEMODULE)))
# select default prng if no prng is selected
ifeq (,$(filter prng_%,$(USEMODULE)))
USEMODULE += prng_musl_lcg
endif
endif

ifneq (,$(filter xtimer,$(USEMODULE)))
ifeq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
USEMODULE += div
Expand Down
2 changes: 1 addition & 1 deletion tests/build_system/external_module_dirs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ It demonstrates:

* Adding a module with source code
* Setting a header include directory
* Adding dependencies, which are evaluated before other modules dependencies
* Adding (transitive) dependencies, which are evaluated before other modules dependencies
* Registering a module for auto-initialization
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
USEMODULE += random
# Set a different prng than the default
USEMODULE += prng_xorshift
USEMODULE += transitive
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set a different prng than the default
USEMODULE += prng_xorshift

0 comments on commit 598d575

Please # to comment.